ESPhome failed connection esp32

Hi,
For a week I was searching for a solution but nothing :worried:
I use esphome with home assistant since a year and it works fine but, i don’t know why but one of my esp32 had a problem: It appears connected (on green) in my esphome dashboard but when I want to see the log or update it (ota) I have this error:

WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.1.27: timed out). Re-Trying in 30 seconds
INFO Connecting to vide.local:6053 (192.168.1.27)

I can’t add it in the HA integration menu and all its entities are unavailable

Is someone have a solution?
PS: sorry for my english, i’m french

Do you have defined a static ipnumber on the device. Maybe it is taken by another device. That could explain the green. There are a device with that ipnumber but its not a esphome device. You could use a network scanning app or go into your router to check this.

The other suggestion is to use a usb cable and connect it. Then it possible to see whats happening.

I used used https://github.com/esphome/esphome-flasher/releases. I think it can show the log by usb cable.

I used it when I accidentelly updated with bad configuration.I downloaded the binary from the dashboard (If you are using hassio) and flashed it manually.

I hope it will give you some ideas how to continue.
/Mattias

Sorry I did not answer earlier, I’m very busy.
I’ve already check if there is another device with the same ip in my router, but not. I useally use esphome flasher and all the logs are good, I can see that the esp send sensor value to esphome :

[18:28:57][I][wifi:385]: - 'SFR_D010' (E4:5D:51:ED:D0:16) ▂▄▆█
[18:28:57][D][wifi:386]:     Channel: 11
[18:28:57][D][wifi:387]:     RSSI: -56 dB
[18:28:58][D][wifi:389]: - 'SFR_1408' (B0:C5:54:2A:E3:4A) ▂▄▆█
[18:28:58][I][wifi:194]: WiFi Connecting to 'SFR_D010'...
[18:28:58][I][wifi:457]: WiFi Connected!
[18:28:58][C][wifi:303]:   SSID: 'SFR_D010'
[18:28:58][C][wifi:304]:   IP Address: 192.168.1.30
[18:28:58][C][wifi:306]:   BSSID: E4:5D:51:ED:D0:16
[18:28:59][C][wifi:307]:   Hostname: 'serre'
[18:28:59][C][wifi:311]:   Signal strength: -56 dB ▂▄▆█
[18:28:59][C][wifi:315]:   Channel: 11
[18:28:59][C][wifi:316]:   Subnet: 255.255.255.0
[18:28:59][C][wifi:317]:   Gateway: 192.168.1.1
[18:28:59][C][wifi:318]:   DNS1: 0.0.0.0
[18:29:00][C][wifi:319]:   DNS2: 0.0.0.0
[18:29:00][D][wifi:466]: Disabling AP...
[18:29:00][C][ota:029]: Over-The-Air Updates:
[18:29:00][C][ota:030]:   Address: 192.168.1.30:3232
[18:29:00][C][api:022]: Setting up Home Assistant API server...
[18:29:00][C][sntp:017]: Setting up SNTP...
[18:29:01][I][app:059]: setup() finished successfully!

I also have setting another static ip to my esp and that’s not the problem.
Thank you for your reply.

Hi.

I dont see this line in the log (this is from one of mine when i connect to it.):

[11:48:44][C][api:095]: API Server:
[11:48:44][C][api:096]:   Address: irregation_single.local:6053

Thats enable the api from home assistant and also the remote logging (i think)
This is enabled by

api:
  password: **********

That would explain it or do you use mqtt?

To the unlikely casues.

I see that you use sntp. Could that cause any issues. If you configure the esp to use static ip. You need to specify the ntp servers with ip numbers. Could that cause any issues?

I see that you have changed ip number between the two runs. (You wrote that :slight_smile: )

I dont see that you have enabled the logger. Put this in the yaml file.

# Enable logging
logger:

Maybe you can get more clues.
Maybe the esp is broken or you have connected something to a pin that destroys the wifi when you start reading from a sensor or reset the board. You could comment basically everything out and just define bare esp and see if you can connect it.

Thats all ideas I had.
I hope you find out why it didnt work.

/Mattias

Hi, I don’t understand why, but my esp works now fine, I changed nothing.
I will try to understand and reply this post, it can help somebody.
Thank you for your help and your answers, you helped me a lot.

Great that it worked.
Maybe it was the ip number change. But it maybe took some time for the change to ripple through mdns and such.

/Mattias

1 Like