From 38b5af54215046e53a1087624756b327ef1f7297 Mon Sep 17 00:00:00 2001 From: technyon Date: Sun, 27 Mar 2022 00:16:49 +0100 Subject: [PATCH] fix mqtt reconnect delay --- Network.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Network.cpp b/Network.cpp index aeb9328..d421323 100644 --- a/Network.cpp +++ b/Network.cpp @@ -50,7 +50,7 @@ bool Network::reconnect() while (!_mqttClient.connected()) { Serial.println("Attempting MQTT connection"); // Attempt to connect - if (_mqttClient.connect("arduinoClient")) { + if (_mqttClient.connect("nukiHub")) { Serial.println("MQTT connected"); // ... and resubscribe @@ -58,6 +58,7 @@ bool Network::reconnect() } else { Serial.print("MQTT connect failed, rc="); Serial.println(_mqttClient.state()); + vTaskDelay( 5000 / portTICK_PERIOD_MS); } } } @@ -76,7 +77,6 @@ void Network::update() bool success = reconnect(); if(!success) { - vTaskDelay( 5000 / portTICK_PERIOD_MS); return; } }