Espruino on ESP8266

Posted on
Page
of 6
First Prev
/ 6
  • FYI, I started a wiki page for esp8266 design notes: https://github.com/espruino/Espruino/wiki/ESP8266-Design-Notes

  • @Gordon how & when would you like to handle merging my esp8266 fork back into mainline? There are a number of things still on my todo list:

    1. supporting timers
    2. reviewing GPIO (I don't understand why there are only 8 in Espruino when the esp8266 has 16)
    3. adding i2c support
    4. revisiting Wifi & its initialization
    5. getting someone else to test my fork a bit, specially on 512KB modules and non-linux compilation
    6. reformatting the esp8266 files to have the same indentation as the rest of espruino

    I plan to spend significant time on this this week-end, but I'll be working very little (if any) on it this coming week. Dunno whether you want to sync up. Of course anyone can merge my fork to their fork or mainline anytime.

  • @tve are you coordinating with @Kolban? I hope you are, since he's simultaneously doing work to support esp8266... It'd be no fun of you were both doing the same things, or if your work and his work were conflicting.

    My feeling (Not sure if Gordon agrees, but I think he's said things to that effect) is that you should pull request often, since there's another person working on that, and Esp on the ESP is not in a release ready state yet anyway, so there's nothing to break

  • Since the merge a week when the work @blaz had started was merged into the single Espruino github repository, everything I have been working on since that time has been against an issue (see https://github.com/espruino/Espruino/issues) and when worked upon to a state where it was unit tested and (to the best of my ability) not regressed anything, a pull request was issued against the master waiting for @Gordon to approve and issue a merge. Because I am now working against the Espruino master repository, I have benefited by being able to pull the latest work performed by others and also pushed into the repository.

    I'd suggest that what you probably want to do is create an issue for each area you have addressed, merge the code changes for each issue (one at a time) ... and created as many issue specific pull requests as needed. There may already be issues that already exist that you might want to look at to do work against. For example, there is an issue for getting GPIO settings right, an issue for getting the new code formatting correct and others.

    I also recommend creating issues even if you aren't ready to work on them immediately. A lot of the issues have notes and comments and design proposals already in them.

  • Pull request created: https://github.com/espruino/Espruino/pulls
    I'm gonna take a little bit of a break on the esp8266 and see how much promise the emw3165 holds. The crappy SDK and HW in the esp8266 has gotten at me, plus I just received an emw3165 WifiMCU...

  • Thanks! I'll pull it in today and try and answer those questions

  • Wow, thats very cool!!! I just ordered an esp8266 to try it using js!

  • If I pressed save on esp8266 board, and then I cannot use the board again couse it resets, how can I flash a working js code again?

    ets Jan 8 2013,rst cause:4, boot mode:(3,6) wdt reset load 0x40100000, len 30648, room 16 tail 8 chksum 0x4f load 0x3ffe8000, len 2108, room 0 tail 12 chksum 0x00 ho 0 tail 12 room 4 load 0x3ffe8840, len 28804, room 12 tail 8 chksum 0xb6 csum 0xb6 Øïsys=70011 rtc=3649716yrl§Loading -491521 bytes from flash...

  • Dear all,

    Tonight I had a few hours to try the ESP-01 port of Espruino. I think the firmware upload succeeded (from this source : https://github.com/espruino/EspruinoBuilds/tree/master/ESP8266). I flashed the binaries at 0x00000, 0x10000, as well as the script (main.js) at 0x60000, but after a reset (as well as GPIO0 released), I got bad news: ESP-01 sent me
    "ets Jan 8 2013,rst cause:1, boot mode:(3,0)
    ets_main.c"

    I read on a forum that this is probably that the ESP did not find any application code to run.

    Did you ever had to deal with this issue?

    (the build date is "Build 2015-10-25 6:02pm CT" )

  • Howdy ... have a look at this video and see if it matches close to what you tried ... see:

    https://www.youtube.com/watch?v=aJj4WJzAo4w

    You shouldn't be flashing any JavaScript (at least not that I am aware off) ... rather you should be attaching the Web IDE and entering JavaScript there.

    There is a quite active live chat on Espruino (and Espruino on ESP8266) here https://gitter.im/espruino/Espruino where there may be folks who can assist live.

  • OK now it works. I think the espruino_esp8266_board_0x10000.bin was not the one I needed, moreover it seems that it is an exact copy of espruino_esp8266_board_0x00000.bin (at least the size is the same). Instead, I used the binaries that I found in the ZIP file (https://github.com/espruino/EspruinoBuilds/blob/master/ESP8266/espruino_esp8266_board_binaries.zip), and it works like a charm!

    Thank you Kolban for your help :-)

  • Is there any getting started guide for using WiFi on the ESP8266 as the Espruino? Instructions on how to connect and use the WiFi API aren't immediately obvious and I've had to troll through the docs to just find and information, and I couldn't find any examples. Apologies if I'm just silly and can't find the information. It's amazing work you've all done.

  • Howdy Ducky,
    Have a look at the following and see if this helps ...

    https://github.com/espruino/Espruino/blob/master/targets/esp8266/docs/05-User_Guide.md

    If that doesn't completely answer your questions, PLEASE post back so that we can address by making those docs clearer.

  • Hmm, I get

    WARNING: Module "wifi" not found
    WARNING: Module "ESP8266" not found
    
  • Howdy Ducky ... this warning can be found as a tracked issue here:

    https://github.com/espruino/Espruino/issues/675

    Thankfully the warning can be "ignored" and all should function. This one needs @Gordon to look into it as it appears to relate to files managed by the Web Server located at "espruino.com". My loose understanding is that when we use the Web IDE and execute a "require" then that causes a REST request to be made from the IDE back to "espruino.com" which, loosely, says "I would like a copy of the JavaScript corresponding to that named module". I believe that the REST request also includes the type of board you are using so that if there is board specific code, that can be matched correctly. Since the board you are using is an "ESP8266" and, currently, the web site doesn't know what that is ... you get a warning message. However, since the module is actually "built-in" to the ESP8266 firmware, all still works as there was nothing to be downloaded in the first place.

  • Wow, thanks for your speedy reply. Hmm "arrayOfAcessPoints" is null for me, but perhaps my ESP8266 just isn't detecting any networks.

    Also, Uncaught ReferenceError: "esp8266" is not defined for esp8266.getAddressAsString -- Fixed by replacing esp8266.getAddressAsString with ESP8266WiFi.getAddressAsString, maybe change the doc?

  • What level of the firmware are you using? The docs "should" match the latest firmware.

    Live chat is available here if needed ...

    https://gitter.im/espruino/Espruino

  • That was 1v81.705 on a NodeMCU ESP-12

  • I tried the following and it seemed to work ... can you try same?

    var esp8266 = require("ESP8266");
    print(esp8266.getAddressAsString(123));
    
  • the wifi.scan() method has been updated recently. the previous callback prototype was "function(aps,...)" ans is now "function(res,aps,...)". You may have to use the second parameter instead of the first one, to work on given ssid list

  • Is there any documentation about how to compile Espruino for Esp8266? I would like to include some extra library to the framework, like RcSwitch...

  • You could copy everything to an ubuntu-vm from @tve server:
    git clone https://github.com/tve/Espruino.git
    curl -Ls http://s3.voneicken.com/xtensa-lx106-elf.tgx | tar Jxf -
    curl -Ls http://s3.voneicken.com/esp_iot_sdk_v1.5.0.tgx | tar Jxf -

    next assign variables:
    ESP8266SDK_ROOT needs to be set to esp_iot_sdk....
    and xtensa-lx106.... is appended to path

    last not least cd to Espruino folder and:
    ESP8266_BOARD=1 make

  • Although have you checked out the existing 433Mhz stuff on the website? There's already quite a bit there for controlling 433Mhz devices from JS

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Espruino on ESP8266

Posted by Avatar for JumJum @JumJum

Actions