Petter Holt Juliussen • Mail | Mastodon | GitHub | Letterboxd

for later reference.




Dev Kit v1

Listing: ESP-32S ESP32 NodeMCU Development Board 2.4GHz WIFI+Bluetooth Dual Mode

ESP32-D0WDQ6 rev1, 240 MHz, 40 Mhz crystal, 4M flash


$ pip install esptool

# For  1M Flash:
$ python -b 115200 --port COM3 read_flash 0x000000 0x100000 flash_1M.bin 
$ python -b 115200 --port COM3 write_flash --flash_freq 80m 0x000000 flash_1M.bin 

# For  4M Flash:
$ -b 115200 --port COM3 read_flash 0x00000 0x400000 flash_4M.bin
$ -b 115200 --port COM3 write_flash --flash_freq 80m 0x000000 flash_4M.bin


# Erase flash first
$ --chip esp32 --port COM10 erase_flash

$ --chip esp32 --port COM10 --baud 460800 write_flash -z 0x1000 <bin_file>
# Using the REPL (over serial)
>>> import machine
>>> pin = machine.Pin(2, machine.Pin.OUT)
>>> pin.on()

File system

>>> import os
>>> os.listdir()

There are two files that are treated specially by the ESP8266 when it starts up: and The script is executed first (if it exists) and then once it completes the script is executed. You can create these files yourself and populate them with the code that you want to run when the device starts up.

Adafruit MicroPython tool (ampy)

MicroPython Tool (ampy) - Utility to interact with a CircuitPython or MicroPython board over a serial connection.

Ampy is meant to be a simple command line tool to manipulate files and run code on a CircuitPython or MicroPython board over its serial connection.

$ pip3 install adafruit-ampy

$ ampy.exe --port COM10 ls
$ ampy.exe --port COM10 run