Skip to content

Commit 5e79f58

Browse files
Update code.py
Fixed wifi error issue
1 parent f2f34e6 commit 5e79f58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Async-WiFi-NTP-DST-Template/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def wifi_connect_sync():
117117
try:
118118
wifi.radio.connect(Config.SSID, Config.PSK)
119119
structured_log("Wi-Fi connected: " + str(wifi.radio.ipv4_address))
120-
except (ConnectionError, wifi.RadioError) as e:
120+
except ConnectionError as e:
121121
structured_log("Wi-Fi connection failed: " + str(e))
122122

123123
async def wifi_connect_task():
@@ -130,7 +130,7 @@ async def wifi_connect_task():
130130
try:
131131
wifi.radio.connect(Config.SSID, Config.PSK)
132132
structured_log("Wi-Fi reconnected: " + str(wifi.radio.ipv4_address))
133-
except (ConnectionError, wifi.RadioError) as e:
133+
except ConnectionError as e:
134134
structured_log("Wi-Fi reconnection failed: " + str(e))
135135
monitor_memory("During Wi-Fi reconnect")
136136
await asyncio.sleep(10) # Wait 10 seconds before trying again

0 commit comments

Comments
 (0)