pip install esptool
pip install adafruit-ampy

identify chip_id

Download firmware from

erase flash (before any micropython deploy)

export PORT=/dev/ttyUSB1 --chip esp32 --port $PORT erase_flash

write firmware --chip esp32 --port $PORT write_flash -z 0x1000 esp32-20181103-v1.9.4-683-gd94aa577a.bin

Based on loboris fork of micropython

sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial
git clone --depth 1
cd MicroPython_ESP32_psRAM_LoBo
cd MicroPython_BUILD
./ menuconfig
./ flash
# reboot board disconnecting power

If you are putting MicroPython on for the first time then you should first erase the entire flash --port /dev/ttyUSB0 erase_flash

download micropython from


erase (optional ?) and upload

#esptool --port /dev/ttyUSB0 erase_flash
esptool --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 esp8266-20180511-v1.9.4.bin

# oppure
esptool --port /dev/ttyUSB0 --baud 115200 write_flash --flash_mode dout --verify --flash_size=detect -fm dio 0 esp8266-20180511-v1.9.4.bin

after press buttons !!!!

access from serial over USB

sudo apt install picocom
picocom /dev/ttyUSB0 -b115200

network wifi STA

import network
sta_if = network.WLAN(network.STA_IF)
sta_if.connect('<your ESSID>', '<your password>')

('', '', '', '')

enable webrepl

import webrepl_setup

reboot and connect to webrepl using

ampy -p /dev/ttyUSB0 put  /
from machine import Pin
from time import sleep

# GPIO16 (D0) is the internal LED for NodeMCU
# PIN 22 fro TTGO MINI32
led = Pin(16, Pin.OUT)

# The internal LED turn on when the pin is LOW
while True:
    led.value(not led.value())
  • projects/internetofthings/micropython.txt
  • Last modified: 2018/11/03 08:46
  • by scipio