Skip to content

Commit 4ec48c2

Browse files
authored
Connect with strongest AP
espressif#4947
1 parent b57052c commit 4ec48c2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: libraries/WiFi/src/WiFiSTA.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ wl_status_t WiFiSTAClass::begin(const char* ssid, const char *passphrase, int32_
133133
wifi_config_t conf;
134134
memset(&conf, 0, sizeof(wifi_config_t));
135135
strcpy(reinterpret_cast<char*>(conf.sta.ssid), ssid);
136+
conf.sta.scan_method = WIFI_ALL_CHANNEL_SCAN; //force full scan to be able to choose the nearest / strongest AP
136137

137138
if(passphrase) {
138139
if (strlen(passphrase) == 64){ // it's not a passphrase, is the PSK

0 commit comments

Comments
 (0)