Esphome wifi dropout issue

I don’t have any client limit setup, so that would be an unlikely cause.
I will look into that USB cable logs. Can you provide me little bit more about how exactly I have wire them? thanks in advance.

Since you said that you flashed a module i guess that you already own an USB–>UART module. All you need is connect that box same way you did for flashing: GPIO1 to your USB-UART RX module, GPIO3 to TX and GND to GND. It’s basically no need to connect GPIO3, since communication is only one way: from module to PC - you can’t send commands from PC to esp8266 module, you can only read it’s log output (but i always connect all three pins anyway…)
Then download a PC (or MAC) terminal software (like bray terminal for PC) and observe.

1 Like

Do you have it in a spotty WiFi area? I had similar issues with my garage door opener and it was related to my wifi. I had a minimum RSSI set up on my UniFi USG that anything below -67 got dropped. However my garage coverage is spotty at best and continually got dropped. Setting this number lower to -75 fixed my isssue.

  1. I have very good wifi every corner of my home
  2. minimum RSSI is not enabled

What access points are U using, unifi ones on recent firmwares are seeing disconnection issues

I have 3x unifi-ap-ac-pro

they have been working for years with out any issues until recently.

you done an update to the firmware recently

Funny you say this, my Unifi network was acting badly a couple of weeks ago. I logged into the controller and realised there was a firmware update for the AP’s. After updating them they have been great.

yeah its been hit and miss, i had to roll back to v4 on some of mine, have a look at the forums, there are lots of issues listed with disconnects, failing to get dhcp leases etc with some of the last few releases

OK, I can’t speak for others but my issue has been fixed.

Root Cause: Solar Optimisers (Tigo optimisers)

They have been the primary suspects right from the get go since the the problem started the day they were installed. The issue is there has been zero evidence online (as per google) to indicate that they could cause any RF interference. Neither esphome not my unifi setup is nothing to do with the issue yet I spent hundreds of hours tinkering them. Anyway, I got them chucked out of my solar panels and everything is working great.

1 Like

Bugger. At least you solved the issue.

Tigo technology uses 2.4Ghz for both it’s PAN Rooftop communications, as well as it’s WiFi networking.

As you have 3 APs it is going to interfere with at least one of the channels, possibly more depending on their channel selection.

1 Like

I recently got this very same problem. ESPHome devices dropping in and out sometimes within seconds. It seems it affects more devices by the day and I’m afraid my Shelly relays may break as they flicker the relay when set to turn it on at boot. The devices that are mostly affected are closest to an AP. And I am not running any of OPs solar products. May try to get some logs via cable on some device but ripping Shelly’s in and out of the walls is not so convenient. Even less to mix uart on something connected to mains. Maybe connecting a new esp over usb could work. I’ll go through my WiFi settings and I’m also running unify access points. Not enforcing RSSI but I cannot find a setting for number of clients.

See this interesting history on one of the ESP devices (Sonoff Basic). Consistently dropping every ~15m.
image

Another device, a shelly 2.5
image

Are your ESP Devices 8266 based? And do you have the web_server component enabled. Ive recently been experiencing problems with my devices - after a recent update & i have read that the web_server component is quite large and can cause issues. Im disabling it on one of my devices to see if it fixes the wifi stability issue.

Thanks for the advice, I’d definately try it! The answer is unfortunately not yes, The devices are mixed both ESP8266 and ESP32 but they are all running the web server.

Just to rule out your screen shots aren’t by accident from a router and showing dhcp leases (and the lease time of the dhcp is set to 15 mins)?

Otherwise you checked already the all the possibilities mentioned in the FAQ? :point_down:

And logs would be also thing to go here :wink:

Thank you for you input @orange-assistant . Very late reply but yes, I have tried most of these things besides checking the logs (neither on wifi actually or uart/usb) so this is something to do!
I have since I wrote here heard that some people experience problems with Unifi APs when devices switch AP as it seems to sometimes disconnect the HA API but then they never come back. I have this issue as well on some devices and it was solved by switching to using mqtt instead of HA API. I do however have tons of ESPHome devices (above 30st and maybe 70+ wifi devices in total) so I wonder if there is a limit to the amount of connections to the HA API. I agree with you on the extremely precise timestamps that my screenshot was showing but this is not the case for all devices, nor always for this one. Besides I have the reboot parameter set manually to somehing else (And yes, it is no DHCP lease). I also cannot remember if the device was responsive to ping or not when offline.
image

This is my configuration and I’ve just changed from API to mqtt so lets see how it affects this device (same one in the screenshot above IVT Climate).

esp32:
  board: wemos_d1_mini32
  framework:
    type: arduino
mqtt:
  broker: !secret mqtt_broker
  username: !secret mqtt_username
  password: !secret mqtt_pass
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  
  manual_ip:
    static_ip: 192.168.1.159
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  reboot_timeout: 30min
  
  fast_connect: true

EDIT: This is a screenshot of the uptime over 4 days so it does not seem to be rebooting at least

That is quite assuring that you don’t experience wifi dropouts (that is what that thread is/was about initial).

Your problem look like they are related to the api communication.

The thing you really need are logs (best from the esphome node(s) and ha). Only they will tell you what really happens and which side (ha or esphome) “drops” the connection - and in best case even tells you why :ok_hand:

I’ll definately check this. Much easier than guessing :wink:
Thanks for your input so far.

omg, I found my issue! For the longest time, I tried to figure out why my esp devices were dropping wifi constantly. Driving me nuts. The answer was always in front of my face whenever I stare at my router. Either the fuse box or the massive different cabling behind that wall is causing interference. I relocated my wifi portion to a different room and no more drop.

Jesus… i wonder that this thing worked at all! Wifi device must always be on open air, NEVER in the closet, NEVER near any cables, NEVER close to (brick) walls, NEVER close to another device, especially switch mode PSU…