Unable to connect to wifi: Auth Expired and Association Expired

Hi, all.

I have a problem that I see others are having, but the posts don’t have any comments, so I’m hoping mine will get one.

I have an ESP32 device that has been running perfectly for weeks (months?). Today I unplugged it and went to move it to another location in the house, and suddenly it is now unable to connect to wifi. Connecting to its AP and looking at its logs, I see:

[I][wifi:300]: WiFi Connecting to 'redacted'...
[W][wifi_esp32:458]: Event: Disconnected ssid='redacted' bssid=[redacted] reason='Auth Expired'
[W][wifi:618]: Error while connecting to network.
[I][wifi:300]: WiFi Connecting to 'redacted'...
[W][wifi_esp32:458]: Event: Disconnected ssid='redacted' bssid=[redacted] reason='Association Expired'
[W][wifi:639]: WiFi Unknown connection status 0

It keeps doing this forever, sometimes showing Auth Expired and sometimes showing Association Expired.

I have several WLANs, and I have tried them all, and the device just won’t connect to any of them. As I said, this device worked perfectly until a couple hours ago.

Any idea how I can fix this?

I have tried downloading the latest bin file for it and reinstalling it directly with Web ESPHome, and that didn’t help.

My next attempt will be to delete the device (saving its yaml file of course), then starting fresh and recreating it.


Edited to add:

I used Web ESPHome to start over with one of the devices, and I can’t even get past the main “connect to wifi” screen – it just says “Unable to connect” after I give the credentials and press “Connect.”

As I said, this is a brand new problem today, and I did not make any changes to the network. Any ideas what I should look at?


Edited to add:

I have completely rebooted my network (Ubiqiti USG, 3 UI switches, 2 UI APs), and I have reflashed the device again using Web ESPHome, and still no success connecting the device to my network.

I’m completely dead here - anybody have any ideas?

I did update ESPHome and the ESPHome firmware on these devices today. Did that maybe cause this issue?

1 Like

Old thread but I had the same issue and managed to figure it out, I think.

Mine was partially not working (WiFi sometimes connected) but then completely WiFi-busted Wemos ESP32C3 board - Wifi not connected to the esp32 module. · Issue #2144 · espressif/arduino-esp32 · GitHub was the ticket for me, lowering the WiFi power from the default (docs):

wifi:
  output_power: 8.5dB

Other threads I went through, in case they’re helpful for anyone else.

Those seem to point to interference, though I kind of suspect a power issue since, thinking back - it might have only worked when plugged directly into my computer with USB-C vs USB-A.

7 Likes

I just ran into this problem today and your “output_power: 8.5db” made it work perfectly. Thank you for solving this for me!

1 Like

I am having this issue on some of my devices but the solution posted did not help me. not sure how to deal with with this issue.

[23:52:22][W][wifi_esp32:482][arduino_events]: Event: Disconnected ssid=‘’ bssid=xx:xx:xx:xx:xx:xx[redacted] reason=‘Association Expired’ [23:52:22][W][wifi:654]: WiFi Unknown connection status 0 [23:52:22][I][wifi:303]: WiFi Connecting to ‘’’… [23:52:22][W][wifi_esp32:482][arduino_events]: Event: Disconnected ssid=‘’*************’ bssid=xx:xx:xx:xx:xx:xx[redacted] reason=‘Association Expired’ [23:52:22][W][wifi:654]: WiFi Unknown connection status 0

I’m seeing it too, I have a little esp32 and it works fine on the second and third floors but not on the first floor. Here’s a clue:

I built it on the third floor which has an access point that broadcasts a unique SSID on the 5ghz channel and a ssid (let’s call it “foo”) on the 2.4ghz. On the bottom floor is my main wireless router which has the same SSID (foo) as well. Most devices connect to the best one, but I wonder if the ESP32 can’t.

Thus if it’s in range of the top floor one it hooks up, but when it’s on the bottom floor it tries to associate with the lower level SSID of the same name and goes bonkers. Something people may want to look into…

Minor update: I tried turning the top floor SSID off, then reconfiguring the lower floor router’s configuration with allow TKIP+AES (normally I only support AES), and even allowing WPA/PSK as well as WPA2-PSK. Still no connection. Weird.

Final update: Yep, it works fine back here on the top floor associating to a Netgear PLW1000 hub. It will not associate to the Netgear NightHawk running DD-WRT downstairs. One of these days I will figure out why, but for the moment I have other stuff to do. If you find this helpful let me know :slight_smile:

Some additional things I have noticed which may or may not apply to anyone else…

My ASUS router supports both 2.4G and 5G … but IoT devices typically only use 2.4G.

  1. Firstly, use a Wi-fi Analyser to check your wi-fi network.
    Unfortunately most wi-fi graphs show the transmit power (ie how close the WAPs are) - not how much it is being used. Also, what is a little used wi-fi channel now, can tomorrow be saturated with neighbours streaming hi-def movies.
    The channel number is important here because all WAPs on the same channel are sharing the radio frequency - not the network name. Unfortunately I have found no good way to monitor how much data is actually being transferred over multiple channels for a reasonable period.

  2. In my router’s Wireless settings, the “Smart Connect” defaults to ON. I found that this tries to push all devices on 2.4GHz to 5GHz by denying them access to the 2.4GHz … even those devices that don’t support 5GHz. Admittedly this didn’t take too long to figure out.

  3. I suggest using different SSIDs for 2.4GHz and 5GHz networks - mostly to reduce your own confusion about what is connecting where.

  4. I found that when an Access Point (WAP) was rebooted, that devices would automatically connect to the next strongest WAP’s signal - and would not change back. I ended up using the Wireless MAC Filter on 2.4GHz band at each WAP to reject those most distant devices.

I have my router (TP-Link) set to always return a fixed IP address to my esp32 devices.
I think this has something to do with a lease renewal detected during the reboot.
It seems to happen after I have a power failure that causes all devices to restart.
My fix is to manually configure each esp32 device to another SSID, and then
back to the original. This causes it to disregard the OLD lease and totally reestablish
a new lease. This may be a lease renew protocol issue with TP-Link routers, I do not remember seeing this before I changed out my router.

I replaced it with this one:

ota:
platform: esphome
password: !secret “ota_password”

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

ap:
ssid: “Bathroom-Controller”
password: !secret ap_password

I replaced it with this:

ota:
platform: esphome
password: “dffee9db1908294e661b22a29ae632c1”

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

ap:
ssid: “Bathroom-Controller”
password: “Et6RIi4Q3Vwd”

And it worked perfectly!

The proper fix would be to add a static IP on the ESP (outside your router’s DHCP range) and bypass whatever lease renew protocol issue your router has:

# Example configuration entry
wifi:
  ssid: MyHomeNetwork
  password: VerySafePassword

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.0.123
    gateway: 192.168.0.1
    subnet: 255.255.255.0

I had the same problem. It would not connect, or maintain a connection to, a Unifi access point which was broadcasting on both 2.4gHz and 5gHz frequencies. My solution was to limit the existing SSID to 2.4 gHz and create a separate SSID to broadcast at 5gHz. After that, the esp32C3 had no difficulty connecting and staying connected to the existing SSID.