How I can run espruino / javascript on the M5 Stack?



  • Hi, I'm a JavaScript developer and I would like to run JavaScript on the M5, I've seen that It would be possible using espruino as it has support for the ESP32 but I'm couldn't make it work.

    Currently, I'm flashing espruino with this command:

    esptool.py    \
            --chip esp32                                \
            --port /dev/tty.SLAB_USBtoUART              \
            --baud 961200                               \
            --before default_reset                      \
            --after hard_reset write_flash              \
            -z                                          \
            --flash_mode dio                            \
            --flash_freq 40m                            \
            --flash_size detect                         \
            0x1000 bootloader.bin                       \
            0x8000 partitions_espruino.bin              \
            0x10000 espruino_esp32.bin
    

    and looks like it is flashing the thing there, but I can't use the web IDE to connect to the device, and also it is making an anoying noise through the speaker which I don't know how I can stop it.

    Does anybody know how I can connect to the device or how can I make the web IDE connect to the device?

    Thank you



  • @gabi I saw a suggestion that you need to use 115,200 for flashing the ESP32 and also have that speed set in the web IDE to connect to it...

    Instead of the Web IDE, some alternative means of connecting to the ESP32 are outlined here plus other details: https://www.espruino.com/ESP32#espruino-web-ide

    Using Javascript with the ESP32 is also discussed in the highly recommended and affordable book - "Kolban's Book on ESP32" available here



  • @gabi

    If anyone is interested in Espruino on M5Stack - check out this initialization code:
    https://gist.github.com/vshymanskyy/49accf6355900346fd1418336d6be86e

    It initializes the display, but currently the display works rather slow due to Espruino limitations (hopefully will be fixed in future).

    Also stops the annoying noise! ;)

    0_1530866051419_cf9cefc3-f890-4319-ba51-9da83bc663cd-image.png



  • @gabiHow I can run espruino / javascript on the M5 Stack? 中说:

    how can I make the web IDE connect to the device?

    You should change the Web IDE baudrate to 115200 (in the settings page)