8000
Skip to content

Bugfix for crash when scanning while attempting to join#137

Open
someone42 wants to merge 9 commits intotonyp7:masterfrom
someone42:master
Open

Bugfix for crash when scanning while attempting to join#137
someone42 wants to merge 9 commits intotonyp7:masterfrom
someone42:master

Conversation

@someone42
Copy link
Copy Markdown

The main commit here (1af351e) is to deal with an issue where if esp32-wifi-manager is attempting to join an AP using stored AP details and can't join, when it attempts to scan for new APs there will be a crash. For example:

  • User successfully connects ESP32 to their home router AP
  • User's home router AP spontaneously combusts
  • esp32-wifi-manager can't connect to user's home router AP, after CONFIG_WIFI_MANAGER_MAX_RETRY_START_AP tries it brings up its own AP
  • User purchases new router
  • User connects to esp32-wifi-manager to switch it over to the new router

esp32-wifi-manager will then crash. This is because join attempts to the old router are still happening in the background, but the user connecting to esp32-wifi-manager's AP will trigger scan requests. As per esp-idf documentation (https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/wifi.html#scan-when-wi-fi-is-connecting), esp_wifi_scan_start() will fail immediately if a join attempt is in progress. The use of the ESP_ERROR_CHECK macro then causes a crash.

The commit introduces a software timer which will retry the scan later if it fails.

The other commit (9ddab86) is just something to deal with compilation errors I was getting when trying to include wifi_manger.h in my own application.

@dzanis
Copy link
Copy Markdown
dzanis commented Aug 21, 2021

someone42 thank you friend. This helped fix the incorrect password error. :)
ESP32C3 Error if password incorrect

…tton to show password when joining a network, The wifi manager can be reliably stopped and restarted without a system reset, Changes to make DNS server replies more palatable for windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0