Web IDE: ok, NPM espruino: not ok

Posted on
  • Hi,

    I got a neat ESP32 board and tested Espruino (1.92) on it. Works like a charm when using the Web IDE. Uploading via NPM espruino module works. About once in 10 times. It sends data (-v switch is very useful here), and it usually does something, but often it seems to forget everything immediately, like if there is a reset() after upload.

    E.g. I have a small program uploaded which:

    1. Sets up I2C1
    2. Loads SSD1306 library and initializes the OLED (connected via I2C)
    3. Prints text on the OLED. This works 100%. The OLED is initialized and text appears.
    4. Supposed to print more every second (via setInterval()). That does work once in about 10 times.

    In the cases where it does not work, the serial console is usually no longer working until I reset the board. In the few cases where the console is accessible, I can connect via minicom, and I see nothing being remembered of my program. Looks like a reset happened. Namely the variable g I use for the OLED is not defined anymore. No wonder it cannot write anything to the display.

    The Web IDE works. Always.

    Any idea what's causing the NPM espruino to not work as well as the Web IDE?


  • Digging a bit around, this works and it's reliably working: Use espruino -o x.js MYPROGRAM.js and then upload the temporary output, which resolves all require() modules via wifi (nc ESP32IP 23 < x.js)

    That proves at least that whatever the espruino command does, seems to work. The problem might be an intermittent reset caused by the serial port.

  • I'm sure others will chip in soon, but there seemed to be some kind of issue with the actual USB interface chip on the ESP32 (and other?) boards. Repeated connect/disconnect cycles close together could totally break it - I seem to recall there was a bug filed because there were prob;ems with it after using the esp32 flasher tool.

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

Web IDE: ok, NPM espruino: not ok

Posted by Avatar for HaraldK @HaraldK