diff --git a/src/HomeSpan.cpp b/src/HomeSpan.cpp index 07dd911..fbf045d 100644 --- a/src/HomeSpan.cpp +++ b/src/HomeSpan.cpp @@ -408,7 +408,7 @@ void Span::checkConnect(){ LOG0("\n*** Can't connect to %s. You may type 'W ' to re-configure WiFi, or 'X ' to erase WiFi credentials. Will try connecting again in 60 seconds.\n\n",network.wifiData.ssid); waitTime=60000; } else { - addWebLog(true,"Trying to connect to %s. Waiting %d sec...",network.wifiData.ssid,waitTime/1000); + if (verboseWiFiReconnect) addWebLog(true,"Trying to connect to %s. Waiting %d sec...",network.wifiData.ssid,waitTime/1000); WiFi.begin(network.wifiData.ssid,network.wifiData.pwd); } diff --git a/src/HomeSpan.h b/src/HomeSpan.h index 5a22b59..6bfc1ba 100644 --- a/src/HomeSpan.h +++ b/src/HomeSpan.h @@ -243,6 +243,7 @@ class Span{ Network network; // configures WiFi and Setup Code via either serial monitor or temporary Access Point SpanWebLog webLog; // optional web status/log TaskHandle_t pollTaskHandle = NULL; // optional task handle to use for poll() function + boolean verboseWiFiReconnect = true; // Set to false to not print WiFi reconnect attempts messages SpanOTA spanOTA; // manages OTA process SpanConfig hapConfig; // track configuration changes to the HAP Accessory database; used to increment the configuration number (c#) when changes found @@ -345,6 +346,8 @@ class Span{ void setWebLogCSS(const char *css){webLog.css="\n" + String(css) + "\n";} + void setVerboseWiFiReconnect(bool verbose) { verboseWiFiReconnect = verbose;} + void autoPoll(uint32_t stackSize=8192, uint32_t priority=1, uint32_t cpu=0){ // start pollTask() xTaskCreateUniversal([](void *parms){for(;;)homeSpan.pollTask();}, "pollTask", stackSize, NULL, priority, &pollTaskHandle, cpu); LOG0("\n*** AutoPolling Task started with priority=%d\n\n",uxTaskPriorityGet(pollTaskHandle));