Moving from ESPHome 1.13.6 to the 1.14.x branch, I had a great many difficulties with connectivity ranging from devices that simply wouldn’t connect to wifi at all, to devices that would, but would lose connection to HA.
I resolved this for myself by reverting to 1.13.6, where I remain. But I have been thinking about reverting to an MQTT-based setup. It may not dovetail as tightly with HA, but there are features of MQTT that are quite attractive, such as the protocol’s inbuilt ability to remember the last state in the event of a disconnect. I think I will start looking at this for non-lightswitch devices, where possible MQTT latency doesn’t matter as much.
I’m sure it’s not a WiFi issue. The log suggests that it’s actively disconnecting rather than losing the connection.
I have 62 (at the last count) binary_sensors that I’m trying to add to the bridge. A combination of motion detectors, door switches, and the associated battery low signals.
I’ll see if I can give 1.15 a try. I’m running ESPHome in docker.
Any news on this? I have the same issue with my D1 mini. In the logs I keep seeing messages pop up that home assistant is disconnected, followed by the successful connection of home assistant…
There’s an open issue for this, I just added some details about my issue, please also report yours there otherwise this will marked as stale and not fixed. It’s been going on since I updated to ESPHome 1.14.0. This problem was not there on previous versions:
Looking at the Dropbox logs, the abort / crash messages are definitely a sign of some kind of bug. If you temporarily remove everything other that wifi / uptime sensors and log and ota, does it live through the hour?
So it still disconnects with mostly bare config, interesting.
Do you still have any abort/crash messages in logs? (It looked like they were coming from temperature sensor code that you removed, but who knows if they’d be caused somewhere else)
The bare minimum configuration you quoted above should work fine, what you’re experiencing means that either something is wrong with your particular device (unlikely but possible)
… or there’s a software problem, ie. something is wrong with the code that many others are relying on, but many others might be lucky to not hit the same set of conditions as you are… This latter option, even though it’s less likely makes the issue you’re experiencing worth investigating.
You could perhaps run it with log_level: VERBOSE or log_level: VERY_VERBOSE.
Perhaps you could strip down the config even further, I’m thinking along the lines of disabling dns and gateway, removing ota since you have serial, perhaps even removing API component, which makes it impossible for it to talk to home assistant but it should still be able to hold its wifi and not reboot.
At that point I’d say you’d have enough useful information to file an official bug with @OttoWinter.
If nothing else, Otto might be able to narrow it down even more, or perhaps sprinkle some more logging to make this easier to debug.
Perhaps we should include some general debugging/troubleshooting workflows in a doc/post somewhere.
A couple of example scenarios and what ifs.
Can you share the code for how you implemented the uptime sensor? I’m having the exact same issue with all my NodeMCUs. I’d like to track iuptime as well to see just how bad it is. I really like the ESPhome features, especially the ease of deployment and monitoring. It would be a real shame to have to go back to MQTT, but this is driving me nuts.
When you say “exactly the same issue”, do you mean crashes/aborts in logs, or wifi disconnects, or reboots, or stuckness, … there’s a couple of people with different underlying problems in this thread. Also, which version of nodemcu do you have, what do you have currently connected to your GPIO?
The disconnects which then resets the device- at least that’s what shows in the log. I have a dozen of these: CP2102 ESP-12E, they are ESP8266 Boards. Absolutely Rock solid using NodeMCU firmware and MQTT, even several hundred feet away from WiFi on 2.4 or 5ghz.
Right now the one under test just has a 3v relay and a push button and an led indicator. I keep it toggled on, but it randomly toggles off by itself. I installed the dev branch 1.15.0 last nite at 2am just for kicks, and toggled the switch on. It was still on at 8am when I just checked it.
I used to get log entries of connect/disconnect every few minutes but it cluttered the log so I suppressed those msgs. If it helps, I can reenable the log and post it here.
Uptime Sensor installed successfully.
Jeff
More investigation has revealed that the relay/gpio I set up is cycling exactly 5 minutes all by itself. On,off,on,off,etc. no automation or script is tied to this device. The uptime sensor is at 100%, so it doesn’t appear to be WiFi or connection related.
Im very vexed. And perplexed. It happed even if I swap out the esp module with another one.
I used Various configurations, displays, sensors, relays, etc. a royal pain to upload and modify/debug but I used this for a year before I discovered home assistant. Rock solid using mqtt.
Try and disable logger and see if that resolves your network connection issues.
#logger:
I have many Sonoff Basics running ESPHome and suffered with network connection issues for a long time and went deep down the rabbit hole of troubleshooting. I finally read a thread where Otto recommended trying to disable logger. That fixed my issue. Seems logger was causing something to crash/restart that affects network, but not the uptime counter for the device. My NodeMCU and D1 Mini devices with more RAM didn’t have this issue. Good luck!