From 6e057dfbb2940628914d1f689c20a7fd6a44d2ed Mon Sep 17 00:00:00 2001 From: Shawn A <807787+tablatronix@users.noreply.github.com> Date: Sun, 23 Jan 2022 20:48:37 -0600 Subject: [PATCH] add connect timer log --- WiFiManager.cpp | 3 ++- WiFiManager.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index b8f6e92..e5c4463 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -272,7 +272,7 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) { DEBUG_WM(F("AutoConnect")); #endif if(getWiFiIsSaved()){ - + _startconn = millis(); _begin(); // attempt to connect using saved settings, on fail fallback to AP config portal @@ -320,6 +320,7 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) { //connected #ifdef WM_DEBUG_LEVEL DEBUG_WM(F("AutoConnect: SUCCESS")); + DEBUG_WM(DEBUG_VERBOSE,F("Connected in"),(String)((millis()-_startconn)) + " ms"); DEBUG_WM(F("STA IP Address:"),WiFi.localIP()); #endif _lastconxresult = WL_CONNECTED; diff --git a/WiFiManager.h b/WiFiManager.h index 58aa5bf..fb0bf56 100644 --- a/WiFiManager.h +++ b/WiFiManager.h @@ -459,6 +459,9 @@ class WiFiManager uint16_t _httpPort = 80; // port for webserver // uint8_t _retryCount = 0; // counter for retries, probably not needed if synchronous uint8_t _connectRetries = 1; // number of sta connect retries, force reconnect, wait loop (connectimeout) does not always work and first disconnect bails + unsigned long _startconn = 0; // ms for timing wifi connects + bool _aggresiveReconn = false; // use an agrressive reconnect strategy, WILL delay conxs + // on some conn failure modes will add delays and many retries to work around esp and ap bugs, ie, anti de-auth protections #ifdef ESP32 wifi_event_id_t wm_event_id; @@ -494,8 +497,6 @@ class WiFiManager String _bodyClass = ""; // class to add to body String _title = FPSTR(S_brand); // app title - default WiFiManager - boolean _aggresiveReconn = false; // use an agrressive reconnect strategy, on some conn failure modes will add delays and many retries to work around esp and ap bugs, ie, anti de-auth protections - // internal options // wifiscan notes