How to install Espruino firmware in an ESP8266 board

espruino_logo

This is an update to the installation tutorial I’ve already wrote: Run JavaScript on your ESP8266 using Espruino firmware

For this installation I’m using a D1 mini board which is a “wrapper” for the ESP8266 (ESP-12) board.

Flash the Espruino firmware

The first step is to flash the Espruino firmware into the ESP board. You can find a tutorial in the Espruino site. In this article I’m putting a short list of instructions ready to use.

Install the ESP tools with the following command:

The ESP tools are a set of Python scripts necessary to flash a firmware in the ESP board.

We need now the last version of the Espruino firmware, you can get it from the download page of the Espruino site. The zip file will contain the Espruino firmware also for the ESP8266 board.

We are ready to flash our board. The following instruction are for a ESP-12 board connected to the /dev/ttyUSB0 port. Please refer to the original tutorial for a different version of the ESP board. First move to the folder where you have unzipped the firmware.

The blue led in the board will start blinking and you will see the following output in console:

If you’re having problems finding the correct device path in Linux:

  • first check that you’re using an USB data cable. The first time I’ve tried I was getting crazy because I was using a simple power USB cable.
  • second try this console command to print the system events when the USB cable is plugged:

    When you plug the cable you will get something like this:

Ready to run

After the flash operation the board is ready to receive your JavaScript commands!

To send the commands you need to connect to the board using a serial connection (through the USB port). Under linux you can use the screen program:

Now you can send JavaScript commands that will be interpreted and the output provided as response.

For example writing:

you will get:

You can call functions, for example:

it will reset the board and print a boot message:

If you want to exit from Screen press CTRL-A and then \.

Now you’re ready to write your JavaScript code and run it in a ESP8266 board, for example using the Espruino Web IDE.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.