mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 02:02:23 +00:00
hook up additional rsyslog output if debug printing is active
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
#include "mqtt/JSON.h"
|
||||
#include <assert.h>
|
||||
|
||||
const int reconnectMax = 5;
|
||||
|
||||
MQTT *mqtt;
|
||||
|
||||
String statusTopic = "msh/2/stat/";
|
||||
@@ -218,15 +220,13 @@ void MQTT::reconnect()
|
||||
sendSubscriptions();
|
||||
} else {
|
||||
#if HAS_WIFI && !defined(ARCH_PORTDUINO)
|
||||
LOG_ERROR("Failed to contact MQTT server (%d/5)...\n", reconnectCount + 1);
|
||||
if (reconnectCount >= 4) {
|
||||
reconnectCount++;
|
||||
LOG_ERROR("Failed to contact MQTT server (%d/%d)...\n", reconnectCount, reconnectMax);
|
||||
if (reconnectCount >= reconnectMax) {
|
||||
needReconnect = true;
|
||||
wifiReconnect->setIntervalFromNow(0);
|
||||
reconnectCount = 0;
|
||||
} else {
|
||||
reconnectCount++;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user