hook up additional rsyslog output if debug printing is active

This commit is contained in:
Thomas Göttgens
2023-02-01 15:09:07 +01:00
parent d34f6d0f68
commit 090d399843
4 changed files with 33 additions and 78 deletions

View File

@@ -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
}
}