aboutsummaryrefslogtreecommitdiff
path: root/mqtt-bridge/wlan.lua
diff options
context:
space:
mode:
Diffstat (limited to 'mqtt-bridge/wlan.lua')
-rw-r--r--mqtt-bridge/wlan.lua19
1 files changed, 10 insertions, 9 deletions
diff --git a/mqtt-bridge/wlan.lua b/mqtt-bridge/wlan.lua
index 5f45c1b..2341301 100644
--- a/mqtt-bridge/wlan.lua
+++ b/mqtt-bridge/wlan.lua
@@ -4,12 +4,12 @@ local function wait_for_connection(timeout_ms)
local timeout = timeout_ms * 1000
repeat
- local ip = wifi.sta.getip()
+ local status = wifi.sta.status()
- print("ip="..tostring(ip))
+ print("status="..tostring(status))
- if ip then -- and ip ~= "0.0.0.0" then
- return ip
+ if ip == 5 then -- and ip ~= "0.0.0.0" then
+ return true
end
tmr.wdclr()
@@ -24,10 +24,11 @@ function wlan_init(ssid, password)
wifi.setmode(wifi.STATION)
wifi.sta.config(ssid, password)
- local ip = wait_for_connection(10 * 1000)
- if not ip then
- panic("Could not establish wlan connection, restarting")
- end
+-- local ok = wait_for_connection(10 * 1000)
+-- if not ok then
+-- panic("Could not establish wlan connection, restarting")
+-- end
- print("WLAN: Configured, ip="..ip)
+-- local ip = wifi.sta.getip()
+-- print("WLAN: Configured, ip="..ip)
end