Skip to content

Commit

Permalink
Fix core 2.0.12 exception
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed Sep 9, 2023
1 parent 4c6ff44 commit f9fd813
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,11 @@ void MqttDisconnected(int state) {
Mqtt.retry_counter_delay++;
}

MqttClient.disconnect();
// Check if this solves intermittent MQTT re-connection failures when broker is restarted
EspClient.stop();
if (MqttClient.connected()) {
MqttClient.disconnect();
// Check if this solves intermittent MQTT re-connection failures when broker is restarted
EspClient.stop();
}

AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_MQTT D_CONNECT_FAILED_TO " %s:%d, rc %d. " D_RETRY_IN " %d " D_UNIT_SECOND),
SettingsText(SET_MQTT_HOST), Settings->mqtt_port, state, Mqtt.retry_counter);
Expand Down

0 comments on commit f9fd813

Please sign in to comment.