ESPHome - Wifi - Auth Expired

Same issue here.

Right away when i flash the esp32 it works but after I disconnect it and connect it to the same PC it gives me the auth expired error.

[W][wifi_esp32:640]: Event: Disconnected ssid='TCH 2.4GHZ' bssid=[redacted] reason='Auth Expired'
[W][wifi:591]: Error while connecting to network.
[W][wifi:627]: Restarting WiFi adapter...
[D][esp-idf:000]: I (344622) wifi:
[D][esp-idf:000]: mode : softAP (48:e7:29:97:11:81)
[D][esp-idf:000]: 

[I][wifi:277]: WiFi Connecting to 'TCH 2.4GHZ'...
[D][esp-idf:000]: I (344733) wifi:
[D][esp-idf:000]: mode : sta (48:e7:29:97:11:80) + softAP (48:e7:29:97:11:81)
[D][esp-idf:000]: 

[D][esp-idf:000]: I (344734) wifi:
[D][esp-idf:000]: enable tsf
[D][esp-idf:000]: 

[D][esp-idf:000]: I (344750) wifi:
[D][esp-idf:000]: Set ps type: 1

[D][esp-idf:000]: 

[D][esp-idf:000]: I (344826) wifi:
[D][esp-idf:000]: new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
[D][esp-idf:000]: 

[D][esp-idf:000]: I (344829) wifi:
[D][esp-idf:000]: state: init -> auth (b0)
[D][esp-idf:000]: 

I am having the same issue, It is purely wifi code, I have nothing attached to the Esp32-S2-mini
Here is the code, and it is getting run.

esphome:
  name: s2-mini
  friendly_name: s2-mini
  
esp32:
  board: lolin_s2_mini
  variant: ESP32S2
  framework:
    type: arduino
    version: 2.0.6
    platform_version: 5.4.0

status_led:
  pin: 15

# Enable logging
logger:
  level: debug
wifi:
  ssid: Sweet_Spot_IoT
  password: *redacted*
  power_save_mode: none
  enable_on_boot: True
  fast_connect: On
  output_power: 8.5

this is the output on the serial after the restart

