Closed AxelLin closed 1 year ago
Summary of the test with different branch: v4.3.4-236-g310571138e OK v4.4.3-316-ge86181704a OK v5.0-159-g75c3a69feb FAIL v5.1-dev-2186-g454aeb3a48 FAIL
BTW, I notice a few WIFI_EVENT_STA_DISCONNECTED event before getting WIFI_EVENT_STA_WPS_ER_SUCCESS. Is that WIFI_EVENT_STA_DISCONNECTED events normal?
BTW, just notice that I only receive AP credential so there is no event_data in my test case.
This is intentional, we are getting the password in psk format, that will save pbkdf2 calculations. 'f2f26130fc3c9f9ccbc2e0faf1c3cc33ec5ac5c3a42e5fd3b409ed37862c5d29' is psk in this case.
@kapilkedawat
@kapilkedawat
1. This is a breaking change because now I cannot get password via esp_wifi_get_config() which was working in v4.x branches.
there is no changes in esp_wifi_get_config, its supposed to print the values configured using esp_wifi_set_config, In this case since psk is configured(by the AP, not by station), its printing psk.
2. So how to convert it back to raw passowrd?
Please note, esp devices are not converting the passpharse to psk, it is done by AP, device is just configuring the values that it got from AP. See this optimization in hostapd for details: https://w1.fi/cgit/hostap/tree/src/wps/wps_registrar.c#n2546
Incase you prefer to get passphrase, you can use this patch(there is no actual benefit of getting the passphrase instead of psk for any usecase IMO).
--- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -1400,6 +1400,7 @@ static int wifi_station_wps_init(const esp_wps_config_t *config) goto _err; }
Please note, esp devices are not converting the passpharse to psk, it is done by AP, device is just configuring the values that it got from AP. See this optimization in hostapd for details: https://w1.fi/cgit/hostap/tree/src/wps/wps_registrar.c#n2546
Incase you prefer to get passphrase, you can use this patch(there is no actual benefit of getting the passphrase instead of psk for any usecase IMO).
The user applicatin can show the password. While testing with the same AP, application built with esp-idf-v5.x shows different password than application built with v4.x. This is indeed a breaking change. (It's nothing to do with benefit or not, it's an unexpected behavior for exiting users) You need to provide an user configuration in esp-idf to allow backward compatible to avoid changing user application's behavior.
@kapilkedawat @Alvin1Zhang
As I explain above, this is a regression that needs fix. Please remove the "Status: Done" label.
@kapilkedawat
Please fix this regression, since you are aware it's a breakage. (Fixed by setting cfg.wps->config_methods = WPS_CONFIG_DISPLAY | WPS_CONFIG_PHY_DISPLAY;) You cannot break existing application's behavior.
Please note, esp devices are not converting the passpharse to psk, it is done by AP, device is just configuring the values that it got from AP. See this optimization in hostapd for details: https://w1.fi/cgit/hostap/tree/src/wps/wps_registrar.c#n2546
The problem is not about AP side.
Incase you prefer to get passphrase, you can use this patch(there is no actual benefit of getting the passphrase instead of psk for any usecase IMO).
See, your patch shows the change is in device side. The result is a surprise for users upgrading existing application from v4.x to v5.x. (especially v4.4 will reach maintenance period soon, some users will rebuild existing application with newer stable branch).
@kapilkedawat
Now the only way to avoid changing application behavor when build with esp-idf-5.0+ is to patch the esp-idf. Would you fix this regression?
@kapilkedawat
Now the only way to avoid changing application behavor when build with esp-idf-5.0+ is to patch the esp-idf. Would you fix this regression?
@kapilkedawat
I don't get your response for 2 months. So I'm wondering if it is true that espressif no longer fix regression report now? In this case, it's not about preference at all. It's esp-idf-5 changed behavior so application cannot keep the same behavior as built with esp-idf-4.x.
@igrr
Any update? Both v5.0 and v5.1 branches need fix!
Answers checklist.
IDF version.
v5.1-dev-2186-g454aeb3a48
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-WROOM-32E custom board
Power Supply used.
USB
What is the expected behavior?
Test examples/wifi/wps/main/wps.c with WPS_TYPE_PBC. The example can connect to AP via WPS.
However, when I added below code to check the received SSID and password it shows wrong password setting.
I got below message: W (32960) example_wps: WPS:: SSID=IGSAP PASSWORD=f2f26130fc3c9f9ccbc2e0faf1c3cc33ec5ac5c3a42e5fd3b409ed37862c5d29
Also note the same code works if build with v4.3 branch.
What is the actual behavior?
I would expect to see the correct password in above output.
Steps to reproduce.
Just test WPS.
Debug Logs.
More Information.
No response