Download Espruino Image
Navigate to the download section of the Espruino website, and download the latest version of the Espruino firmware.
Once downloaded, go ahead and move the zipped file to a known location on your computer. Here we’ll create a folder inside our user’s directory called ESP8266-Espruino. From your Terminal App type in.
cd ~ && mkdir ESP8266-Espruino
We then move and unzip the file inside the said directory.
pySerial is a Python module that allows a Python program to communicate with a serial (e.g., USB, RS232) port. The tool that we’ll use to load the Espruino firmware onto the ESP8266 Development Board is written in Python, and it uses this module to communicate with the USB port for writing out the firmware to (specific) devices connected to it.
Arguably, the simplest way to install this is by downloading the source code from the project’s Github repository:
cd ESP8266-Espruino && git clone https://github.com/pyserial/pyserial
Then, we can install the pySerial module in our system. Here we’ll make it available for our entire system (system-wide install).
cd pyserial && sudo python setup.py install
Downloading Software For Loading Espruino Onto The Board
The last piece of software we need is the program that will allow us to write the Espruino firmware onto the ESP8266 Development Board over USB (using amongst other things the pySerial module). To get this tool we can simply:
cd .. && git clone https://github.com/themadinventor/esptool
Because Espruino runs in a variety of boards, we need to find the directory with the files corresponding to the ESP8266. This is located inside our espruino_1v95 folder. We can then start writing the Espruino firmware with ease!
python ../../esptool/esptool.py --port /dev/tty.SLAB_USBtoUART --baud 115200 \ write_flash --flash_freq 80m --flash_mode qio --flash_size 32m \ 0x0000 "boot_v1.4(b1).bin" 0x1000 espruino_esp8266_user1.bin \ 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin
If everything goes well, you should get something similar to what’s shown on this screenshot (no errors):
screen /dev/tty.SLAB_USBtoUART 115200
And we should establish a connection to the USB port at a baud rate of 115200 (press Ctrl-A followed by Ctrl-\ to quit). The screen should go blank at this point, so the easiest test is to reset your ESP8266 Development Board, which outputs the startup message shown below once the Espruino firmware starts running:
Finally, we can use the Espruino API to test out a few commands. Connect an LED to the pin labeled D2 on the board, which corresponds to GPIO4 on the ESP8266 SoC. If we input the command:
The LED should turn on!
NOTE: Remember that the Espruino firmware uses the GPIO numbers instead of the board labels to refer to each pin.
Latest posts by sarah ali (see all)
- Maximum Allowed Google AdSense Ads on your WordPress Blog - January 19, 2018
- How to Get Started with Google AMP in WordPress - January 18, 2018
- 5 Best Backup Plugins for WordPress 2018 - January 14, 2018