Categories
Microcontrollers MicroPython

MicroPython (Python 3) for ESP8266 – ESP01 (512KB)

Requirements

v1.12 and earlier will work on modules with 1M or more of flash, while v1.13 requires 2M or more.

ESP8266 ESP01 (512K flash) supported by limited features.

ESP01/01s USB-UART Programmer and UART device drivers. For uploading firmware and Python REPL from the serial console

PC / Notebook (Windows/MacOS – Intel) has been installed with Python 3.x and esptools.py utility program. Try this to install esptools

Thonny and Visual Studio IDE for coding editor for python

pip3 install esptool

Download Firmware

https://github.com/micropython/micropython/tree/master/ports/esp8266

https://micropython.org/download/esp8266/

Upload lastest firmware to ESP8266 (512 KB) with esptools.py utility installed on the PC/Notebook (Window/MacOS – Intel) and ESP01/01s USB-UART Programmer

This image has an empty alt attribute; its file name is USB-ESP01-PROG%20(5)-800x800.jpg
Source: Cytron Technology

Using esptool.py you can erase the flash with the command:

esptool.py --port /dev/ttyUSB0 erase_flash

And then deploy the new firmware using esptools.py and filename of the latest binary ESP8266 firmware.

esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 esp8266-xxxxx.bin

Using MicroPython (REPL) via USB-UART (Serial) Programmer on MacOS (Intel) screen utility

screen /dev/tty.SLAB_UART 115200

Note: Press ENTER key when the blinking cursor is on the screen without the REPL prompt.

>>> print(“Hello MicroPython”)

Blink LED (build-in) and main.py filename

Tutorials

http://docs.micropython.org/en/latest/esp8266/tutorial/index.html

Tutorial of Thonny IDE installation (MacOS – Intel)

https://github.com/thonny/thonny/wiki/MacOSX

Troubleshooting Problem

http://docs.micropython.org/en/latest/esp8266/tutorial/intro.html#deploying-the-firmware

Resources

http://docs.micropython.org/en/latest/esp8266/quickref.html

https://micropython.org/unicorn/

https://micropython.org/

https://thonny.org/

Categories
ESP32 Microcontrollers MicroPython

Flash MicroPython Firmware

Download firmware for Generic ESP32 module

https://micropython.org/download/esp32/

Install esptool.py

pip install esptool

Assumed the USB-Serial chip driver has been installed. Check the Operating System platform (Win/MacOS/Linux) port assignment for the attached MCU board via USB port.

On MacOS (Intel) : sudo ls -al /dev/tty.*

Erase the firmware (flash)

esptool.py --port /dev/tty.SLAB_USBtoUART erase_flash

Deploy the new firmware (recent downloaded esp32-xxx-xxx.bin file) to flash address 0x1000

esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART write_flash  -z 0x1000 esp32-20180511-v1.9.4.bin

Test MicroPython (REPL)

On MacOS (Intel): screen command

screen /dev/tty.SLAB_USBtoUART 1152000

>>>

Ctrl + a and Ctrl + k and y to kill the terminal session

Resources

https://docs.micropython.org/en/v1.15/esp32/tutorial/intro.html