Close

Installing Micropython

A project log for One IoT

A series of development boards aimed at making IoT development a breeze!

Louis IrwinLouis Irwin 04/24/2019 at 20:420 Comments

With a breakout assembled, I now have to install Micropython.

There's a great set of instruction here, but I found I needed to take some additional steps. 

Below, I will outline what worked for me. I was working on Ubuntu with Python 3 installed.

Required:

Steps:

  1. Wire up the ESP32 as shown in the following diagram
    The 3v3 and GND connections power the board
    The EN connection controls resetting the board
    The GPIO0 and GPIO2 connections set the board in 'DOWNLOAD_BOOT' mode
  2. Download esptool from here, and unzip
  3. Download the latest micropython .bin file from here (Latest version as of 25/4/19 is esp32-20190425-v1.10-293-g56f6ceba7.bin)
  4. Open a terminal in the esptool directory
  5. Power the board and plug in the USB cable
  6. Move the enable line (shown in blue) from GND to 3V3 to enable the ESP32
  7. Run this command to find the port that is being used 
    dmesg | grep tty

     In my case, running this gave

    [    0.000000] console [tty0] enabled
    [   167.73492] usb 1-6: FTDI USB Serial Device converter now attached to ttyUSB0

     So I can see that it is attached to ttyUSB0 from line 2

  8. Then run the following, replacing 'ttyUSB0' with the port the previous step gave

    sudo python3 esptool.py --port /dev/ttyUSB0 erase_flash
    
  9. Finally, run the following, again replacing 'ttyUSB0' and the location of where you downloaded the .bin file ('esp32-201 ... 9.4.bin)

    sudo python3 esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 esp32-20180511-v1.9.4.bin
  10. With this completed, I can now use that serial port to access micropython's REPL python prompt and run commands!

Discussions