Skip to content

Commit

Permalink
retry if WiFi connect fails due to invalid password
Browse files Browse the repository at this point in the history
  • Loading branch information
heythisisnate committed Nov 22, 2021
1 parent 5794c9f commit 4808c6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion scripts/build-firmware
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
set -e

FW_TAG="3.0.0-release_20210201"
VERSION="3-0-0"
VERSION="$1"
FIRMWARE_OVERLAY_PATH="firmware/nodemcu-firmware-overlay"

LFS_BASE="${PWD}/src/lfs"
Expand Down
9 changes: 1 addition & 8 deletions src/lfs/wifi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ failsafeTimer:register(300000, tmr.ALARM_SINGLE, function() node.restart() end)

wifi.eventmon.register(wifi.eventmon.STA_DISCONNECTED, function(T)
print("Heap: ", node.heap(), "Cannot connect to WiFi ", T.SSID, 'Reason Code:', T.reason)

if T.reason == wifi.eventmon.reason.AUTH_EXPIRE then
-- wifi password is incorrect, immediatly enter setup mode
print("Heap: ", node.heap(), "Wifi password is incorrect")
startWifiSetup()
else
wifiFailTimer:start()
end
wifiFailTimer:start()
end)

if wifi.sta.getconfig() == "" then
Expand Down

0 comments on commit 4808c6c

Please sign in to comment.