From 27e25f557ee18ffaf06acb8376746aa30a70c3f9 Mon Sep 17 00:00:00 2001 From: technyon Date: Thu, 30 Jun 2022 20:54:25 +0200 Subject: [PATCH] reduce config portal timeout if restart on disconnect is set --- networkDevices/WifiDevice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/networkDevices/WifiDevice.cpp b/networkDevices/WifiDevice.cpp index 7d292c7..2ceff42 100644 --- a/networkDevices/WifiDevice.cpp +++ b/networkDevices/WifiDevice.cpp @@ -44,6 +44,8 @@ void WifiDevice::initialize() std::vector wm_menu; wm_menu.push_back("wifi"); wm_menu.push_back("exit"); + // reduced tieout if ESP is set to restart on disconnect + _wm.setConfigPortalTimeout(_restartOnDisconnect ? 60 * 3 : 60 * 30); _wm.setShowInfoUpdate(false); _wm.setMenu(wm_menu); _wm.setHostname(_hostname); @@ -63,7 +65,7 @@ void WifiDevice::initialize() if(!res) { Serial.println(F("Failed to connect. Wait for ESP restart.")); - delay(10000); + delay(1000); ESP.restart(); } else {