EspHome - cannot connect to Wifi - "Auth Expired"

After integrating a new device into ESPHome, it fails to connect to the WiFi network, displaying the message: “reason=‘Auth Expired’”.

The device in question is an “ESP32 Wrover 1B”. An identical second device was tested and exhibited the same issue. Various routers and SSIDs were tried, both with and without passwords, as well as dynamic and static IP addresses. The problem persisted in all scenarios.

Any suggestions on what might be causing this issue?

Below is the beginning of the log:

[21:33:29]ets Jul 29 2019 12:21:46 [21:33:29] [21:33:29]rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[21:33:29]configsip: 0, SPIWP:0xee [21:33:29]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[21:33:29]mode:DIO, clock div:2
[21:33:29]load:0x3fff0030,len:1184
[21:33:29]load:0x40078000,len:13132
[21:33:29]load:0x40080400,len:3036
[21:33:29]entry 0x400805e4
[21:33:30][I][logger:156]: Log initialized
[21:33:30][C][safe_mode:079]: There have been 4 suspected unsuccessful boot attempts
[21:33:30][D][esp32.preferences:114]: Saving 1 preferences to flash…
[21:33:30][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[21:33:30][I][app:029]: Running through setup()…
[21:33:30][C][wifi:047]: Setting up WiFi…
[21:33:30][C][wifi:060]: Starting WiFi…
[21:33:30][C][wifi:061]: Local MAC: FC:B4:67:4E:92:50
[21:33:30][D][wifi:481]: Starting scan…
[21:33:30][W][component:157]: Component wifi set Warning flag: scanning for networks
[21:33:36][D][wifi:496]: Found networks:
[21:33:36][I][wifi:540]: - ‘Jorto-1’ (8A:C9:E3:8C:34:28) [redacted]▂▄▆█
[21:33:36][D][wifi:541]: Channel: 11 [21:33:36][D][wifi:542]: RSSI: -68 dB
[21:33:36][D][wifi:545]: - ‘’[redacted] (8A:C9:E3:8C:34:29) [redacted]▂▄▆█
[21:33:36][I][wifi:312]: WiFi Connecting to ‘Jorto-1’…
[21:33:41][W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid=‘Jorto-1’ bssid=8A:C9:E3:8C:34:28[redacted] reason=‘Auth Expired’
[21:33:41][W][wifi:652]: Error while connecting to network.
[21:33:41][D][wifi:696]: Retrying with hidden networks…
[21:33:41][I][wifi:312]: WiFi Connecting to ‘Jorto-1’…
[21:33:46][W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid=‘Jorto-1’ bssid=8A:C9:E3:8C:34:28[redacted] reason=‘Auth Expired’
[21:33:46][W][wifi:652]: Error while connecting to network.
[21:33:46][D][wifi:696]: Retrying with hidden networks…
[21:33:51][I][wifi:312]: WiFi Connecting to ‘Jorto-1’…
[21:34:02][W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid=‘Jorto-1’ bssid=8A:C9:E3:8C:34:28[redacted] reason=‘Auth Expired’
[21:34:02][W][wifi:652]: Error while connecting to network.
[21:34:02][D][wifi:696]: Retrying with hidden networks…

Many thanks, Eric

Hello Eric,

many reasons for this, do you have any powerhungry device connected to the esp?
do you have OLED display connected?

I would do the following test:

  1. get the device in the same room of the wifi AP you want to connect to. If this solves the issue is signal probably. Try an external antenna maybe…
  2. change power supply, sometimes bad power supply transformer can cause issues.
  3. try to add the following code in the wifi section:
wifi:
  output_power: 8.5dB

Link to github issue https://github.com/espressif/arduino-esp32/issues/2144#issuecomment-1212591202
4) if nothing helps: do you have a camera or display connected, try a code without those. If this is the case we should look at the code to understand.

Link to other posts similar issue:

https://community.home-assistant.io/t/unable-to-connect-to-wifi-auth-expired-and-association-expired/678570

Hope it helps.

Hi AutoDIY,

Many thanks for your reply.

I did keep the ESP32 close to the router even with an external antenna but this did not help.
I now have added the code as you suggested but still the same error.
There is nothing connected to the device. I just added it to ESPHome without any extra code.
The device is powered by an USB 3.x port so that should deliver enough current.

I assume there is an hardware failure on both of my devices.

Eric

Hi,
Can you share the code you downloaded to esp?
Have you tried to setup an AP like this https://esphome.io/components/captive_portal.html

Here is de code:

esphome:
  name: test
  friendly_name: test

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "9Nm8XYNCC+TpuuURA6BZQdWlqHUo2wR820XW6dlVJQ4="

ota:
  - platform: esphome
    password: "595e0ff3df8e9a201122c1192a3b82e0"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  output_power: 8.5dB

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Test Fallback Hotspot"
    password: "jd8yp9dcONor"

captive_portal:

It is only the code generated during the addition of the device.

Ok thanks,

Can you connect to the fallback hotspot?
If yes the wifi is likely to be working.

Do you have 2.4 GHz and 5 GHz SSID on router?
Did you try to switch off the 5GHz?

Try adding following code in wifi section:

fast_connect: On

And give a try.

Try to comment out logger section of the code and retest.

Do you power via usb from the pc usb or from a power adapter?

I do not know your board but sometimes the power regulator is not working fine. Can you power the esp via pins instead of usb?