Skip to content

Not getting STATION_WRONG_PASSWORD any more #218

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

Open
kriegste opened this issue Mar 13, 2019 · 13 comments
Open

Not getting STATION_WRONG_PASSWORD any more #218

kriegste opened this issue Mar 13, 2019 · 13 comments

Comments

@kriegste
Copy link

I've tried by deliberately setting a wrong station password. The module tries to reconnect over and over again and wifi_station_get_connect_status() always reports back STATION_CONNECTING.

That is correct, however, in my opinion it makes more sense to return STATION_WRONG_PASSWORD.

Otherwise the user does not know why there is no connection established... And not using it would render the struct member STATION_WRONG_PASSWORD useless anyway.

@xcguang
Copy link
Collaborator

xcguang commented Mar 14, 2019

Hi,
Maybe it is connecting when you call wifi_station_get_connect_status(). You can get more information when getting EVENT_STAMODE_DISCONNECTED. Or you can disable to reconnect by calling wifi_station_set_reconnect_policy and then get status.

@kriegste
Copy link
Author

I suspect that, too. But disabling reconnect only for this is a bit... crude. I want it to reconnect in all situations and I don't want to introduce new points of failure.

I've tried calling wifi_station_get_connect_status() in the event handler as well. Same result. In the event handler I can get event_info.disconnected.reason (== REASON_AUTH_EXPIRE) but that is not the same. Unfortunately there is no event_info.disconnected.status... that would be great.

@kriegste
Copy link
Author

If I set
wifi_station_set_reconnect_policy(false);
at start, and call wifi_station_get_connect_status() in the event handler, it still returns STATION_CONNECTING.

I know that it worked before and I got STATION_WRONG_PASSWORD in earlier versions of the SDK... even with automatic reconnect.

@xcguang
Copy link
Collaborator

xcguang commented Mar 14, 2019

Could you query which version it works well?

@kriegste
Copy link
Author

I just tried to compile my project against the current 2.2. Same behavior. Unfortunately I cannot compile against the 2.1. Too much has changed.

@kriegste
Copy link
Author

By the way, we do not get STATION_NO_AP_FOUND returned, either.

Yes, wifi_station_set_reconnect_policy is set to false.

@Kreetcha
Copy link

Kreetcha commented Nov 26, 2019

I''m also having this exact issue getting only STATION_CONNECTING when attempting to poll wifi status with wifi_station_get_connect_status() inside a timer callback. I'm trying to setup a polling timer with a callback to check the status of my station connection and handle connection issues myself (with auto reconnect disabled).

I am testing with wrong ssid/pwd and found no matter what I get the same value returned(STATION_CONNECTING).
Has any one found a solution to this?

According to api docs, I set wifi_station_set_reconnect_policy(false) after wifi is in station mode
inside user_init().
I also set wifi_set_event_handler_cb (docs say this is required after setting reconnect policy).

I still get STATION_CONNECTING no matter how much time I add between os_timer polls.

EDIT: I would like my device to switch to ap mode with an http server for a user to provide wifi credentials if a connection issue happens for a set period of time. This depends on the wifi_station_get_connect_status api call to function as the documentation describes, and return either STATION_WRONG_PASSWORD, STATION_CONNECT_FAIL, STATION_GOT_IP, etc, so I can handle programmatically instead of using auto reconnect.

@kriegste
Copy link
Author

It is really sad that the SDK does not behave like the documentation suggests. This makes WiFi connection error handling quite shaky... I'd love to see a fix here. I know that only "critical" bugs are to be corrected, but in my opinion WiFi connection problems are indeed critical ones in a WiFi SOC SDK...

@Kreetcha
Copy link

Kreetcha commented Feb 27, 2020

I believe this issue definitely falls under the category of a critical bug for 1 main reason,
this issue breaks the core functionality of the esp8266 and there is no workaround.

Fixing this issue so that the api call (wifi_station_get_connect_status in station mode) acts as the documentation describes is far from a new feature, it is nothing less than a critical bug, as it is currently breaking the core functionality of the esp8266 (wifi).

@st0ff3r
Copy link

st0ff3r commented Mar 3, 2020

still with latest master branch?

@kriegste
Copy link
Author

kriegste commented Mar 3, 2020

Computer says yes. Problem still exists...

kriegste referenced this issue Mar 22, 2020
fix(pp): Wi-Fi tx hangs when Q2_RST_INT and Q0_TX_COMPLETE come at the same time

See merge request sdk/ESP8266_NONOS_SDK!270
@kriegste
Copy link
Author

Any news on this issue?

@kriegste
Copy link
Author

Nothing?

I noticed that when I change the WiFi, the event handler gets called with EVENT_STAMODE_DISCONNECTED and the NEW WiFi SSID is in event_info.disconnected.ssid.
It was my understanding that event_info.disconnected.ssid holds the SSID of the OLD WiFi. The one before changing the config.
This may or may not have something to do with the problem I mentioned above. I guess the relevant info gets overwritten at some point before the event fires.

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