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

  • Hola como estan? Soy nuevo usando microcontroladores esp, tengo un esp-wroom-32. No puedo conectar el espruino web ide a la placa ni subir códigos. Pueden ayudarme? Tal vez con algún tutorial para traducir.

  • Hello
    Thank you for helping me.

    The problem that I have, I have been working on ESP32 firmware for 3 days, but unfortunately I did not succeed. I tested it on Windows, wsl, it didn't work. I worked on a series of commands on Termux Android, but it is not clear where the bootloader was stored.

    Please help me, it is very important, if it is a video tutorial, it will be great

    Thanks

  • Hi @Salariz,

    I don't feel particularly able to answer your question but below are a set of links I have collected over the last few years. I thought it may help if I share. The first link should answer your question and the rest are links to things I wish I had found sooner when I started tinkering inside Espruino.

    Gary

    Compiling:
    https://github.com/espruino/Espruino/blo­b/master/README_Building.md

    Extending:
    http://www.espruino.com/Extending+Esprui­no+1
    http://www.espruino.com/Extending+Esprui­no+2

    JSON Extension Format:
    https://github.com/espruino/Espruino/blo­b/master/scripts/common.py#L52

    Espruino Internals:
    http://forum.espruino.com/conversations/­357006/#comment15666995
    http://forum.espruino.com/conversations/­302250/
    http://www.espruino.com/Internals

    ESP-IDF
    https://docs.espressif.com/projects/esp-­idf/en/release-v3.3/api-reference/index.­html

  • Hello

    I will definitely try these items. Thank you very much for sharing your experiences. I looked around and did not find these links. After I try them, I will definitely tell you here.

  • Thank you very much.

    You helped me a lot I took time today and did what you said and finally my main problem was that Windows Ubuntu WLS couldn't find python but I installed it and after that I was able to output my ESP32 :)

    Thank you Espruino.

  • Just posted first approch for ESP-IDF v4.4.4 on githup

    Edit: It is not working at all .......

  • Found this nice online ESP Stack Trace Decoder developed by Maxime BORGES.

  • Wow, very nice! that could really help (assuming you have the build yourself so you have the elf)

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

Espruino on ESP32

Posted by Avatar for MaBe @MaBe

Actions