Skip to content

Commit

Permalink
Fix: prevent resetting WiFi if we dont handle it (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Lapointe committed Nov 25, 2021
1 parent c06930f commit 9af02b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/EspMQTTClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ bool EspMQTTClient::handleMQTT()
Serial.printf("MQTT!: Failed MQTT connection count: %i \n", _failedMQTTConnectionAttemptCount);

// When there is too many failed attempt, sometimes it help to reset the WiFi connection or to restart the board.
if(_failedMQTTConnectionAttemptCount == 8)
if(_handleWiFi && _failedMQTTConnectionAttemptCount == 8)
{
if (_enableSerialLogs)
Serial.println("MQTT!: Can't connect to broker after too many attempt, resetting WiFi ...");
Expand Down

0 comments on commit 9af02b9

Please sign in to comment.