Browse Source

Fix crash when WiFi connection fails.

Marcos Kirsch 7 years ago
parent
commit
45edb29368
1 changed files with 1 additions and 1 deletions
  1. 1 1
      init.lua

+ 1 - 1
init.lua

@@ -98,10 +98,10 @@ if (wifi.getmode() == wifi.STATION) or (wifi.getmode() == wifi.STATIONAP) then
          print('Connecting to WiFi Access Point ...')
          joinCounter = joinCounter + 1
       else
-         print("IP = " .. ip)
          if joinCounter == joinMaxAttempts then
             print('Failed to connect to WiFi Access Point.')
          else
+            print("IP = " .. ip)
             if (not not wifi.sta.getip()) or (not not wifi.ap.getip()) then
                -- 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.