Correct check wifi.sta.getip() so that Wi-Fi station connection works.
This commit is contained in:
parent
e25b9c5ac0
commit
90d533b555
2
init.lua
2
init.lua
@ -57,7 +57,7 @@ local joinCounter = 0
|
|||||||
local joinMaxAttempts = 5
|
local joinMaxAttempts = 5
|
||||||
tmr.alarm(0, 3000, 1, function()
|
tmr.alarm(0, 3000, 1, function()
|
||||||
local ip = wifi.sta.getip()
|
local ip = wifi.sta.getip()
|
||||||
if ip and joinCounter < joinMaxAttempts then
|
if ip == nil and joinCounter < joinMaxAttempts then
|
||||||
print('Connecting to WiFi Access Point ...')
|
print('Connecting to WiFi Access Point ...')
|
||||||
joinCounter = joinCounter +1
|
joinCounter = joinCounter +1
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user