Mon, 27 Feb 2023 16:22:19 +0100
Changed the MicroPython super menu to always present the 'Flash UF2 Device' menu entry because some devices don't have a valid serial port when in UF2 'bootloader' mode.
def connectWiFi(): import esp32 import network from time import sleep try: nvs = esp32.NVS("wifi_creds") buf = bytearray(1024) size = nvs.get_blob("ssid", buf) ssid = buf[:size].decode() size = nvs.get_blob("password", buf) password = buf[:size].decode() wifi = network.WLAN(network.STA_IF) wifi.active(False) wifi.active(True) wifi.connect(ssid, password) max_wait = 140 print("Connecting WiFi to '{0}'...".format(ssid)) while max_wait and wifi.status() == network.STAT_CONNECTING: max_wait -= 1 sleep(0.1) print("Connection status:", wifi.isconnected()) except: pass connectWiFi()