ESP32C3 Connecting to wifi with wrong password will not feedback STAT_WRONG_PASSWORD status
I'm building firmware with idf v4.4.4 and master branch pulled yesterday, in my issue I given a wrong password to connect to wifi, but checking network.status() will print logs like below instead of STAT_WRONG_PASSWORD
I (15944) wifi: STA_DISCONNECTED, reason:15
I (18354) wifi: STA_DISCONNECTED, reason:205
According to the document Wi-Fi Reason Code, the reason:205 description is Espressif-specific Wi-Fi reason code: the connection to the AP has failed. and code name is CONNECTION_FAIL
In MicroPython documentation we can find a constant named STAT_CONNECT_FAIL, but it's definition only can found in esp8266 port, I think there must be a connection between CONNECTION_FAIL and STAT_CONNECT_FAIL
docs: full Documentation for the Pi Pico W
a) When I want to use the following code on the Pico W:
'''
w = network.WLAN(network.STA_IF)
w.status('rssi')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: unknown status param
'''
I got an error!!!
But in the documentation is described exact this usage....
'''
Return the current status of the wireless connection.
When called with no argument the return value describes the network link status. The possible statuses are defined as constants:
STAT_IDLE – no connection and no activity,
STAT_CONNECTING – connecting in progress,
STAT_WRONG_PASSWORD – failed due to incorrect password,
STAT_NO_AP_FOUND – failed because no access point replied,
STAT_CONNECT_FAIL – failed due to other problems,
STAT_GOT_IP – connection successful.
When called with one argument param should be a string naming the status parameter to retrieve. Supported parameters in WiFI STA mode are: 'rssi'.
''
b) Next issue:
when I use the wifi connect method with a wrong password in a network which I logged in recently with the right password, the login seems to be successfull!!!
WHY?
WTF happens here?
For example I use the following config for my connection:
config = {'ssid': 'default', 'key': 'default'}
If I set ONLY the right ssid and let key as default the pico connects!?!
You have to give just the right 'ssid` to log in.
This is not the good behaviour I want to have!
My example is here:
https://github.com/hasenradball/PicoEx/blob/main/Pico_wifi_example.py
Frank