Pick SSID with strongest RSSI in mesh networks with multiple identical SSIDs #2536
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Home networks in mesh configuration can have multiple identical SSIDs (with different BSSIDs). Connecting an ELRS device to a home network should pick the BSSID with the strongest RSSI for the SSID to be connected.
The underlying Arduino library defaults to the scan method
WIFI_FAST_SCAN
which picks the first matching SSID forWiFi.begin(ssid,...)
. This can lead to WiFi.begin() randomly picking a device (e.g. router) which is further away than a close by other device (e.g. repeater) resulting in an unstable connection with connection losses. See also https://discord.com/channels/596350022191415318/1033101924494487582/threads/1197516934028218408The fix is to change the default behavior for scanning network devices from the default
WIFI_FAST_SCAN
toWIFI_ALL_CHANNEL_SCAN
which will take in account all devices on the network. In combination with sort methodWIFI_CONNECT_AP_BY_SIGNAL
(which is already default) the strongest BSSID for the given SSID will be connected.https://github.com/espressif/arduino-esp32/blob/099b432d10fb4ca1529c52241bcadcb8a4386f17/libraries/WiFi/src/WiFiSTA.h#L74-L77