Skip to content

Instantly share code, notes, and snippets.

@edwios
Created October 2, 2017 10:30
Show Gist options
  • Save edwios/5f97d6d747ec1c86d2fe90125576a9a4 to your computer and use it in GitHub Desktop.
Save edwios/5f97d6d747ec1c86d2fe90125576a9a4 to your computer and use it in GitHub Desktop.
Install MicroPython and running python scripts on ESP32
Tools required
esptool.py: pip install esptool
ampy: pip install adafruit-ampy
Download firmware for ESP32 from MicroPython: http://micropython.org/download#esp32
Installation
Erase flash on ESP32: esptool.py --port /dev/tty.SLAB_USBtoUART erase_flash
Flash firmware to ESP32: esptool.py --port /dev/tty.SLAB_USBtoUART --chip esp32 write_flash -z 0x1000 esp32-20171001-v1.9.2-274-g59ab4a22.bin
Python prompt
Connect via serial to ESP32: minicom -D /dev/tty.SLAB_USBtoUART -b 115200
Set default serial port for ampy: export AMPY_PORT=/dev/tty.SLAB_USBtoUART
Upload python script to ESP32
ampy put helloworld.py
Run python script from computer on ESP32 and output to console
ampy run helloworld.py
For non-returning script, add --no-output
ampy run --no-output helloworld.py
Setting boot and autorun script - replace the following on ESP32:
boot.py
main.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment