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

Bugfix for crash when scanning while attempting to join #137

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

someone42
Copy link

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

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