Reconnect network on MQTT failure (#435)

This commit is contained in:
iranl
2024-07-31 13:15:26 +02:00
committed by GitHub
parent d132e76ae2
commit 8e513bb501
14 changed files with 56 additions and 32 deletions

View File

@@ -1124,6 +1124,9 @@ bool WiFiManager::wifiConnectNew(String ssid, String pass,bool connect){
WiFi.persistent(true);
if (_findBestRSSI) {
WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN);
WiFi.setSortMethod(WIFI_CONNECT_AP_BY_SIGNAL);
#ifdef WM_DEBUG_LEVEL
DEBUG_WM(F("find best RSSI: TRUE"));
#endif
@@ -1691,6 +1694,10 @@ bool WiFiManager::WiFi_scanNetworks(bool force,bool async){
return false;
}
void WiFiManager::resetScan(){
_numNetworks = 0;
}
String WiFiManager::WiFiManager::getScanItemOut(){
String page;
@@ -4013,7 +4020,7 @@ String WiFiManager::WiFi_psk(bool persistent) const {
#ifdef WM_DEBUG_LEVEL
DEBUG_WM(WM_DEBUG_VERBOSE,F("[Event] SYSTEM_EVENT_STA_DISCONNECTED, reconnecting"));
#endif
WiFi.reconnect();
//WiFi.reconnect();
#endif
}
else if(event == ARDUINO_EVENT_WIFI_SCAN_DONE && _asyncScan){