Skip to content

Commit

Permalink
update to current Arduino core
Browse files Browse the repository at this point in the history
  • Loading branch information
bertmelis committed May 27, 2024
1 parent cb97b87 commit de0868d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/espMqttManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ uint32_t getBackoffTimerVal(uint32_t currentInterval) {

void espMqttManager::setup() {
WiFi.setAutoReconnect(false);
WiFi.setAutoConnect(false);
//WiFi.setAutoConnect(false); // deprecated
WiFi.persistent(false);

if (!espMqttManagerInternals::config.getConfig()) {
Expand Down Expand Up @@ -125,9 +125,11 @@ void espMqttManager::start() {

void espMqttManager::loop() { // espMqttManager doesn't use WiFi events so we have to monitor WiFi here
if (WiFi.status() != WL_CONNECTED && espMqttManagerInternals::state != espMqttManagerState::CONNECTWIFI && espMqttManagerInternals::state != espMqttManagerState::WAITWIFI) {
emm_log_i("WiFi disconnected");
espMqttManagerInternals::setState(espMqttManagerState::CONNECTWIFI);
espMqttManagerInternals::wifiReconnectTimer = millis();
espMqttManagerInternals::interval = 0;
WiFi.disconnect(false);
onWiFiDisconnected();
}
switch (espMqttManagerInternals::state) {
Expand Down

0 comments on commit de0868d

Please sign in to comment.