ESP32 auth_expire issue

Clouds33ker
Posts: 6
Joined: Mon Mar 01, 2021 2:33 am

ESP32 auth_expire issue

Postby Clouds33ker » Mon Mar 01, 2021 3:30 am

I've done the obligatory searches in Google, the FAQs, forums, etc and have not been able to find any answers regarding this so hopefully someone has encountered it and has a solution. I have a couple of boards running the ESP32-WROOM-32D chips and both boards are from different manufacturers so I'm thinking the issue I'm encountering may be related to the WiFi libraries and hopefully I'm missing something simple that can be pointed out to me.
The issue I'm encountering is that once an hour to the second the ESP32 is being disconnected from the AP. The reason appears to be code 2 - auth_expire. I'm using the VS/adruino IDE and have managed to modify a piece of code based on something I found on the internet to get the ESP32 to reconnect to the AP but I want a better solution since the reconnect is taking 2 minutes to reestablish the connection.

Here's an example of what I'm seeing from the serial monitor:

Saturday, February 27 2021 23:28:47 <-- Startup of ESP32. This is from setup showing things are working.
WiFi lost connection. Reason: 2 on Sunday, February 28 2021 00:07:48 <-- Disconnect is not in relation to startup time but rather IP being in the DHCP cache of the router. Once it hits whatever time that is cached in the IP table it fails like clockwork.
WiFi connected on Sunday, February 28 2021 00:09:49 <-- Notice reconnect took 2 minutes.
WiFi lost connection. Reason: 2 on Sunday, February 28 2021 01:07:48
WiFi connected on Sunday, February 28 2021 01:09:49
WiFi lost connection. Reason: 2 on Sunday, February 28 2021 02:07:48
WiFi connected on Sunday, February 28 2021 02:09:49
WiFi lost connection. Reason: 2 on Sunday, February 28 2021 03:07:48
WiFi connected on Sunday, February 28 2021 03:09:50
WiFi lost connection. Reason: 2 on Sunday, February 28 2021 04:07:48
WiFi connected on Sunday, February 28 2021 04:09:50
WiFi lost connection. Reason: 2 on Sunday, February 28 2021 05:07:48
WiFi connected on Sunday, February 28 2021 05:09:49
WiFi lost connection. Reason: 2 on Sunday, February 28 2021 06:07:48
WiFi connected on Sunday, February 28 2021 06:09:49
WiFi lost connection. Reason: 2 on Sunday, February 28 2021 07:07:48
WiFi connected on Sunday, February 28 2021 07:09:49
WiFi lost connection. Reason: 2 on Sunday, February 28 2021 08:07:48
WiFi connected on Sunday, February 28 2021 08:09:49


It appears as if the router is initiating a reauth on the minute/second of the very first time the ESP32 ever connected to the router and the ESP32 is refusing to reply to the routers request so the router disconnects the ESP32. This is an example from the router logs:
Note: trigger timestamp is different since I rebooted router in hopes that might address issue.

Feb 28 20:22:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 WPA: group key handshake failed (RSN) after 4 tries
Feb 28 20:22:33 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 IEEE 802.11: deauthenticated due to local deauth request

Feb 28 20:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 MLME: auth request, signal -58 (Accepted)
Feb 28 20:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 MLME: assoc request, signal -57 (Accepted)
Feb 28 20:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 IEEE 802.11: associated (aid 3)
Feb 28 20:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 RADIUS: starting accounting session 78C3F8911E603B0E
Feb 28 20:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 WPA: pairwise key handshake completed (RSN)
Feb 28 20:24:28 DD-WRT daemon.info dnsmasq-dhcp[3761]: DHCPREQUEST(br0) 192.168.1.102 XX:XX:XX:XX:0d:74
Feb 28 20:24:28 DD-WRT daemon.info dnsmasq-dhcp[3761]: DHCPACK(br0) 192.168.1.102 XX:XX:XX:XX:0d:74
Feb 28 20:24:34 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 IEEE 802.11: authenticated
Feb 28 21:22:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 WPA: group key handshake failed (RSN) after 4 tries
Feb 28 21:22:33 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 IEEE 802.11: deauthenticated due to local deauth request
Feb 28 21:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 MLME: auth request, signal -58 (Accepted)
Feb 28 21:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 MLME: assoc request, signal -58 (Accepted)
Feb 28 21:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 IEEE 802.11: associated (aid 2)
Feb 28 21:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 RADIUS: starting accounting session F52A95669801B540
Feb 28 21:24:28 DD-WRT daemon.info hostapd: ath1: STA XX:XX:XX:XX:0d:74 WPA: pairwise key handshake completed (RSN)
Feb 28 21:24:29 DD-WRT daemon.info dnsmasq-dhcp[3761]: DHCPREQUEST(br0) 192.168.1.102 XX:XX:XX:XX:0d:74
Feb 28 21:24:29 DD-WRT daemon.info dnsmasq-dhcp[3761]: DHCPACK(br0) 192.168.1.102 XX:XX:XX:XX:0d:74

Since the ESP32 did not respond to the "group key handshake" to validate authorization the router dropped it. The code detects this and attempts a reconnect but nothing seems to happen for 2 minutes as can be seen above.

Does anyone know what/how/where to make the ESP32 respond to the "group key handsake" so that the router does not disconnect it? Shouldn't the WiFi library handle the "group key handshake" request? If not, what needs to be implemented to deal with this? I can't seem to find anything regarding this in any of the Espressif documentation nor anywhere in any my Google searches.

Thanks for any assistance anyone can provide.

nabinodd
Posts: 1
Joined: Mon Apr 11, 2022 6:08 pm

Re: ESP32 auth_expire issue

Postby nabinodd » Mon Apr 11, 2022 6:18 pm

I had similar tests and result with arduino-1.18.19 and board manager version 2.0.2 on a esp32-devkit-v1. Still, solutions seems to exist nowhere!

Clouds33ker
Posts: 6
Joined: Mon Mar 01, 2021 2:33 am

Re: ESP32 auth_expire issue

Postby Clouds33ker » Thu Apr 14, 2022 4:35 pm

Yeah, lack of response and lack of support is why I'm moving my products to other hardware. I'd love to use the ESP32 but without support to address reliability issues I can't see spending time on products that will just waste my time and money. This is really a shame as I truly liked what all the ESP32 had to offer.

Who is online

Users browsing this forum: No registered users and 134 guests