esp-idf icon indicating copy to clipboard operation
esp-idf copied to clipboard

WiFi AP scan fails & disconnects on latest 5.1 release (after recent WiFi tweaks) (IDFGH-12734)

Open JonathanDotCel opened this issue 3 months ago • 9 comments

Answers checklist.

  • [X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • [X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • [X] I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.1.3-416-gd23b7a0361

Espressif SoC revision.

ESP32 S3

Operating System used.

Windows

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

PowerShell

Development Kit.

ESP32S3

Power Supply used.

External 3.3V

What is the expected behavior?

Around March 11 2024 a user could connect the ESP with their phone in AP mode and retrieve a list of APs to choose and connect to:

  • start the wifi in ap mode
  • serve a page to the user's phone via http server
  • the page has a button to trigger an AP scan via http request
  • trigger an ap scan via http server
  • do an ap scan
  • return the original request with a list of APs to the user's phone

IDF Commit: d22c95a - Merge branch 'refactor/protocomm_public_hdr_v5.1' into 'release/v5.1' LIB commit: 0a25c10 - fix(wifi): fix pmk invalid lead same ssid wpa and wpa2 connect fail issue(0016c4d3)

What is the actual behavior?

Using the following code: esp_wifi_scan_start(NULL, true); esp_wifi_scan_get_ap_records(&number, apRecords); esp_wifi_scan_get_ap_num(apCount);

  • each function returns ESP_OK
  • we get event #1 via the wifi event handler (expected0
  • no errors
  • no APs are found
  • the pending http request (to scan) times out total silent failure

IDF Commit: 2541101 - fix(wifi): fix some esp32c6 wifi bugs (65149d2e) ~ LIB Commit: c50813b - feat(esp_wifi): Refactor and improve FTM code (c5dfcde7)

Steps to reproduce.

  • boot device
  • set up wifi AP mode as per the example
  • serve a page to the user's phone via http server
  • the page has a button to trigger an AP scan via http request
  • let it finish
  • nothing is returned
  • the scan request times out

Debug Logs.

Silent fail.
- no logs
- no stack trace
- no reboot
- no memory issues

More Information.

Due to the the wifi using a precompiled library in the LIB submodule, I can't do a git bisect to find the exact code change. Also, due to API changes, I can't revert the LIB alone to test. Setting the home channel dwell value makes no difference. Changing the min/max channel scan time values makes no difference. Rolling back to the mentioned commit + submodule commits fixes the issue immediately.

JonathanDotCel avatar Apr 29 '24 19:04 JonathanDotCel