From 1194bd27f643f4d869d8f3bb4ab1121f87fb2ee7 Mon Sep 17 00:00:00 2001 From: Gregg Date: Sat, 4 Nov 2023 12:52:03 -0500 Subject: [PATCH] Update src.ino --- src/src.ino | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/src.ino b/src/src.ino index 9e998b3..a559363 100644 --- a/src/src.ino +++ b/src/src.ino @@ -74,7 +74,7 @@ void setup() { // homeSpan.enableOTA(); homeSpan.setWifiCallback(wifiCB); - homeSpan.setWifiCallbackAll(wifiCB_ALL).setVerboseWifiReconnect(true).setRebootCallback(rebootCB,10000); + homeSpan.setWifiCallbackAll(wifiCB_ALL).setVerboseWifiReconnect(true).setRebootCallback(rebootCB); new SpanUserCommand('D', " - disconnect WiFi", [](const char *buf){WiFi.disconnect();}); @@ -117,5 +117,8 @@ void wifiCB_ALL(int n){ ////////////////////////////////////// void rebootCB(uint8_t count){ - Serial.printf("\n\n******* IN REBOOT CALLBACK: %d\n\n",count); + if(count>=3){ + Serial.printf("\n*** Detected 3 or more short reboots. Erasing WiFi data...\n"); + homeSpan.processSerialCommand("X"); + } }