Part-1: Load Micropython into ESP8266 feather microcontroller board

Adafruit Feather ESP8266( Adafruit official site ) microcontroller with WIFI module looks so tiny but it processes huge functions. You can load micropython interpreter into it so that you can control it with python codes 🙂

feather ESP8266

 

Now to do that, you need to empty its memory first and flash it with micropython firmware.

we first connect the board to computer through serials port

The process was done in ubuntu 16.04 for me (you might have to do it as sudo):

  1. connect esp8266 to your computer using a USB to micro B cable. I use my kindle2 cable.
  2. open terminal to find which COM port it has connected to: $cd /dev/; $dmesg | grep tty   ##remember the path to the port, for me it is /dev/ttyUSB0
  3. then install esptool.py:  $ sudo pip install esptool
  4. go to firmware download the latest stable micropython firmware
  5. use esptool to erase the flash: $sudo esptool.py –port /dev/ttyUSB0 erase_flash
  6. In terminal,  go to where you store the micropython firmware file. Then load this file into the machine: $sudo esptool.py –port /dev/ttyUSB0 –baud 115200 write_flash –flash_size 4MB 0 esp8266-20170612-v1.9.1.bin                                               # Note: 115200 is the transfer speed and in flash_size write down the actual megabytes 
  7. It will take a few seconds and your machine will be flashing blue led.
  8. Remember to push reset button on your esp8266 board
  9. You need to download screen tool as well: $sudo apt-get install screen to communicate with the machine through the port. In Windows, you can use PuTTY.
  10. To start the repl: $sudo screen /dev/ttyUSB0 115200

Then you are all set to play!

Leave a comment