Skip to content

Commit 0aa54ff

Browse files
committed
Finish implementing MQTT backoff by using the timer already started
1 parent da88ba5 commit 0aa54ff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Firmware/RTK_Everywhere/MQTT_Client.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,11 @@ void mqttClientUpdate()
524524

525525
// Start the network
526526
case MQTT_CLIENT_ON: {
527-
if (networkUserOpen(NETWORK_USER_MQTT_CLIENT, NETWORK_TYPE_ACTIVE))
528-
mqttClientSetState(MQTT_CLIENT_NETWORK_STARTED);
527+
if ((millis() - mqttClientTimer) > mqttClientConnectionAttemptTimeout)
528+
{
529+
if (networkUserOpen(NETWORK_USER_MQTT_CLIENT, NETWORK_TYPE_ACTIVE))
530+
mqttClientSetState(MQTT_CLIENT_NETWORK_STARTED);
531+
}
529532
break;
530533
}
531534

0 commit comments

Comments
 (0)