File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
arduino/libraries/WiFi/src Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ uint8_t WiFiClass::begin(const char* ssid, const char* key)
172
172
memset (&wifiConfig, 0x00 , sizeof (wifiConfig));
173
173
strncpy ((char *)wifiConfig.sta .ssid , ssid, sizeof (wifiConfig.sta .ssid ));
174
174
strncpy ((char *)wifiConfig.sta .password , key, sizeof (wifiConfig.sta .password ));
175
- wifiConfig.sta .scan_method = WIFI_ALL_CHANNEL_SCAN ;
175
+ wifiConfig.sta .scan_method = WIFI_FAST_SCAN ;
176
176
_status = WL_NO_SSID_AVAIL;
177
177
178
178
_interface = ESP_IF_WIFI_STA;
@@ -644,8 +644,11 @@ void WiFiClass::handleSystemEvent(system_event_t* event)
644
644
645
645
memset (&_apRecord, 0x00 , sizeof (_apRecord));
646
646
647
- if (reason == 201 /* NO_AP_FOUND*/ || reason == 202 /* AUTH_FAIL*/ || reason == 203 /* ASSOC_FAIL */ ) {
647
+ if (reason == 201 /* NO_AP_FOUND*/ || reason == 202 /* AUTH_FAIL*/ ) {
648
648
_status = WL_CONNECT_FAILED;
649
+ } else if (reason == 203 /* ASSOC_FAIL*/ ) {
650
+ // try to reconnect
651
+ esp_wifi_connect ();
649
652
} else {
650
653
_status = WL_DISCONNECTED;
651
654
}
You can’t perform that action at this time.
0 commit comments