ESPHome not connecting anymore

Dear friends,
after one day of experimenting succesfully with ESPHome with a NodeMCU ESP32S-WROOM board I am not sure as to what happened but I am not able to connect to my wifi anymore. Tried TONS of reflashing, recompiling, connecting to other APs but no luck. Ideas. Follow with data and logs. Thanks

Flashing host: Mac on Sierra with Python 3.7.6

bath.yaml

esphome:
  name: bath
  platform: ESP32
  board: nodemcu-32s

wifi:
  ssid: "rjanet"
  password: "12345678"

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

ouput from the CLI:

(bath) (base) iMac:iot bob$ esphome bath.yaml run
INFO Reading configuration bath.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d bath
********************************************************************************
Obsolete PIO Core v4.0.3 is used (previous was 4.2.1)
Please remove multiple PIO Cores from a system:
https://docs.platformio.org/page/faq.html#multiple-pio-cores-in-a-system
********************************************************************************
Processing bath (board: nodemcu-32s; framework: arduino; platform: [email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
Dependency Graph
|-- <AsyncTCP-esphome> 1.1.1
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
|-- <FS> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.6
|   |-- <AsyncTCP-esphome> 1.1.1
|   |-- <FS> 1.0
|   |-- <WiFi> 1.0
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <Update> 1.0
|-- <WiFi> 1.0
Compiling .pioenvs/bath/src/main.cpp.o
Linking .pioenvs/bath/firmware.elf
Retrieving maximum program size .pioenvs/bath/firmware.elf
Building .pioenvs/bath/firmware.bin
Checking size .pioenvs/bath/firmware.elf
DATA:    [=         ]  12.9% (used 42320 bytes from 327680 bytes)
PROGRAM: [=====     ]  53.1% (used 870398 bytes from 1638400 bytes)
========================= [SUCCESS] Took 8.95 seconds =========================
INFO Successfully compiled program.
Found multiple options, please choose one:
  [1] /dev/cu.SLAB_USBtoUART (CP2102 USB to UART Bridge Controller)
  [2] Over The Air (bath.local)
(number): 1
INFO Running:  platformio run -d bath -t upload --upload-port /dev/cu.SLAB_USBtoUART
********************************************************************************
Obsolete PIO Core v4.0.3 is used (previous was 4.2.1)
Please remove multiple PIO Cores from a system:
https://docs.platformio.org/page/faq.html#multiple-pio-cores-in-a-system
********************************************************************************
Processing bath (board: nodemcu-32s; framework: arduino; platform: [email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
Dependency Graph
|-- <AsyncTCP-esphome> 1.1.1
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
|-- <FS> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.6
|   |-- <AsyncTCP-esphome> 1.1.1
|   |-- <FS> 1.0
|   |-- <WiFi> 1.0
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <Update> 1.0
|-- <WiFi> 1.0
Retrieving maximum program size .pioenvs/bath/firmware.elf
Checking size .pioenvs/bath/firmware.elf
DATA:    [=         ]  12.9% (used 42320 bytes from 327680 bytes)
PROGRAM: [=====     ]  53.1% (used 870398 bytes from 1638400 bytes)
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Use manually specified: /dev/cu.SLAB_USBtoUART
Uploading .pioenvs/bath/firmware.bin
Serial port /dev/cu.SLAB_USBtoUART
Connecting........_
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 24:6f:28:a1:bd:a4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 15872 bytes to 10319...

Writing at 0x00001000... (100 %)
Wrote 15872 bytes (10319 compressed) at 0x00001000 in 0.2 seconds (effective 516.7 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 143...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (143 compressed) at 0x00008000 in 0.0 seconds (effective 1436.8 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 5233.7 kbit/s)...
Hash of data verified.
Compressed 870512 bytes to 486010...

Writing at 0x00010000... (3 %)
Writing at 0x00014000... (6 %)
Writing at 0x00018000... (10 %)
Writing at 0x0001c000... (13 %)
Writing at 0x00020000... (16 %)
Writing at 0x00024000... (20 %)
Writing at 0x00028000... (23 %)
Writing at 0x0002c000... (26 %)
Writing at 0x00030000... (30 %)
Writing at 0x00034000... (33 %)
Writing at 0x00038000... (36 %)
Writing at 0x0003c000... (40 %)
Writing at 0x00040000... (43 %)
Writing at 0x00044000... (46 %)
Writing at 0x00048000... (50 %)
Writing at 0x0004c000... (53 %)
Writing at 0x00050000... (56 %)
Writing at 0x00054000... (60 %)
Writing at 0x00058000... (63 %)
Writing at 0x0005c000... (66 %)
Writing at 0x00060000... (70 %)
Writing at 0x00064000... (73 %)
Writing at 0x00068000... (76 %)
Writing at 0x0006c000... (80 %)
Writing at 0x00070000... (83 %)
Writing at 0x00074000... (86 %)
Writing at 0x00078000... (90 %)
Writing at 0x0007c000... (93 %)
Writing at 0x00080000... (96 %)
Writing at 0x00084000... (100 %)
Wrote 870512 bytes (486010 compressed) at 0x00010000 in 11.6 seconds (effective 602.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
========================= [SUCCESS] Took 21.34 seconds =========================
INFO Successfully uploaded program.
INFO Starting log output from /dev/cu.SLAB_USBtoUART with baud rate 115200
[09:20:39][I][logger:156]: Log initialized
[09:20:39][C][ota:364]: There have been 0 suspected unsuccessful boot attempts.
[09:20:39][I][app:028]: Running through setup()...
[09:20:39][C][wifi:033]: Setting up WiFi...
[09:20:40][D][wifi:304]: Starting scan...
[09:20:41][D][wifi:319]: Found networks:
[09:20:41][I][wifi:365]: - 'rjanet' (94:91:7F:6A:09:63) β–‚β–„β–†β–ˆ
[09:20:41][D][wifi:366]:     Channel: 1
[09:20:41][D][wifi:367]:     RSSI: -55 dB
[09:20:41][D][wifi:369]: - 'WOW FI - FASTWEB' (62:91:7F:6A:09:60) β–‚β–„β–†β–ˆ
[09:20:41][D][wifi:369]: - 'DIRECT-2B-HP OfficeJet 3830' (C8:D9:D2:44:A6:2C) β–‚β–„β–†β–ˆ
[09:20:41][D][wifi:369]: - 'Zamunda Fibra' (A4:91:B1:39:6E:53) β–‚β–„β–†β–ˆ
[09:20:41][D][wifi:369]: - 'TIM-53331562' (78:81:02:99:F8:FB) β–‚β–„β–†β–ˆ
[09:20:41][D][wifi:369]: - 'TIM-53331562_2GEXT' (B0:39:56:B7:A0:F3) β–‚β–„β–†β–ˆ
[09:20:41][D][wifi:369]: - 'Zamunda Fibra' (18:A6:F7:F4:09:80) β–‚β–„β–†β–ˆ
[09:20:41][I][wifi:193]: WiFi Connecting to 'rjanet'...
[09:20:43][W][wifi_esp32:336]: Event: Disconnected ssid='rjanet' bssid=94:91:7F:6A:09:63 reason='Auth Expired'
[09:20:43][W][wifi:451]: Error while connecting to network.
[09:20:43][W][wifi:488]: Restarting WiFi adapter...
[09:20:43][I][wifi:193]: WiFi Connecting to 'rjanet'...
[09:20:45][W][wifi_esp32:336]: Event: Disconnected ssid='rjanet' bssid=94:91:7F:6A:09:63 reason='Auth Expired'
[09:20:45][W][wifi:451]: Error while connecting to network.
[09:20:45][W][wifi:488]: Restarting WiFi adapter...
^C(bath) (base) iMac:iot bob$

Hi!
It’s been a while since you posted it. Did you solve it already?

I’m kinda new in Hassio and ESPHome but had some similar problems recently.
What worked for me was:

  • Reboot Hassio
  • Reboot Device Multiple Times (don’t know why but my esp8285 only worked after I reboot twice, then connected and is working ok)
  • Wait a bit after reboot (one of my D1 Mini running ESPHome takes a while to connect to my wi-fi, I used to try something new before wait and realize that it was ok and just taking a while to work just fine)
  • Set Static IPs for all your devices. It solved all my connection problems so far!!

As I said, I’m new, but that’s what I learned with my wi-fi/connection problems lately.

ESPHome is known to have a lot of (strange) problems with wi-fi connections after uploading to some newer versions… this guy had the same problem: ESPHome - Issue 409

Hope it helps!

I had similar problems some weeks ago. Setting a static ip adress helped for me.

1 Like

How would one set a static IP for a device that wont connect in the first place?

Power reduction helped me. Most likely it’s all about Wi-Fi interference due to the multitude of devices. I found the optimal power for myself at 15 dB I also checked it without a static IP, everything works

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 10.10.10.197
    gateway: 10.10.10.1
    subnet: 255.255.0.0
  fast_connect: True
  power_save_mode: none
  output_power: 15dB