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

Wrong reason for wrong password during connection in STA (Wifi) (IDFGH-900) #3246

Closed
jmberhault opened this issue Apr 2, 2019 · 7 comments
Closed

Comments

@jmberhault
Copy link

Environment

  • Module or chip used: ESP32-WROOM-32 & ESP32-WROOM-32D
  • IDF version : v3.2-beta3-72-g70811110f
  • Build System: Make
  • Compiler version : xtensa-esp32-elf-gcc.exe (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 5.2.0
  • Operating System: Windows
  • Power Supply: USB & external 3.3V

Problem Description

Wrong reason code in SYSTEM_EVENT_STA_DISCONNECTED event when the pw is wrong.

Expected Behavior

Getting the correct reason codes in the event in case of the wrong password => I'm expecting this error : WIFI_REASON_AUTH_FAIL (202) ??

Actual Behavior

Return error code 2 (WIFI_REASON_AUTH_EXPIRE) and error code 201 (WIFI_REASON_NO_AP_FOUND)

Steps to reproduce

Try to connect with a wrong password my local hotspot (of course on).
Others functions are working well, wps with push-button is working too.

Code to reproduce this issue

To reproduce it, I've taken the example wifi/station where I have changed in the define the SSID and the password (theses two lines only). I have modified the debug mode for more logs as below.

Debug Logs

working logs - (only the password have been replaced by xxxxxxxx)

`
D (345) nvs: nvs_set sta.sort_method 1 0[1B][0m
D (345) nvs: nvs_set sta.minrssi 1 -127[1B][0m
D (355) nvs: nvs_set sta.minauth 1 0[1B][0m
D (355) nvs: nvs_set_blob sta.apsw 2[1B][0m
D (355) nvs: nvs_set_blob sta.apinfo 700[1B][0m
D (365) RTC_MODULE: Wi-Fi takes adc2 lock.[1B][0m
D (365) phy_init: loading PHY init data from application binary[1B][0m
D (375) nvs: nvs_open_from_partition phy 0[1B][0m
D (375) nvs: nvs_get cal_version 4[1B][0m
D (375) nvs: nvs_get_str_or_blob cal_mac[1B][0m
D (385) nvs: nvs_get_str_or_blob cal_data[1B][0m
D (395) nvs: nvs_close 3[1B][0m
[1B][0;32mI (445) phy: phy_version: 4008, c9ae59f, Jan 25 2019, 16:54:06, 0, 0[1B][0m
I (445) wifi: mode : sta (30:ae:a4:80:17:60)
D (445) event: SYSTEM_EVENT_STA_START[1B][0m
[1B][0;32mI (455) wifi station: wifi_init_sta finished.[1B][0m
[1B][0;32mI (455) wifi station: connect to ap SSID:Livebox-8656 password:xxxxxxxxxx[1B][0m
I (575) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (1555) wifi: state: init -> auth (b0)
I (1555) wifi: state: auth -> assoc (0)
I (1565) wifi: state: assoc -> run (10)
I (1575) wifi: connected with Livebox-8656, channel 1
D (1575) nvs: nvs_set sta.chan 1 1[1B][0m
D (1585) nvs: nvs_set_blob sta.apinfo 700[1B][0m
I (1585) wifi: pm start, type: 1

D (1585) event: SYSTEM_EVENT_STA_CONNECTED, ssid:Livebox-8656, ssid_len:12, bssid:34:8a:ae:24:86:56, channel:1, authmode:3[1B][0m
D (1595) tcpip_adapter: dhcp client init ip/mask/gw to all-0[1B][0m
D (1605) tcpip_adapter: if0 start ip lost tmr: enter[1B][0m
D (1605) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc5860 interval=120 ip=0[1B][0m
D (1615) tcpip_adapter: dhcp client start successfully[1B][0m
D (1755) phy_init: wifi mac time delta: 32571[1B][0m
D (2055) phy_init: wifi mac time delta: 215682[1B][0m
D (2365) phy_init: wifi mac time delta: 164039[1B][0m
D (2655) phy_init: wifi mac time delta: 175625[1B][0m
D (2655) tcpip_adapter: if0 dhcpc cb[1B][0m
D (2655) tcpip_adapter: if0 ip changed=1[1B][0m
D (2655) event: SYSTEM_EVENT_STA_GOT_IP, ip:192.168.1.13, mask:255.255.255.0, gw:192.168.1.1[1B][0m
[1B][0;32mI (2665) event: sta ip: 192.168.1.13, mask: 255.255.255.0, gw: 192.168.1.1[1B][0m
`

with wrong password

[1B][0;32mI (105) wifi station: ESP_WIFI_MODE_STA[1B][0m
D (105) nvs: nvs_open_from_partition misc 1[1B][0m
D (105) nvs: nvs_get_str_or_blob log[1B][0m
I (105) wifi: wifi driver task: 3ffc0abc, prio:23, stack:3584, core=0
I (115) wifi: wifi firmware version: 9415913
I (115) wifi: config NVS flash: enabled
I (115) wifi: config nano formating: disabled
[1B][0;32mI (125) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[1B][0m
[1B][0;32mI (135) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[1B][0m
D (145) nvs: nvs_open_from_partition nvs.net80211 1[1B][0m
D (145) nvs: nvs_get opmode 1[1B][0m
D (155) nvs: nvs_get_str_or_blob sta.ssid[1B][0m
D (155) nvs: nvs_get_str_or_blob sta.mac[1B][0m
D (155) nvs: nvs_get sta.authmode 1[1B][0m
D (165) nvs: nvs_get_str_or_blob sta.pswd[1B][0m
D (165) nvs: nvs_get_str_or_blob sta.pmk[1B][0m
D (175) nvs: nvs_get sta.chan 1[1B][0m
D (175) nvs: nvs_get auto.conn 1[1B][0m
D (175) nvs: nvs_get bssid.set 1[1B][0m
D (175) nvs: nvs_get_str_or_blob sta.bssid[1B][0m
D (185) nvs: nvs_get sta.lis_intval 2[1B][0m
D (185) nvs: nvs_get sta.phym 1[1B][0m
D (195) nvs: nvs_get sta.phybw 1[1B][0m
D (195) nvs: nvs_get_str_or_blob sta.apsw[1B][0m
D (195) nvs: nvs_get_str_or_blob sta.apinfo[1B][0m
D (205) nvs: nvs_get sta.scan_method 1[1B][0m
D (205) nvs: nvs_get sta.sort_method 1[1B][0m
D (205) nvs: nvs_get sta.minrssi 1[1B][0m
D (215) nvs: nvs_get sta.minauth 1[1B][0m
D (215) nvs: nvs_get_str_or_blob ap.ssid[1B][0m
D (225) nvs: nvs_get_str_or_blob ap.mac[1B][0m
D (225) nvs: nvs_get_str_or_blob ap.passwd[1B][0m
D (225) nvs: nvs_get_str_or_blob ap.pmk[1B][0m
D (235) nvs: nvs_get ap.chan 1[1B][0m
D (235) nvs: nvs_get ap.authmode 1[1B][0m
D (235) nvs: nvs_get ap.hidden 1[1B][0m
D (245) nvs: nvs_get ap.max.conn 1[1B][0m
D (245) nvs: nvs_get bcn.interval 2[1B][0m
D (245) nvs: nvs_get ap.phym 1[1B][0m
D (255) nvs: nvs_get ap.phybw 1[1B][0m
D (255) nvs: nvs_get ap.sndchan 1[1B][0m
D (255) nvs: nvs_get lorate 1[1B][0m
D (265) nvs: nvs_set_blob sta.mac 6[1B][0m
D (265) nvs: nvs_set_blob ap.mac 6[1B][0m
I (275) wifi: Init dynamic tx buffer num: 32
I (275) wifi: Init data frame dynamic rx buffer num: 32
I (275) wifi: Init management frame dynamic rx buffer num: 32
I (285) wifi: Init static rx buffer size: 1600
I (285) wifi: Init static rx buffer num: 10
I (295) wifi: Init dynamic rx buffer num: 32
D (295) nvs: nvs_set_blob sta.ssid 36[1B][0m
D (305) nvs: nvs_set_blob sta.pswd 65[1B][0m
D (305) nvs: nvs_set bssid.set 1 0[1B][0m
D (305) nvs: nvs_set sta.lis_intval 2 3[1B][0m
D (315) nvs: nvs_set sta.scan_method 1 0[1B][0m
D (315) nvs: nvs_set sta.sort_method 1 0[1B][0m
D (315) nvs: nvs_set sta.minrssi 1 -127[1B][0m
D (325) nvs: nvs_set sta.minauth 1 0[1B][0m
D (325) nvs: nvs_set_blob sta.apsw 2[1B][0m
D (335) nvs: nvs_set_blob sta.apinfo 700[1B][0m
D (335) RTC_MODULE: Wi-Fi takes adc2 lock.[1B][0m
D (335) phy_init: loading PHY init data from application binary[1B][0m
D (345) nvs: nvs_open_from_partition phy 0[1B][0m
D (345) nvs: nvs_get cal_version 4[1B][0m
D (355) nvs: nvs_get_str_or_blob cal_mac[1B][0m
D (355) nvs: nvs_get_str_or_blob cal_data[1B][0m
D (365) nvs: nvs_close 3[1B][0m
[1B][0;32mI (415) phy: phy_version: 4008, c9ae59f, Jan 25 2019, 16:54:06, 0, 0[1B][0m
I (425) wifi: mode : sta (30:ae:a4:80:17:60)
D (425) event: SYSTEM_EVENT_STA_START[1B][0m
[1B][0;32mI (425) wifi station: wifi_init_sta finished.[1B][0m
[1B][0;32mI (425) wifi station: connect to ap SSID:Livebox-8656 password:wrongPassword[1B][0m
I (545) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (1525) wifi: state: init -> auth (b0)
I (1535) wifi: state: auth -> assoc (0)
I (1535) wifi: state: assoc -> run (10)
I (5585) wifi: state: run -> init (2a0)
I (5585) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
D (5585) event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Livebox-8656, ssid_len:12, bssid:34:8a:ae:24:86:56, reason:2[1B][0m
D (5585) tcpip_adapter: if0 start ip lost tmr: enter[1B][0m
D (5595) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc58e4 interval=120 ip=0[1B][0m
[1B][0;32mI (5605) wifi station: retry to connect to the AP[1B][0m
[1B][0;32mI (5605) wifi station: connect to the AP fail
[1B][0m
D (8015) event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Livebox-8656, ssid_len:12, bssid:00:00:00:00:00:00, reason:201[1B][0m
D (8015) tcpip_adapter: if0 start ip lost tmr: enter[1B][0m
D (8015) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc58e4 interval=120 ip=0[1B][0m
[1B][0;32mI (8025) wifi station: retry to connect to the AP[1B][0m
[1B][0;32mI (8035) wifi station: connect to the AP fail
[1B][0m
I (8155) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (8155) wifi: state: init -> auth (b0)
I (8155) wifi: state: auth -> assoc (0)
I (8155) wifi: state: assoc -> run (10)
I (12195) wifi: state: run -> init (2a0)
I (12205) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
D (12205) event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Livebox-8656, ssid_len:12, bssid:34:8a:ae:24:86:56, reason:2[1B][0m
D (12205) tcpip_adapter: if0 start ip lost tmr: enter[1B][0m
D (12215) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc58e4 interval=120 ip=0[1B][0m
[1B][0;32mI (12225) wifi station: retry to connect to the AP[1B][0m
[1B][0;32mI (12225) wifi station: connect to the AP fail
[1B][0m
D (14635) event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Livebox-8656, ssid_len:12, bssid:00:00:00:00:00:00, reason:201[1B][0m
D (14635) tcpip_adapter: if0 start ip lost tmr: enter[1B][0m
D (14635) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc58e4 interval=120 ip=0[1B][0m
[1B][0;32mI (14645) wifi station: retry to connect to the AP[1B][0m
[1B][0;32mI (14655) wifi station: connect to the AP fail
[1B][0m
I (14765) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (14775) wifi: state: init -> auth (b0)
I (14775) wifi: state: auth -> assoc (0)
I (14785) wifi: state: assoc -> run (10)
I (18825) wifi: state: run -> init (2a0)
I (18825) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
D (18825) event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Livebox-8656, ssid_len:12, bssid:34:8a:ae:24:86:56, reason:2[1B][0m
D (18825) tcpip_adapter: if0 start ip lost tmr: enter[1B][0m
D (18835) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc58e4 interval=120 ip=0[1B][0m
[1B][0;32mI (18845) wifi station: retry to connect to the AP[1B][0m
[1B][0;32mI (18845) wifi station: connect to the AP fail
[1B][0m
D (21255) event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Livebox-8656, ssid_len:12, bssid:00:00:00:00:00:00, reason:201[1B][0m
D (21255) tcpip_adapter: if0 start ip lost tmr: enter[1B][0m
D (21265) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc58e4 interval=120 ip=0[1B][0m
[1B][0;32mI (21275) wifi station: connect to the AP fail

Other items if possible

My hotspot is a french livebox from Orange : livebox 3 FR manufactured by Sagemcom
firmware revision : SoftAtHome SG30_sip-fr-6.52.12.1
orange firmware revision : g6-f-sip-fr
SSID : Livebox-8656
channel : 1
standard : 802.11bgn
maximum speed : 450 Mb/s
security : WPA/WPA2 Mixed
security option : TKIP+AES

I'm working for few projets with two types of EPS32 (4 or 8Mb - WROOM-32 and WROOM-32D), and it's the same result, also with example as you could see here.

Please let me know if you need more logs, more information, more tests, to resolve this issue.

@github-actions github-actions bot changed the title Wrong reason for wrong password during connection in STA (Wifi) Wrong reason for wrong password during connection in STA (Wifi) (IDFGH-900) Apr 2, 2019
@liuzfesp
Copy link
Contributor

liuzfesp commented Apr 2, 2019

Hi @jmberhault we already have fixed for this issue, I think the fix will be backport to v3.0/v3.1/v3.2/v3.3 soon.

@crc1021
Copy link

crc1021 commented Apr 2, 2019

this might be related, I just noticed WPS is not working v3.3 branch, but it is working v3.1 and v3.2
In v.3.3, the log shows continual SYSTEM_EVENT_STA_DISCONNECTED using the stock example in examples/wifi/wps

I (349) wifi: mode : sta (30:ae:a4:d4:23:2c)
I (349) example_wps: start wps...
I (349) example_wps: SYSTEM_EVENT_STA_START
I (359) wpa: manufacturer: ESPRESSIF, model number: ESP32, model name: ESPRESSIF IOT, device name: ESP STATION
I (369) wpa: wifi_wps_enable

I (5789) example_wps: SYSTEM_EVENT_STA_DISCONNECTED
I (7839) example_wps: SYSTEM_EVENT_STA_DISCONNECTED

@liuzfesp
Copy link
Contributor

liuzfesp commented Apr 4, 2019

HI @crc1021, could you help to provide the IDF commit ID and wifi firmware ID?

@crc1021
Copy link

crc1021 commented Apr 4, 2019

for idf
7b368fc refs/heads/release/v3.3
for wifi firmware, do you want the commit for esp32/lib submodule?
064ebf1b04bc9eed3b038fec0344d344ed05e60b components/esp32/lib

@liuzfesp
Copy link
Contributor

Hi @crc1021, this issue has been fixed in IDF master: ebe7190, please help to check it.

@crc1021
Copy link

crc1021 commented Apr 23, 2019

the problem I had was not due to this, I filed a separate issue #3294 for problem with WPS; #3318 appears to be same problem

@Alvin1Zhang
Copy link
Collaborator

@jmberhault Thanks for reporting, feel free to reopen if the issue still happens. Thanks.

0xFEEDC0DE64 pushed a commit to 0xFEEDC0DE64/esp-idf that referenced this issue May 5, 2021
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

No branches or pull requests

4 participants