Skip to content

Commit

Permalink
Improve Wifi automatic reconnect for ESP32 (#504)
Browse files Browse the repository at this point in the history
* do not launch a ble scan if mqtt client is disconnected

* add wifi.begin when disconnected

espressif/arduino-esp32#2501
  • Loading branch information
1technophile committed Dec 7, 2019
1 parent 4b1f09b commit 7384455
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,11 @@ void reconnect() {
}
trc(F("failed, rc="));
trc(client.state());
delay(10000);
delay(5000);
// On ESP32 force wifi begin https://github.com/espressif/arduino-esp32/issues/2501
#if defined(ESP32)
WiFi.begin();
#endif
}
}
}
Expand Down

0 comments on commit 7384455

Please sign in to comment.