Conversation
According the comment for wifi_auth_mode_t in wifi_scan_threshold_t, if this is unset, and password len >=8, the authmode threshold will default to WIFI_AUTH_WPA2_PSK. As we enforce a minimum of 8 characters in Willow Web Flasher and Willow Application Server, the esp_wifi driver should implicitly already set the authmode threshold to WIFI_AUTH_WPA2_PSK. Let's do this explicitly, so it is clear from looking at the Willow network code, and it will not change if Espressif decides to change the default.
The esp_wifi driver uses WIFI_FAST_SCAN by default, which means it will stop scanning after it finds a matching AP. This is the main reason Willow sometimes connect to an AP with a terrible signal strength. Change the scan method to WIFI_ALL_CHANNEL_SCAN so that all channels will be scanned. This seems to increase the connect time with 2 seconds, but this is an acceptable trade-off to provide a better user experience. Willow becomes unusable if the signal strength is too low. Reported-by: Ciaran Jessup <ciaranj@gmail.com>
A comment in the esp_wifi driver code suggests that using this sort_method could result in connecting to an AP without encryption, if its signal strength is higher, but now that we set the authmode threshold to WIFI_AUTH_WPA2_PSK explicitly, we don't need to worry about that. Let's use WIFI_CONNECT_AP_BY_SIGNAL so that hopefully Willow always ends up on the AP with the best signal strength. 802.11v is still useful, as e.g. when upgrading APs, depending on the order, Willow might roam to an AP with bad signal strength, and when the better AP comes back online, it might not roam back. 802.11v allows the AP or controller to tell Willow to transition to the better AP.
Even after changing scan_method and sort_order, a user reported Willow would still not connect to the AP with the best signal strength. This turns out to be due to failure on the initial connection attempt(s). Let's set the failure_retry_cnt to 3, which for the user resulted in Willow always ending up on the AP with the best signal strength. The retries are sub-ms, so this shouldn't noticably increase the connect time. Reported-by: Ciaran Jessup <ciaranj@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.