Espruino on ESP32

Posted on
  • Hey there ESP32 users!

    I would be very happy if you support the ESP32 build by testing and reporting functions that are not working as they should or missing because not implemented yet.

    At the moment esp-idf 3.1.3 is used, but there are plans to switch to 4.x

    Please join this post and name the function tests and results.

    After there is a good understanding of the scope, we can try to work together on using esp-idf 4.x

    So jump on and support the ESP32 build.

    @Gordon can you please pin this - Thanks.

    Edit: Created issue Improve EP32 implementation #1777

  • Hello, very interesting to keep updated the version to ESP32. And it would be great to migrate to ESP-IDF 4 to take advantage of its advances.

    I am personally working with the ESP32 version and Espruino v2.0.130 for a year, for educational purposes.

    Basically I try to use and test all the functions of Espruino focused on ESP32 hardware. I consider ESP32 + Espruino a more advanced platform than Arduino UNO. And with a more user-friendly adaptation it has a great future.

    Everything that I can help and try you can count on me.

    The rest of the information I share on the Github.

    Richard Gomez

  • Everything that I can help and try you can count on me

    Great!

  • HTTPS, TLS& SSL not working at 2.05, 2.04... I describe it separate topic for ESP32.
    Often fs has bug return true on read or write operation but real result is false, if you call when other process like POST in operate so that need you in any way but according description JS support only sync mode and usually is ok for async mode.

  • Often fs has bug return true on read or write operation but real result is false

    check the latest 2v05 build, it has a fix for this issue.

  • Additionally some troubles with events:

    1. wifi.on('sta_left' )- reacted on events when client leave AP point in mode STA+AP
    2. mqtt.on('disconnected') - after 7-8 hours of work loose events.
  • Hi,

    I'm experiencing problems on the ESP32 when Storage.compact() is called, either explicitly or as a result of calling a write method.

    In the last hour I compiled Espruino from a clone of the source on Github and using the example code in this issue, I'm getting the same Stack Overflow problem there described.

    Sometimes instead of a stack overflow, I see a guru meditation error:

    Guru Meditation Error: Core 0 panic'ed (LoadStoreError). Exception was unhandled

    In the project I'm trying to work on, I'm storing configuration in Storage and updating settings a second time causes a crash.

  • would be great if you check this issue and add things that are missing.

    You are welcome to fix issues for ESP32.

  • I have added a comment on that issue.

    I am having a go at finding the cause but I can't promise to get results. I only set up an environment for compiling Espruino yesterday and I don't have much experience with C. I will be happy if I can give something back though.

  • If you get stuck, just ask.

  • Is there a simple way to lookup exactly which BLE functions ARE supported by the latest and greatest for the ESP32? I just need some simple BLE GATT client support for my application...

    When you look at Gordon's support page he flat states the NO BLE support is in the binary, so anything is a win/win.

  • I would say this is a good starting point

    https://github.com/espruino/Espruino/tre­e/master/targets/esp32

    this is a good starting point than dive into folder BLE

    and than check what's possible:

    http://www.espruino.com/Reference#Blueto­othDevice
    http://www.espruino.com/Reference#Blueto­othRemoteGATTCharacteristic
    http://www.espruino.com/Reference#Blueto­othRemoteGATTServer
    http://www.espruino.com/Reference#Blueto­othRemoteGATTService

    If you like you can share your tests so it could be added to this folder

    https://github.com/espruino/Espruino/tre­e/master/targets/esp32/tests

    @JumJum Do you have some test snippets you used during the implementation you like to share?

  • Thank you!

  • Hi Espruino Guys!

    I like Javascript and have a big admiration for your work, to develop the interpreter and port it to many boards. Recently I have flashed an Espruino firmware to an ESP32-mini32 board. It worked nicely, first uploaded and using the WebIDE from a USB connection (I think it's a nice piece of work, better elaborated then Micropython's Webrepl, for example).

    Then I thought to leave it standalone, and connect to it wirelessly. The Web IDE connected and started working, but suddenly it dropped the connection after 20 seconds. A reboot reconnected, only to have dropped it again. This behaviour (connection dropping in under 1 minute) was "consistent".

    First I suspected the IDE client, so I just powered the board - having Wifi connection on boot - and started to ping it from outside. And I discovered that the Wifi connection itself was dropping!

    Now I suspected the power supply, so I put a 3A one, then the Wifi signal strength. So I moved the board closer to the router - it reported an rssi of -55 dBm, which should be very good. Unfortunately neither solution did help in any way.

    So I did not know what to do. Lastly, I flashed a Micropython firmware, which did not show any instability with the Wifi. Sorry for it.

  • I have an issue somewhat similar to user124799. I recently picked up a couple of MELIFE ESP32 boards because I'm having trouble obtaining Espruinio WIFI boards (so sorry Gordon!). I flashed 2v08 and ran this simple web server:

    var wifi;
    var count = 0;
    
    function getContent() {
      return '<html><h1>' + count++ + '</h1></html>';
    }
    
    function sendPage(res) {
      var content = getContent();
      res.writeHead(200, {'Content-Type': 'text/html', 'Content-Length':content.length});
      res.end(content);
    }
    
    function onPageRequest(req, res) {
      var a = url.parse(req.url, true);
      if (a.pathname=="/") {
          sendPage(res);
      }
    }
    
    function onConnected() {
      wifi.getIP(function(e,ip) {
        lip = ip.ip;
        require("http").createServer(onPageReque­st).listen(80);
      });
    }
    
    function onInit() {
      wifi = require("Wifi");
      setTimeout(onConnected, 2000);
    }
    

    I used a timeout because wifi.connect("***", { password : "***" }, onConnected) doesn't seem to call 'onConnected'. Anyhow, it runs okay for a minute or so then dies. The console shows this error:

    >E (5287) event: post event to user fail!
    E (8131) event: post event to user fail!
    WARNING: Wifi:startMDNS - espressif
    >E (34066) event: post event to user fail!
    E (36911) event: post event to user fail!
    

    The first 3 lines print on bootup - the last 2 lines print right when the ESP32 dies.

    Searching on the error led me to this page:
    https://github.com/espruino/Espruino/iss­ues/1571
    Which led me to try an older build - specifically this one:
    http://www.espruino.com/binaries/travis/­1a1fd36b740547ece5dda46220c9489bdbd17ff0­/espruino_esp32.bin

    Which looks like 2v00.42. The ESP32 works fine with this build.
    Is there a wifi issue with 2v08?

    Allen

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

Espruino on ESP32

Posted by Avatar for MaBe @MaBe

Actions