From 45edb29368b9ad05c7e422869476f70ede0e36d9 Mon Sep 17 00:00:00 2001 From: Marcos Kirsch Date: Sun, 1 Jan 2017 22:13:51 -0600 Subject: [PATCH] Fix crash when WiFi connection fails. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index d7c5d76..17a3748 100644 --- a/init.lua +++ b/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.