Explorar o código

Correct check wifi.sta.getip() so that Wi-Fi station connection works.

Andy Gelme %!s(int64=9) %!d(string=hai) anos
pai
achega
90d533b555
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      init.lua

+ 1 - 1
init.lua

@@ -57,7 +57,7 @@ local joinCounter = 0
 local joinMaxAttempts = 5
 tmr.alarm(0, 3000, 1, function()
    local ip = wifi.sta.getip()
-   if ip and joinCounter < joinMaxAttempts then
+   if ip == nil and joinCounter < joinMaxAttempts then
       print('Connecting to WiFi Access Point ...')
       joinCounter = joinCounter +1
    else