fix mqtt reconnect delay

This commit is contained in:
technyon
2022-03-27 00:16:49 +01:00
parent ab0fc991ad
commit 38b5af5421

View File

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