add wifi reconnection logic

This commit is contained in:
Hunter 2024-10-08 10:01:07 -04:00
parent 208b6b51d9
commit 0358a39a59
1 changed files with 1 additions and 0 deletions

View File

@ -101,6 +101,7 @@ void setup() {
void reconnect() {
while (!mqttClient.connected()) {
if (WiFi.status() != WL_CONNECTED) WiFi.reconnect();
Serial.println("Attempting MQTT connection...");
if (mqttClient.connect("ESP32Client")) {
Serial.println("connected");