This Python Program, which uses the adafruit_miniesptool library, can be used to update the firmware on the Metro M7 1011. To update the firmware to other than the 1.7.4 version shown below, download the desired version, find out the file md5sum, using the md5sum command on your host computer operating system, and change the filename and the md5sum value.
import time
import board
import busio
from digitalio import DigitalInOut, Direction # pylint: disable=unused-import
import adafruit_miniesptool
print("ESP32 Nina-FW")
# Override these if you are manually wiring. Otherwise, this will use ESP pins from board.
tx = getattr(board, "ESP_TX", board.TX)
rx = getattr(board, "ESP_RX", board.RX)
resetpin = getattr(board, "ESP_RESET", board.D12)
gpio0pin = getattr(board, "ESP_GPIO0", board.D10)
uart = busio.UART(tx, rx, baudrate=115200, timeout=1)
esptool = adafruit_miniesptool.miniesptool(
uart, DigitalInOut(gpio0pin), DigitalInOut(resetpin), flashsize=4 * 1024 * 1024
)
esptool.sync()
print("Synced")
print("Found:", esptool.chip_name)
if esptool.chip_name != "ESP32":
raise RuntimeError("This example is for ESP32 only")
esptool.baudrate = 115200 * 4 # speed up so we can wrap it in under 2 minutes
# Test connection again by asking for the MAC address
print("MAC ADDR: ", [hex(i) for i in esptool.mac_addr])
# Note: Make sure to use the LATEST nina-fw binary release! update the md5sum as well
esptool.flash_file("NINA_W102-1.7.4.bin", 0x0, "80c2dfd8ad2e97b2c32899382860acb1")
esptool.reset()
time.sleep(0.5)
Page last edited February 17, 2025
Text editor powered by tinymce.