Behaviour when MQTT and/or Wifi is not available (#1126)

* Behaviour when MQTT and/or Wifi is not available

I was looking into why all my OpenMQTTGateway devices were not responding after a recent power failure and am speculating that the ESP32 was able to restart faster than my Wifi and MQTT Server was able to restart and resume operations.  And was thinking that a generic ESP.restart may be a reasonable approach with repeated Wifi and/or MQTT connection failures.

As mentioned here https://community.openmqttgateway.com/t/behaviour-when-mqtt-and-or-wifi-is-not-available/1747

Added new variable maxRetryWatchDog, which is the maximum number of mqtt or wifi connection attempts before restarting gateway device.
This commit is contained in:
Northern Man authored and GitHub committed 2022-01-17 16:16:43 -06:00
1 parent 149aa40802
commit 9546f43cd6
2 files changed
+37 -9

No files matched your search

+1
View File
@@ -135,6 +135,7 @@ const byte mac[] = {0xDE, 0xED, 0xBA, 0xFE, 0x54, 0x95}; //W5100 ethernet shield
//#define MDNS_SD //uncomment if you want to use mdns for discovering automatically your ip server, please note that MDNS with ESP32 can cause the BLE to not work
#define maxConnectionRetry 10 //maximum MQTT connection attempts before going to wifimanager setup if never connected once
#define maxConnectionRetryWifi 5 //maximum Wifi connection attempts with existing credential at start (used to bypass ESP32 issue on wifi connect)
#define maxRetryWatchDog 11 //maximum Wifi or mqtt re-connection attempts before restarting
//set minimum quality of signal so it ignores AP's under that quality
#define MinimumWifiSignalQuality 8