From 780588dce3d975e4a693cf4c596bd3cbf5a69aaa Mon Sep 17 00:00:00 2001 From: rtrbt <9214823+rtrbt@users.noreply.github.com> Date: Fri, 16 Jul 2021 22:43:25 +0200 Subject: [PATCH] Remove undocumented and uncontrollable WiFI RSSI filter. (#5393) Commit d15e1b0e [1] in the 2.0.0 pull request #4996 introduced a filter to connect only to WiFi networks with a RSSI of -75 or better. This results in strage behaviour, as a scan still shows networks, that can't be connected to, even though with older versions, connecting to those networks was possible and the connection (albeit slow) was stable. Remove the RSSI filter for now by setting the threshold to -127, i.e. the lowest possible value. Maybe in the future the filter threshold could be exposed to users, to allow filtering out nearly unreachable networks. [1] github.com/espressif/arduino-esp32/pull/4996/commits/d15e1b0 --- libraries/WiFi/src/WiFiSTA.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp index 7a51b3a3..6bc0aa4e 100644 --- a/libraries/WiFi/src/WiFiSTA.cpp +++ b/libraries/WiFi/src/WiFiSTA.cpp @@ -73,7 +73,7 @@ static void wifi_sta_config(wifi_config_t * wifi_config, const char * ssid=NULL, wifi_config->sta.listen_interval = listen_interval; wifi_config->sta.scan_method = scan_method;//WIFI_ALL_CHANNEL_SCAN or WIFI_FAST_SCAN wifi_config->sta.sort_method = sort_method;//WIFI_CONNECT_AP_BY_SIGNAL or WIFI_CONNECT_AP_BY_SECURITY - wifi_config->sta.threshold.rssi = -75; + wifi_config->sta.threshold.rssi = -127; wifi_config->sta.pmf_cfg.capable = true; wifi_config->sta.pmf_cfg.required = pmf_required; wifi_config->sta.bssid_set = 0;