[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[I][wifi:286]: WiFi Connecting to 'Sweet_Spot_IoT'...
[W][wifi_esp32:458]: Event: Disconnected ssid='Sweet_Spot_IoT' bssid=88:B1:E1:2D:12:F2 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[I][wifi:286]: WiFi Connecting to 'Sweet_Spot_IoT'...
[W][wifi_esp32:458]: Event: Disconnected ssid='Sweet_Spot_IoT' bssid=88:B1:E1:2D:12:F2 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[I][wifi:286]: WiFi Connecting to 'Sweet_Spot_IoT'...
[W][wifi_esp32:458]: Event: Disconnected ssid='Sweet_Spot_IoT' bssid=88:B1:E1:2D:12:F2 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[I][wifi:286]: WiFi Connecting to 'Sweet_Spot_IoT'...

I also have the ability to scan the ring buffer on my APs for the client itself and any probes its making, and the MAC that is showing when I erase the chip using esptool is either not the mac it uses in the airspace, or my APs aren’t hearing a packet come out of it. This is looking like a driver issue or something at a much lower level than configuration.

If I remove the fast connect, it seems to do a passive scan (listening only) but we get more info reason=β€˜Auth Expired’

[W][wifi:640]: Restarting WiFi adapter...
[D][wifi:441]: Starting scan...
[D][wifi:456]: Found networks:
[I][wifi:500]: - 'Sweet_Spot_IoT' (88:B1:E1:2D:12:F2) β–‚β–„β–†β–ˆ
[D][wifi:501]:     Channel: 1
[D][wifi:502]:     RSSI: -72 dB
[I][wifi:500]: - 'Sweet_Spot_IoT' (30:86:2D:B0:70:91) β–‚β–„β–†β–ˆ
[D][wifi:501]:     Channel: 1
[D][wifi:502]:     RSSI: -57 dB
[D][wifi:505]: - 'Sweet Spot' (30:86:2D:B0:70:90) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'I'm a rogue 2' (00:14:6C:C6:BE:F1) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Rogue AP' (00:14:6C:C6:BE:F0) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet Spot' (88:B1:E1:2C:00:10) β–‚β–„β–†β–ˆ
[I][wifi:286]: WiFi Connecting to 'Sweet_Spot_IoT'...
[W][wifi_esp32:458]: Event: Disconnected ssid='Sweet_Spot_IoT' bssid=88:B1:E1:2D:12:F2 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[I][wifi:286]: WiFi Connecting to 'Sweet_Spot_IoT'...
[W][wifi_esp32:458]: Event: Disconnected ssid='Sweet_Spot_IoT' bssid=88:B1:E1:2D:12:F2 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[D][wifi:441]: Starting scan...
[D][wifi:456]: Found networks:
[I][wifi:500]: - 'Sweet_Spot_IoT' (88:B1:E1:29:EB:61) β–‚β–„β–†β–ˆ
[D][wifi:501]:     Channel: 6
[D][wifi:502]:     RSSI: -53 dB
[I][wifi:500]: - 'Sweet_Spot_IoT' (30:86:2D:B0:70:91) β–‚β–„β–†β–ˆ
[D][wifi:501]:     Channel: 1
[D][wifi:502]:     RSSI: -56 dB
[D][wifi:505]: - 'Sweet Spot' (88:B1:E1:29:EB:60) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet Spot' (30:86:2D:B0:70:90) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'I'm a rogue 2' (00:14:6C:C6:BE:F1) β–‚β–„β–†β–ˆ
[I][wifi:286]: WiFi Connecting to 'Sweet_Spot_IoT'...
[W][wifi_esp32:458]: Event: Disconnected ssid='Sweet_Spot_IoT' bssid=88:B1:E1:29:EB:61 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[I][wifi:286]: WiFi Connecting to 'Sweet_Spot_IoT'...
[W][wifi_esp32:458]: Event: Disconnected ssid='Sweet_Spot_IoT' bssid=88:B1:E1:29:EB:61 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...

I even tried an ancient (2006) Netgear 802.11g AP. Single SSID basic WPA2 PSK all the same error, and I can’t see anything coming out of the chip in airspace at all. no probes or anything. Something is broken in this things 802.11 it seems. I have also powered it using my benchtop power supply at 3.45v with 10a available on the 3.3v pins. So power is not the issue.

[I][wifi:500]: - 'I'm a rogue 2' (00:14:6C:C6:BE:F1) β–‚β–„β–†β–ˆ
[D][wifi:501]:     Channel: 11
[D][wifi:502]:     RSSI: -79 dB
[D][wifi:505]: - 'Sweet_Spot_IoT' (88:B1:E1:29:EB:61) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet Spot' (30:86:2D:B0:70:90) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet_Spot_IoT' (30:86:2D:B0:70:91) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet Spot' (88:B1:E1:29:EB:60) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet_Spot_IoT' (88:B1:E1:2D:12:F2) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Rogue AP' (00:14:6C:C6:BE:F0) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Rogue'n around' (00:14:6C:C6:BE:F2) β–‚β–„β–†β–ˆ
[I][wifi:286]: WiFi Connecting to 'I'm a rogue 2'...
[W][wifi_esp32:458]: Event: Disconnected ssid='I'm a rogue 2' bssid=00:14:6C:C6:BE:F1 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[I][wifi:286]: WiFi Connecting to 'I'm a rogue 2'...
[W][wifi_esp32:458]: Event: Disconnected ssid='I'm a rogue 2' bssid=00:14:6C:C6:BE:F1 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[D][wifi:441]: Starting scan...
[D][wifi:456]: Found networks:
[I][wifi:500]: - 'I'm a rogue 2' (00:14:6C:C6:BE:F1) β–‚β–„β–†β–ˆ
[D][wifi:501]:     Channel: 11
[D][wifi:502]:     RSSI: -78 dB
[D][wifi:505]: - 'Sweet Spot' (88:B1:E1:29:EB:60) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet_Spot_IoT' (88:B1:E1:29:EB:61) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet Spot' (30:86:2D:B0:70:90) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet_Spot_IoT' (30:86:2D:B0:70:91) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Sweet_Spot_IoT' (88:B1:E1:2D:12:F2) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Rogue AP' (00:14:6C:C6:BE:F0) β–‚β–„β–†β–ˆ
[D][wifi:505]: - 'Rogue'n around' (00:14:6C:C6:BE:F2) β–‚β–„β–†β–ˆ
[I][wifi:286]: WiFi Connecting to 'I'm a rogue 2'...
[W][wifi_esp32:458]: Event: Disconnected ssid='I'm a rogue 2' bssid=00:14:6C:C6:BE:F1 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...
[I][wifi:286]: WiFi Connecting to 'I'm a rogue 2'...
[W][wifi_esp32:458]: Event: Disconnected ssid='I'm a rogue 2' bssid=00:14:6C:C6:BE:F1 reason='Auth Expired'
[W][wifi:604]: Error while connecting to network.
[W][wifi:640]: Restarting WiFi adapter...

Same problem here, with a esp32-wroom-32U.

I’ve came across the same problem when coding my ESP32 base libraries ( see here : GitHub - aeonSolutions/aeonlabs-ESP32-C-Base-Firmware-Libraries: ESP32 C++ Base Firmware Libraries )

You have to add this code after running WiFi.softAP or WiFi.begin for the Wifi to work.

WiFi.setTxPower(WIFI_POWER_8_5dBm); 

More information about this can be found here: Get started with Arduino [C3 series] β€” WEMOS documentation

Having 2 similar D1 mini ESP32s here. One works like a charm (less ble_tracker issues), the other cannot connect to wifi. Same config uploaded via USB.
Extra 1000uF on the 3.3V did not help. Nothing attached.

wifi:
  ssid: Sweet_Spot_IoT
  password: *redacted*
  power_save_mode: none
  enable_on_boot: True
  fast_connect: On
  output_power: 8.5

This doesn’t seem to have any effect on the device.

1 Like

I can contribute about the issue.
Today arrived TWO esp32 AZDelivery
this model : ESP-32 Dev Kit C su az-delivery.de

with software: ESPHome-Flasher-1.4.0-Windows-x64.exe i flashed BOTH with the SAME firmare one of this i have problem with connection to wifi with
reason=β€˜Auth Expired’
So i think that this is an hardware problem (one modem only the same distance to the modem with both ESP32).
Now i try to contact the manufacturer

1 Like

I found this thread looking for the same kind of β€œauth expired” problem.
I had two ESP32 devices (listed on Ali as β€œESP32 TYPE-C USB CH340C CP2102 WiFi+Bluetooth Ultra-Low Power Dual Core ESP32-DevKitC-32 ESP-WROOM-32 Expansion Board”).
Neither worked with my config, so I suspected I’d made a mistake.
I switched to a different type of ESP (micro USB instead of USB-C if that matters), and it worked fine.
I then installed WLED on the two non-working ESPs and it installed but could not connect to my network.
I will now contact the seller for a refund on my devices that seem like duds.

Just faced this issue with a D1 Mini clone, and found that forcing the wifi into g only mode does solve the issue.

For reference, this is the code I use (lost the link to the original post) :

on_boot:
  - priority: 300
    then:
      lambda: |-
        WiFi.setPhyMode(WIFI_PHY_MODE_11G);

Hope that it will save some time for somebody looking for a solution for a seemingly random problem.

for my esp32s3 below wifi configuration resolved issue

wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  reboot_timeout: 15min
  ap:
    ssid: "Esp32-S3-Cam Fallback Hotspot"
    password: "XXXX"
  power_save_mode: none
  enable_on_boot: True
  fast_connect: On
  output_power: 8.5

Hi, did you get this working?
I have the same situation where after programming using the esphome run xyz.yaml tool (DEBUG on) Wifi connects instantly and everything works fine. Then breaking that link and linking using cutecom it just sits and β€œAuth Expired” the whole time.
What is weird is going back to using esphome logs xyz.yaml and pressing the modules reset button, Wifi works again.
None of the settings in this thread worked sofar.

Tried that, and it did not resolve my ESP32 connection issues. Tried switching from WPA2-Personal to WPA2/WPA3-Personal (it appears to be a newer option) but it’s not helping. Last option is to disable the logger: section as noted above. No, that did not resolve it, either. Quite aggravating.

The blame for the aggravation rests solely with the module/board/ESP32 manufacturer. Two of three ESP32-S3-WROOM-1 boards in a single purchase were BAD. The first would not register correctly with USB, failing to provide a valid Device Descriptor. The second would not connect via WiFi no matter what was attempted. Only the third would actually load and connect.

2 Likes

After struggling with this for a week I finally solved my issue. I popped the shield off the esp module and it looked awful. The solder paste didn’t look like it had melted all the way and components were askew. I reflowed the board, put the shield back on and I get a fast and reliable connection now.

1 Like

I had a similar problem with an ESP32-CAM board. The issue turned out to be the power regulation on the ESP32-CAM-MB. When I directly connected the ESP board the issue went away.

Changing the framrework solved the issue:

esp32:
  board: esp32dev
  framework:
    type: esp-idf
    version: recommended

Change the GPIO from my DHT22 from 13 to 32 also work

sensor:
  - platform: dht
    pin: GPIO32