Fix Ethernet MQTT reconnect handling (#10896)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Alexander Balya
2026-07-06 10:21:24 -05:00
committed by GitHub
co-authored by GitHub Ben Meadors
parent 93250d8704
commit 1e66ecff60
3 changed files with 20 additions and 1 deletions
+9 -1
View File
@@ -470,8 +470,16 @@ void MQTT::reconnect()
reconnectCount++;
LOG_ERROR("Failed to contact MQTT server directly (%d/%d)", reconnectCount, reconnectMax);
if (reconnectCount >= reconnectMax) {
#if defined(USE_WS5500) || defined(USE_CH390D)
LOG_WARN("MQTT connect failed repeatedly; waiting for Ethernet reconnect");
#else
needReconnect = true;
wifiReconnect->setIntervalFromNow(0);
if (wifiReconnect) {
wifiReconnect->setIntervalFromNow(0);
} else {
LOG_WARN("MQTT connect failed repeatedly, but WiFi reconnect is unavailable");
}
#endif
reconnectCount = 0;
}
#endif