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

wifi_prov_mgr_start_provisioning crashes when service_key is set (IDFGH-6404) #8063

Closed
Lisa999 opened this issue Dec 11, 2021 · 3 comments
Closed
Labels
Awaiting Response awaiting a response from the author Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@Lisa999
Copy link

Lisa999 commented Dec 11, 2021

Environment

  • Development Kit: [ESP32-Wrover-Kit]
  • IDF version: v4.3.1

Problem Description

Example: https://github.com/espressif/esp-idf/tree/5c33570/examples/provisioning/wifi_prov_mgr

Is not working when service_key is set

Expected Behavior

Different payload output

Actual Behavior

Crash

Steps to reproduce

  1. Use SoftAP scheme (.scheme = wifi_prov_scheme_softap)
  2. Change service_key
  3. Call wifi_prov_mgr_start_provisioning

Code to reproduce this issue

Change
"const char *service_key = NULL; "
To
"const char *service_key = "1234"; "

@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 11, 2021
@github-actions github-actions bot changed the title wifi_prov_mgr_start_provisioning crashes when service_key is set wifi_prov_mgr_start_provisioning crashes when service_key is set (IDFGH-6404) Dec 11, 2021
@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Dec 13, 2021
@laukik-hase
Copy link
Collaborator

laukik-hase commented Dec 13, 2021

Hello, @Lisa999

Thanks for the issue report. I was able to reproduce this on the tag v4.3.1.

In the wifi_prov_mgr example, service_key is the password for the ESP32 SoftAP, which should be at least 8 characters. In your case, the service key is 1234 (only 4 characters) which results in a crash.

Could you please attach the logs of the crash from your side or acknowledge if they are the same as mine. Following are the crash logs from my testing; the error code 12299 corresponds to ESP_ERR_WIFI_PASSWORD signifying an invalid password.

I (704) app: Starting provisioning
I (704) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (804) wifi:mode : sta (8c:aa:b5:b5:a9:f4)
I (804) wifi:enable tsf
I (814) wifi:mode : sta (8c:aa:b5:b5:a9:f4) + softAP (8c:aa:b5:b5:a9:f5)
I (814) wifi:Total power save buffer number: 16
I (814) wifi:Init max length of beacon: 752/752
I (824) wifi:Init max length of beacon: 752/752
W (824) wifi:password less than 8

E (824) wifi_prov_scheme_softap: Failed to set Wi-Fi config : 12299
E (834) wifi_prov_scheme_softap: Failed to start Wi-Fi AP
E (944) wifi_prov_mgr: Failed to start service
ESP_ERROR_CHECK failed: esp_err_t 0x300b (ESP_ERR_WIFI_PASSWORD) at 0x40087c70
0x40087c70: _esp_error_check_failed at /home/laukik/esp/esp-idf/components/esp_common/src/esp_err.c:41

file: "../main/app_main.c" line 294
func: app_main
expression: wifi_prov_mgr_start_provisioning(security, pop, service_name, service_key)

abort() was called at PC 0x40087c73 on core 0
0x40087c73: _esp_error_check_failed at /home/laukik/esp/esp-idf/components/esp_common/src/esp_err.c:42


Backtrace:0x40088bd7:0x3ffb2470 0x400893d5:0x3ffb2490 0x4008ffbe:0x3ffb24b0 0x40087c73:0x3ffb2520 0x400d7dd1:0x3ffb2540 0x40157819:0x3ffb2690 0x4008c8a9:0x3ffb26b0
0x40088bd7: panic_abort at /home/laukik/esp/esp-idf/components/esp_system/panic.c:368

0x400893d5: esp_system_abort at /home/laukik/esp/esp-idf/components/esp_system/system_api.c:112

0x4008ffbe: abort at /home/laukik/esp/esp-idf/components/newlib/abort.c:46

0x40087c73: _esp_error_check_failed at /home/laukik/esp/esp-idf/components/esp_common/src/esp_err.c:42

0x400d7dd1: app_main at /home/laukik/esp/esp-idf/examples/provisioning/wifi_prov_mgr/build/../main/app_main.c:294 (discriminator 1)

0x40157819: main_task at /home/laukik/esp/esp-idf/components/freertos/port/port_common.c:133 (discriminator 2)

0x4008c8a9: vPortTaskWrapper at /home/laukik/esp/esp-idf/components/freertos/port/xtensa/port.c:168



ELF file SHA256: 4c1fa400e0cc24bd

@Lisa999
Copy link
Author

Lisa999 commented Dec 13, 2021

Hi @laukik-hase,

I wasn't aware that the password is bound to limits, that's not explained anywhere. I'll try if 8 characters is working for me and put the crash log here.
Thanks for the help!

@Alvin1Zhang Alvin1Zhang added the Awaiting Response awaiting a response from the author label Dec 14, 2021
@Lisa999
Copy link
Author

Lisa999 commented Dec 23, 2021

I've tested it. The 8 characters is working just fine. So it's just not working when < 8 characters. There should be a check on that.

@espressif-bot espressif-bot added Resolution: Done Issue is done internally Status: Done Issue is done internally and removed Status: In Progress Work is in progress labels Dec 31, 2021
dskulina pushed a commit to playable-tech/esp-idf that referenced this issue Feb 4, 2022
dskulina pushed a commit to playable-tech/esp-idf that referenced this issue Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Response awaiting a response from the author Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants