We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1879edd + 17808c3 commit 5ed94d3Copy full SHA for 5ed94d3
examples/micropython.py
@@ -87,8 +87,11 @@ def wifi_connect():
87
88
wlan = network.WLAN(network.STA_IF)
89
wlan.active(True)
90
- wlan.connect(WIFI_SSID, WIFI_PASS)
91
- while (not wlan.isconnected()):
+ while not wlan.isconnected():
+ try:
92
+ wlan.connect(WIFI_SSID, WIFI_PASS)
93
+ except Exception as e:
94
+ logging.error(f"Failed to connect to WiFi: {e}.")
95
logging.info("Trying to connect. Note this may take a while...")
96
time.sleep_ms(500)
97
logging.info("WiFi Connected ", wlan.ifconfig())
0 commit comments