Esphome : ESP32 unable to connect wifi

Hi guys,

I bought a ESP32-WROOM-32 board and I try to connect the board to the wifi using ESPhome.

Below my yaml configuration :
‘’’
esphome:

name: test

friendly_name: test

esp32:

board: esp32dev

framework:

type: arduino

Enable logging

logger:

level: INFO

Enable Home Assistant API

api:

encryption:

key: "vZje3zTste33qWEC5D+0rUXWEG0iQ7snRbEK6JGcxRI="

ota:

password: “954c867dc108b2278ce055e683ee81dc”

wifi:

ssid: “my_SSID”

password: “my_password”

manual_ip:

static_ip: 192.168.1.150

gateway: 192.168.1.1

subnet: 255.255.255.0

fast_connect: true

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:

ssid: "Test Fallback Hotspot"

password: "8dfubLnWoNqK"

#captive_portal:
‘’’
You can find attached the log

1 Like

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13132
load:0x40080400,len:3036
entry 0x400805e4
[I][logger:268]: Log initialized
[I][app:029]: Running through setup()…
[I][wifi:277]: WiFi Connecting to ‘Baboon’…
[W][wifi:601]: WiFi network can not be found anymore.
[W][wifi_esp32:455]: Event: Disconnected ssid=‘Baboon’ reason=‘Probe Request Unsuccessful’
[W][wifi:591]: Error while connecting to network.
[W][wifi:627]: Restarting WiFi adapter…
[I][wifi:277]: WiFi Connecting to ‘Baboon’…
[W][wifi_esp32:455]: Event: Disconnected ssid=‘Baboon’ reason=‘Probe Request Unsuccessful’
[W][wifi:601]: WiFi network can not be found anymore.
[W][wifi:627]: Restarting WiFi adapter…
[I][wifi:277]: WiFi Connecting to ‘Baboon’…
[W][wifi_esp32:455]: Event: Disconnected ssid=‘Baboon’ reason=‘Probe Request Unsuccessful’
[W][wifi:601]: WiFi network can not be found anymore.
[W][wifi:627]: Restarting WiFi adapter…
[I][wifi:277]: WiFi Connecting to ‘Baboon’…
[W][wifi_esp32:455]: Event: Disconnected ssid=‘Baboon’ reason=‘Probe Request Unsuccessful’
[W][wifi:601]: WiFi network can not be found anymore.
[W][wifi:627]: Restarting WiFi adapter…
[I][wifi:277]: WiFi Connecting to ‘Baboon’…
[W][wifi_esp32:455]: Event: Disconnected ssid=‘Baboon’ reason=‘Probe Request Unsuccessful’
[W][wifi:601]: WiFi network can not be found anymore.
[W][wifi:627]: Restarting WiFi adapter…
[I][wifi:277]: WiFi Connecting to ‘Baboon’…
[W][wifi_esp32:455]: Event: Disconnected ssid=‘Baboon’ reason=‘Probe Request Unsuccessful’
[W][wifi:601]: WiFi network can not be found anymore.
[W][wifi:627]: Restarting WiFi adapter…
[I][wifi:277]: WiFi Connecting to ‘Baboon’…
[W][wifi_esp32:455]: Event: Disconnected ssid=‘Baboon’ reason=‘Probe Request Unsuccessful’
[W][wifi:601]: WiFi network can not be found anymore.
[W][wifi:627]: Restarting WiFi adapter…

Any Idea about this WIFI connection problem ?

Thanks in advance for your support :slight_smile:

Is your Wifi SSID 6Ghz, 5Ghz, 2. 4Ghz or mixed?

My Wifi is a 2.4 Ghz

Well ok that’s not it.

In this github ticket the op has the same issue you list (error is slightly different) but they ended up having to change thier config to specify the correct board type. In thier case a D1 mini. So when they edited the configuration for the correct board. It fired up.

Shot in the dark but it’s the only one I can find that’s remotely close.

I try it yesterday when I saw this page, but that was not better.

I try with hotspot on my phone and that works great. So I understand that comes from my internet box configuration.

Is there a specific configuration on it to do ?

Thanks for your support :wink:

1 Like

I try with another smartphone and I have the same issue than with my internet box.
With internet box I try all the combination of settings but nothing works :confused:

But with my Galaxy samsung, the first try is the good one. I don’t understand what is the rootcause, that’s very strange !

1 Like

I suspect a problem on my wifi channels.

More informations on this link :

2 Likes

