Get reason of disconnection for WiFi AP mode

dgroch
Posts: 3
Joined: Thu Dec 15, 2022 9:37 pm

Get reason of disconnection for WiFi AP mode

Postby dgroch » Mon Apr 03, 2023 8:40 am

Hello,

I would like to get reason of disconnection for wifi_event_ap_stadisconnected_t, similar as we have for wifi_event_sta_disconnected_t.
I need to detect attempting to connect to the access point with an incorrect password. There was some topic here and was pointed there is missing expose of SYSTEM_EVENT_AP_STADISCONNECTED.
Is any other valid way of detecting incorrect password entry for AP?

sarvesh.bodakhe
Posts: 2
Joined: Mon Jun 12, 2023 9:31 am

Re: Get reason of disconnection for WiFi AP mode

Postby sarvesh.bodakhe » Thu Jun 15, 2023 12:35 pm

Hello @dgroch,
I would like to get reason of disconnection for wifi_event_ap_stadisconnected_t, similar as we have for wifi_event_sta_disconnected_t.
Adding reason for disconnection in wifi_event_ap_stadisconnected_t is indeed an useful feature to have. We are working on this.

I need to detect attempting to connect to the access point with an incorrect password.
Regarding detection of failed connection attempts with wrong password,
We can not use WIFI_EVENT_AP_STADISCONNECTED to detect failed connection attempts because WIFI_EVENT_AP_STADISCONNECTED is only posted when a successfully connected device disconnects from softAP.

Is any other valid way of detecting incorrect password entry for AP?
Yes, It is possible. We can add different event to detect attempts with wrong password.
May I know how you are planning to use this event about wrong-password attempts.

Thanks

kenone
Posts: 2
Joined: Wed Jul 31, 2024 8:46 am

Re: Get reason of disconnection for WiFi AP mode

Postby kenone » Wed Jul 31, 2024 8:57 am

I hope you don't mind me bringing this post from the dead.

The OP for this topic is a colleague of mine and the client is again requesting the ability to detect when a user/station enters an incorrect password for the AP.

They want to be able to take the matter into their own hands (e.g. disable the WIFI etc). This is to allow them to satisfy a stringent cyber security related requirement for their future product.

Is there currently a way to do this? I can see a deauth/disassoc being sent...
esp32_wifi_incorrect_password_response.png
esp32_wifi_incorrect_password_response.png (42 KiB) Viewed 893 times
But is there a way to reliably detect that an incorrect password attempt has been made?
Last edited by kenone on Thu Aug 01, 2024 7:54 am, edited 1 time in total.

esp32person
Posts: 17
Joined: Mon Feb 27, 2023 6:47 pm

Re: Get reason of disconnection for WiFi AP mode

Postby esp32person » Wed Jul 31, 2024 2:53 pm

Hi,

if you look at wifi_prov_mgr example project, you have,

case WIFI_PROV_CRED_FAIL: {
wifi_prov_sta_fail_reason_t *reason = (wifi_prov_sta_fail_reason_t *)event_data;
ESP_LOGE(TAG, "Provisioning failed!\n\tReason : %s"
"\n\tPlease reset to factory and retry provisioning",

Looking into that might give you ideas.

Regards

kenone
Posts: 2
Joined: Wed Jul 31, 2024 8:46 am

Re: Get reason of disconnection for WiFi AP mode

Postby kenone » Wed Jul 31, 2024 3:08 pm

esp32person wrote:
Wed Jul 31, 2024 2:53 pm
Hi,

if you look at wifi_prov_mgr example project, you have,

case WIFI_PROV_CRED_FAIL: {
wifi_prov_sta_fail_reason_t *reason = (wifi_prov_sta_fail_reason_t *)event_data;
ESP_LOGE(TAG, "Provisioning failed!\n\tReason : %s"
"\n\tPlease reset to factory and retry provisioning",

Looking into that might give you ideas.

Regards
Thank you, but the device is already provisioned and advertising at this stage. We need to capture when a device is continually trying to connect using an incorrect password.

sarvesh.bodakhe
Posts: 2
Joined: Mon Jun 12, 2023 9:31 am

Re: Get reason of disconnection for WiFi AP mode

Postby sarvesh.bodakhe » Wed Jul 31, 2024 5:44 pm

Hi @kenone,
They want to be able to take the matter into their own hands (e.g. disable the WIFI etc). This is too allow them to satisfy a stringent cyber security related requirement for their future product.

Indeed an interesting approach.

We had created changes as per the requirements of OP. Was waiting for the update.

Can you please create a github request so that the exchange of logs and build can be easier. Also please mention the target branch and any additional requirements you have.

Who is online

Users browsing this forum: No registered users and 254 guests