I’ve got an ESP8266 that I want to deploy in a web-connected stepper motor project. I’ve been meaning to try Espruino on it for a while, so here’s how I got started:
- Download the Espruino firmware package from the “Download” link at the top of https://www.espruino.com/Download. At time of writing, the latest is 1V91. This package contains binaries to flash to a bunch of mainstream supported boards, of which the ESP-12E is one. Extract it somewhere useful.
- Get esptool for flashing. This python utility used to be a community project but now has mainstream support from Espressif, so that’s cool. It’s also in pypi, so you can simply install it with pip install esptool. Of course, you’ll need python – I’ll leave that as an exercise for the reader.
- Plug in your ESP8266 and figure out which COM port it is (windows) or serial port (/dev/tty* in linux/mac). I used the Arduino IDE to figure out which new device came up, but you could also use Device Manager on windows to find which COM port comes up as a Silicon Labs CP210x device. Mine was COM8.
- Open a terminal/powershell to where you extracted the download in step 1. There’s a subdir for the ESP8266 you should be in. Have a look at the readme.
- I made a copy of the “4MB flash device” command on line 10, adding my proper COM8 port name. Run that to load the firmware. See my note on this below.
- After this, you can start interacting with the command line on the device with a serial terminal client – screen on linux/mac, or in my case, PuTTY on windows. I fired up Putty with COM8/115200 and started poking around.
- Now, get the Espruino IDE from the chrome web store at https://chrome.google.com/webstore/detail/espruino-web-ide/ and get going!
NOTE about flash command: I’m working on Windows 10, in Powershell, using Python 2.7 and a virtualenv with esptool installed via pip. I’m not sure what pieces of this setup consipired to make things difficult, but despite esptool.py being found on the path, I couldn’t execute it with python esptool.py. For whatever reason, this ended up being the full command I got to work:
$ python C:\Users\alexw\.virtualenvs\esp8266/Scripts\esptool.py --port COM8 --baud 115200 write_flash --flash_freq 80m --flash_mode qio --flash_size 32m 0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x37E000 blank.bin
Note the full path to esptool.py, which I found with which esptool.py.
Be First to Comment