Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick SSID with strongest RSSI in mesh networks with multiple identical SSIDs #2536

Merged
merged 2 commits into from Jan 18, 2024

Conversation

mha1
Copy link
Contributor

@mha1 mha1 commented Jan 18, 2024

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 for WiFi.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/1197516934028218408

The fix is to change the default behavior for scanning network devices from the default WIFI_FAST_SCAN to WIFI_ALL_CHANNEL_SCAN which will take in account all devices on the network. In combination with sort method WIFI_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

@mha1 mha1 changed the title Pick SSID with strongest RSSI in mesh networks with mutliple identical SSIDs Pick SSID with strongest RSSI in mesh networks with multiple identical SSIDs Jan 18, 2024
Copy link
Collaborator

@pkendall64 pkendall64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one

@pkendall64 pkendall64 added V3.4 🍟 house keeping 🧹 Cleanup of code and house keeping labels Jan 18, 2024
@pkendall64 pkendall64 merged commit a4f1657 into ExpressLRS:master Jan 18, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
house keeping 🧹 Cleanup of code and house keeping V3.4 🍟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants