diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-10-03 22:56:24 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-10-03 22:56:24 +0200 |
commit | 9778f5d43ffca26e3def45f21a163c1a83feb7be (patch) | |
tree | fa17cccdeb69a83dfbfa9327bb104f81f7ceb608 /mqtt-bridge/wlan.lua | |
parent | 967254d72ba5e116f3019937660c346d202af7f7 (diff) | |
download | esp-playground-9778f5d43ffca26e3def45f21a163c1a83feb7be.tar.gz esp-playground-9778f5d43ffca26e3def45f21a163c1a83feb7be.tar.bz2 esp-playground-9778f5d43ffca26e3def45f21a163c1a83feb7be.tar.xz esp-playground-9778f5d43ffca26e3def45f21a163c1a83feb7be.zip |
wip
Diffstat (limited to 'mqtt-bridge/wlan.lua')
-rw-r--r-- | mqtt-bridge/wlan.lua | 19 |
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 |