No way, I try:

  • All channel.
  • To split my wifi 5GHz and 2.4GHz. And connect it on 2.4GHz
  • To connect without WPA2 password
  • Change WPA2 Personnal to WPA2/WPA Personnal Mixed Mode
  • Connect the board on battery

The only things works, It’s with a hotspot phone (OK with samsung but not with Iphone). I don’t understand what is different ?!

I don’t know what can I try more ?! Have you some ideas ?

I fix my problem, I reset my internet box with the factory configuration.

I configure it with ethernet cable,split two wifi network. One for 2.4GHz and another for 5GHz.

The two one are visible from any device now. I don’t know why but my 2.4GHz wifi was ghost, visible but not operationnal. I make a diagnostic and all were good, so I don’t understand but I am not a fan of HMI configuration boxes, that make what it wants to do.

2 Likes

Good to hear that splitting your wi-fi to separate 2.4GHz and 5GHz networks fixed your problem :slight_smile:

How many devices are connecting on 5GHz and how many on 2.4GHz ?

Wi-fi Access Points usually support only a fairly low number of devices - with popular home grade WAPs that number could be only 15 wireless devices. By moving your smartphones and other devices to 5GHz you have freed up some slots for devices using the older slower 2.4GHz bandwidth … but you will hit the limit again one day.

I am glad that you’ve fixed your issue… but unfortunately I don’t see what’s different between you solution and everything I have tested.

I am with a Ubiquiti Dream Router, a SSID for 2.4Ghz only and on only one AP (on channel 6) on an IOT vlan.

These are the settings that are on… (should be close to default): Proxy ARP, BSS Transition, UAPSD, Multicast Enhancement.

I even created a brand new 2.4 ssid only for esp32 but nothing changed.

One interesting thing: with the latest versions of ESPHome, it’s looping on the same errors… but with 2023.6.3 , after a while it connects … and stays on it

I solved with Wemos C3 mini with this config into Esphome
wifi:
ssid: SAxxxxxxxxxxxxxxxxxxx
password: xxxxxxxxxxxxxxxxxxxxxxx
output_power: 8.5

Thank you @Sdomotica_Automation but it’s already part of my config…

I also tried:
substitutions:
esphome_name: bt-gateway2

esphome:
name: ${esphome_name}
platform: ESP32
board: esp32dev
on_boot:
priority: 200
then:
- wait_until:
condition:
wifi.connected:
timeout: 5s

Had the same symptoms. (AVM Fritzbox, WROOM DevKit)
It seems to be the signal power. changing the “output_power:” parameter did not cut it.
I have plugged in the ESP directly into a Router USB port and have put it right onto the plastic router case.
immediate success.

FWIW I’ve just spent the past couple of hours trying to troubleshoot several lost ESPHome devices on my HA installation. I tried everything I could think of, including making up a brand new ESP32 box and RS485 interface chip to try and get things going on my battery inverter interface, to no avail.

I eventually worked out that the ESPHome devices were connecting to the router (by doing a port scan) but several (all ESP32-C3 devices) that were apparently connecting to Home Assistant (as in they were shown as online in ESPHome) weren’t actually connected (I could not get logs from them).

After a lot of head scratching I tried the suggestion from @MaximeBe and had a look at the main router settings. Lo and behold it had stepped up to channel 13 for some reason. I set it manually to run on channel 1 and everything came back online and connected.

It does seem that there are issues with the higher frequency channels and at least some ESP devices. In my case the ESP8266 devices were working OK on channel 13, it was only the ESP32-C3 devices that weren’t.

For those with similar odd disconnection issues I suggest doing a command line ping to the device IP. This seems to be a foolproof way of seeing if it’s really connected and far more reliable than using the ESPHome “online” status flag within HA. When I was having connectivity issues a ping check always timed out, as soon as I changed the router channel I got very quick pings from each ESP device.

Not sure why all the scanning tools I used falsely showed these ESP devices to be connected when in reality they weren’t. Only clue was that Angry IP Scanner was showing very long ping times (around 2500ms) when the devices weren’t working. When they are working the ping times are typically around 5ms to 30ms.

For anyone else who has this problem I had a similar issue. My SSID has a “-” in it but I put a “—”
Possibly a problem unique to my own situation due to some copying and pasting but I thought I’d share in case it helps someone’s troubleshooting :slight_smile:

1 Like

This ^^^^ after weeks and weeks of searching and trying to figure out why some is my ESP devices would not connect via the Captive Portal This was the Reason The Freaking Underscore in my Wifi Name. Thank You, Thank You, Thank You
Apparently dahs and underscores are a problem.

Odd thing is if i flash it as something else, using ESPhome.io i can tell it the SSID and it works Fine.