Fix crash when WiFi connection fails.
This commit is contained in:
parent
2165484413
commit
45edb29368
2
init.lua
2
init.lua
@ -98,10 +98,10 @@ if (wifi.getmode() == wifi.STATION) or (wifi.getmode() == wifi.STATIONAP) then
|
|||||||
print('Connecting to WiFi Access Point ...')
|
print('Connecting to WiFi Access Point ...')
|
||||||
joinCounter = joinCounter + 1
|
joinCounter = joinCounter + 1
|
||||||
else
|
else
|
||||||
print("IP = " .. ip)
|
|
||||||
if joinCounter == joinMaxAttempts then
|
if joinCounter == joinMaxAttempts then
|
||||||
print('Failed to connect to WiFi Access Point.')
|
print('Failed to connect to WiFi Access Point.')
|
||||||
else
|
else
|
||||||
|
print("IP = " .. ip)
|
||||||
if (not not wifi.sta.getip()) or (not not wifi.ap.getip()) then
|
if (not not wifi.sta.getip()) or (not not wifi.ap.getip()) then
|
||||||
-- Second parameter is for mDNS (aka Zeroconf aka Bonjour) registration.
|
-- Second parameter is for mDNS (aka Zeroconf aka Bonjour) registration.
|
||||||
-- If the mdns module is compiled in the firmware, advertise the server with this name.
|
-- If the mdns module is compiled in the firmware, advertise the server with this name.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user