Hey everyone,
I'm experiencing a strange issue with all my ESP32 devices. They connect perfectly fine to my 2.4GHz WiFi network and run without any problems — for hours, days, weeks.
However, the moment I restart the device and it tries to reconnect, the ESP32 fails with the error AUTH_EXPIRE, and all other 2.4GHz devices on the network suddenly get blocked as well but only after a restart/reconnect.
Interestingly, after the first AUTH_EXPIRE occurs, all other ESP devices get blocked after reboot with the same error — even unrelated 2.4 GHz devices like my printer can no longer connect.
Additional Info:
When using my mobile hotspot instead of the router, all ESP32 devices connect without any issues. No AUTH_EXPIRE errors occur — connections are stable even after restarts.
Any idea what's causing this?
Why does everything work fine until the ESP restarts and reconnects?
My Setup:
- ESP32-S3 DevKitC-1-N32R8V (also tested on ESP32 NodeMCU)
- Arduino IDE with latest Espressif Lib
- powered via a stable 5V power line or via stable 3.3V
Router Settings:
- 2.4 GHz Wi-Fi: Enabled, mode set to 802.11g/n mixed, channel and bandwidth set to Auto, bandwidth: 20/40 MHz.
- 5 GHz Wi-Fi: Enabled, mode set to 802.11a/n/ac mixed, channel and bandwidth set to Auto, bandwidth: 20/40/80 MHz.
- DHCP Settings: DHCPv4 server is enabled with a large address pool and a lease time of 1 hour.
Things I Tried (no success):
- 330Ω pull-up resistor on EN 3.3V
- 10k pull-up on IO0 (GPIO0) 3.3V
- Added 100nF cap to EN → no change
- Removed EN/IO0 resistors → no change
- 3.3V directly to EN & IO0 free
- WiFi.setSleep(false)
- WiFi.persistent(false)
- Manual WiFi.begin() after delay
- every Option for WiFi.setTxPower()
- if connected i have around -25 to -40 dBM
My Code:
WiFi.disconnect(true);
WiFi.mode(WIFI_STA);
WiFi.setSleep(false);
esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20);
wm.setDebugOutput(true);
WiFi.onEvent(wifiEventHandler);
wm.setConnectTimeout(300); (around the time my router needs to restart)
String apName = "X_AP_" + Index;
if (!wm.autoConnect(apName.c_str(), "password")) {
Serial.println("Failed to connect and hit timeout");
delay(2000);
ESP.restart();
} else {
//----------------//
WiFi.enableIPv6();
--> also tested with just Wifi.beginn(Name,WPA2) same issue.
Error Log:
11:17:58.305 -> [2221093][V][STA.cpp:214] _onStaEvent(): STA Disconnected: SSID: Routername, BSSID: SSID, Reason: 2
11:17:58.337 -> [2221094][V][NetworkEvents.cpp:119] checkForEvent(): Network Event: 14 - STA_DISCONNECTED
11:17:58.337 -> [2221100][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 14 - STA_DISCONNECTED
11:17:58.337 -> [2221108][W][STA.cpp:135] _onStaArduinoEvent(): Reason: 2 - AUTH_EXPIRE
11:17:58.337 -> [2221114][D][STA.cpp:156] _onStaArduinoEvent(): WiFi AutoReconnect Running
11:17:58.337 -> [2221121][W][STA.cpp:537] disconnect(): STA already disconnected.
Thanks a lot in advance for your help. If anyone needs more specific details, I’ll be happy to provide them. Have a great day!
ESP32 - WIFI AUTH_EXPIRE
Re: ESP32 - WIFI AUTH_EXPIRE
How old is your router ? If it works with your hotspot, sounds like your router is the issue.Additional Info:
When using my mobile hotspot instead of the router, all ESP32 devices connect without any issues. No AUTH_EXPIRE errors occur — connections are stable even after restarts.
Any idea what's causing this?
Why does everything work fine until the ESP restarts and reconnects?
Who is online
Users browsing this forum: No registered users and 2 guests