Illustrated title card for the guide: ESPHome Wi-Fi Disconnects and Handshake Fixes
troubleshooting

ESPHome Wi-Fi Disconnects and Handshake Fixes

Decode ESPHome’s Auth Expired and 4-way handshake errors, capture USB logs, and isolate Wi-Fi power saving or mesh roaming with YAML checks.

By ESPHome Guide Editorial · ·Updated · 3 min read

Start with the USB log. On ESP32, Auth Expired can mean the authentication timed out. Check whether another device can join the same Wi-Fi. For 4-Way Handshake Timeout, verify the Wi-Fi password. If the node joins and drops later, try power_save_mode: none and check mesh roaming separately. Espressif Wi-Fi driver guide · Espressif Wi-Fi FAQ · ESPHome WiFi component

Capture the disconnect over USB

With serial logging enabled in logger:, connect over USB serial and run the command below. Substitute your YAML filename and serial port. On ESP32, capture a failed join or a drop after connecting, and record the reason field and any visible bssid field. ESPHome Logger · ESPHome logs command · ESPHome ESP32 Wi-Fi source

esphome logs my-device.yaml --device /dev/cu.SLAB_USBtoUART

Read Auth Expired and handshake errors

These are ESPHome’s ESP32 log labels and the corresponding ESP-IDF reason codes. ESPHome ESP32 Wi-Fi source · Espressif reason codes · Espressif Wi-Fi FAQ

ESPHome log reasonMeaning on ESP32First check
Auth ExpiredAUTH_EXPIRE (2). Authentication timed out or the access point sent this reason.Confirm the configured SSID and try joining it with a phone. If the phone also fails to join, check the router first.
4-Way Handshake Timeout4WAY_HANDSHAKE_TIMEOUT (15). The handshake timed out or the access point reported that reason.Verify the password for the configured SSID. Espressif lists a wrong password on an encrypted network as one possible cause.
Handshake FailedHANDSHAKE_TIMEOUT (204). Espressif’s driver reports the handshake failed.Check the password and signal strength. Espressif lists this code under both wrong password and low signal strength (RSSI).

Check ssid and password under wifi: or in the matching networks: entry. For !secret wifi_password, verify wifi_password in secrets.yaml. If you make a correction, upload it with the USB run command below and watch for a successful join. ESPHome WiFi configuration · ESPHome YAML secrets · ESPHome run command

Try power_save_mode: NONE

For a device that connects and later drops, add the setting below to the existing wifi: block. LIGHT is the ESP32 default. NONE is the least power-saving mode and is already the ESP8266 default. Disabling ESP32 modem sleep increases power consumption. ESPHome power save modes · Espressif Wi-Fi driver guide

wifi:
  power_save_mode: none

Use run to validate, compile, upload over USB, and start the log view. Use the same command to upload after each YAML change. ESPHome run command

esphome run my-device.yaml --device /dev/cu.SLAB_USBtoUART

Compare the logs for disconnects. If drops continue, restore the previous power setting before trying roaming changes. If drops stop, try the previous setting again to see if the symptom returns before keeping none.

Check for a mesh access-point switch

For driver-initiated roaming, look for Station Roaming or Roamed near the drop in the ESP32 logs. Compare the connected BSSID before and after the drop. The ESP32 can reconnect to another access point with the same SSID, so look for a repeated pattern around the drops. ESPHome ESP32 Wi-Fi source · Espressif Wi-Fi reconnect

To expose the connected BSSID as a text sensor, add this entry to your text_sensor: list and upload with the same run command. Read Device Connected BSSID while the node is online. ESPHome WiFi Info · ESPHome run command

text_sensor:
  - platform: wifi_info
    bssid:
      name: Device Connected BSSID

After a stationary device joins a visible network, ESPHome’s basic post-connect roaming can switch to an access point with a significantly stronger signal on the same SSID. The switch can briefly interrupt the API connection. On ESP32, enabling either native option, enable_btm (802.11v) or enable_rrm (802.11k), disables basic roaming. ESPHome post-connect roaming

If drops follow access-point switches on ESP32, temporarily turn off the automatic roaming options below in the existing wifi: block. The last two keys are for ESP32. Upload, repeat the comparison, then restore the original settings and see whether the pattern returns. ESPHome roaming configuration

wifi:
  post_connect_roaming: false
  enable_btm: false
  enable_rrm: false

Evidence and limits. The steps are based on the ESPHome 2026.11.1 documentation and ESP32 source reference, and Espressif’s ESP-IDF v5.5.4 Wi-Fi guide and Wi-Fi FAQ. Sources were checked on 2026-11-26. The steps were not run on hardware.

Sources

  1. ESPHome WiFi Component
  2. ESPHome Logger Component
  3. ESPHome ESP32 Wi-Fi source
  4. Espressif ESP32 Wi-Fi Driver Guide, ESP-IDF v5.5.4
  5. ESPHome WiFi Info Text Sensor
  6. ESPHome YAML Configuration
  7. Espressif Wi-Fi FAQ
  8. ESPHome CLI Logs Command
  9. Espressif ESP32 Wi-Fi Reason Codes
  10. ESPHome WiFi Configuration Variables
  11. ESPHome CLI Run Command
  12. ESPHome WiFi Power Save Mode
  13. Espressif ESP32 Wi-Fi Reconnect
  14. ESPHome WiFi Post-Connect Roaming

Related