From 4808c6c8cb889a867c71b366ab0102775f394fe8 Mon Sep 17 00:00:00 2001 From: Nate Clark Date: Mon, 22 Nov 2021 13:12:14 -0500 Subject: [PATCH] retry if WiFi connect fails due to invalid password --- scripts/build-firmware | 2 +- src/lfs/wifi.lua | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/build-firmware b/scripts/build-firmware index ac79abc..b39e363 100755 --- a/scripts/build-firmware +++ b/scripts/build-firmware @@ -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" diff --git a/src/lfs/wifi.lua b/src/lfs/wifi.lua index ae3374d..e441b98 100644 --- a/src/lfs/wifi.lua +++ b/src/lfs/wifi.lua @@ -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