From a4f16575cf8699c7dfe503b9b72d4d8ca7bd0681 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 18 Jan 2024 22:51:58 +0100 Subject: [PATCH] Pick SSID with strongest RSSI in mesh networks with multiple identical SSIDs (#2536) * scan all channels prior to connecting to SSID * esp32 only --- src/lib/WIFI/devWIFI.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/WIFI/devWIFI.cpp b/src/lib/WIFI/devWIFI.cpp index 86cab04202..f0025458a7 100644 --- a/src/lib/WIFI/devWIFI.cpp +++ b/src/lib/WIFI/devWIFI.cpp @@ -1096,6 +1096,10 @@ static void HandleWebUpdate() WiFi.setHostname(wifi_hostname); // hostname must be set after the mode is set to STA #endif changeTime = now; + #if defined(PLATFORM_ESP32) + WiFi.setSortMethod(WIFI_CONNECT_AP_BY_SIGNAL); + WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN); + #endif WiFi.begin(station_ssid, station_password); startServices(); default: