trigger wifi reconnect by mqtt or ntp failures.

This commit is contained in:
Thomas Göttgens
2022-11-18 18:03:30 +01:00
parent 9665c08b59
commit 144afee29e
3 changed files with 19 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
#include "MQTT.h"
#include "mesh/http/WiFiAPClient.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
@@ -164,6 +165,10 @@ void MQTT::reconnect()
sendSubscriptions();
} else
DEBUG_MSG("Failed to contact MQTT server...\n");
#if HAS_WIFI
WiFi.disconnect(false, true);
triggerReconnect();
#endif
}
}