From 13fb3f715ab2dbd2572a475c591d32a445c78c70 Mon Sep 17 00:00:00 2001 From: Ray Jones Date: Mon, 2 Sep 2019 08:22:33 +1000 Subject: [PATCH] Un commented the code that restores an STA connection --- src/Afterburner.cpp | 2 +- src/WiFi/BTCWifi.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Afterburner.cpp b/src/Afterburner.cpp index 2b25fb5..6c07788 100644 --- a/src/Afterburner.cpp +++ b/src/Afterburner.cpp @@ -404,7 +404,7 @@ void setup() { #if USE_WIFI == 1 - sCredentials creds = NVstore.getCredentials(); + sCredentials creds = NVstore.getCredentials(); // local AP credentials if(NVstore.getUserSettings().enableWifi) { initWifi(WiFi_TriggerPin, creds.SSID, creds.APpassword); diff --git a/src/WiFi/BTCWifi.cpp b/src/WiFi/BTCWifi.cpp index 3e19da1..1d404eb 100644 --- a/src/WiFi/BTCWifi.cpp +++ b/src/WiFi/BTCWifi.cpp @@ -146,7 +146,9 @@ void doWiFiManager() { wm.process(); -/* if(WiFi.status() != WL_CONNECTED) { + if(WiFi.status() != WL_CONNECTED) { + if(isSTA) DebugPort.println("STA lost"); + isSTA = false; if(WifiReconnectHoldoff) { long tDelta = millis() - WifiReconnectHoldoff; if(tDelta >= 0) { @@ -163,8 +165,10 @@ void doWiFiManager() } } else { + if(!isSTA) DebugPort.println("STA established"); + isSTA = true; WifiReconnectHoldoff = 0; - }*/ + } #if USE_PORTAL_TRIGGER_PIN == 1 // manage handling of pin to enter WiFManager config portal