ESPHome devices lose their connection

It’s just this one: https://esphome.io/components/sensor/uptime.html .

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.

INFO Reading configuration /config/esphome/coop.yaml...
INFO Configuration is valid!
esphome:
  name: coop
  platform: ESP8266
  board: nodemcuv2
  platformio_options: {}
  esp8266_restore_from_flash: false
  arduino_version: [email protected]
  libraries: []
  build_path: coop
  includes: []
  board_flash_mode: dout
sensor:
- platform: uptime
  name: ESP8266 Uptime Sensor
  force_update: false
  unit_of_measurement: s
  icon: mdi:timer
  update_interval: 60s
  accuracy_decimals: 0
wifi:
  power_save_mode: NONE
  manual_ip:
    static_ip: 192.168.1.145
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns2: 0.0.0.0
    dns1: 0.0.0.0
  ap:
    ssid: MBR
    password: Xxxx
    ap_timeout: 1min
  reboot_timeout: 15min
  fast_connect: false
  domain: .local
  output_power: 20.0
  networks:
  - ssid: Shop
    password: Xxxxxx
    priority: 0.0
  use_address: 192.168.1.145
captive_portal: {}
logger:
  level: DEBUG
  baud_rate: 115200
  hardware_uart: UART0
  esp8266_store_log_strings_in_flash: true
  logs: {}
  tx_buffer_size: 512
api:
  port: 6053
  reboot_timeout: 15min
  password: ''
ota:
  port: 8266
  safe_mode: true
  password: ''
switch:
- platform: gpio
  name: Relay 1
  inverted: true
  pin:
    number: 5
    inverted: false
    mode: OUTPUT
  restore_mode: RESTORE_DEFAULT_OFF
  interlock_wait_time: 0ms
binary_sensor:
- platform: gpio
  name: Switch 1
  pin:
    number: 4
    inverted: true
    mode: INPUT_PULLUP

Any ideas?

What firmware? Tasmota?

https://nodemcu-build.com/

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.

Jeff

I finally figured out how to overcome this annoying bug. I documented how to reproduce it here.

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!

BTW, trying all the power_save_mode and fast_connect options did nothing to help this issue for me. https://esphome.io/components/wifi.html

can confirm that 2 of my Wemos D1 mini and one Sonoff RF work ok with logger enabled.

try playing around with output_power in the wifi component I cannot find it in the docs but here’s a PR

Hi I removed/disabled logger, but still same :frowning:
Screenshot 2020-02-24 10.29.00

I was having similar device unavailable issues.
Since updating ESPHome to 1.15.0-dev, running Clean Build Files and then updating the node firmwares, I have no problems.

Tried this with mine but still having the same issues unfortunately

HA version 105.5?

HA version is now 105.5 but the problem was with 102 or 103 version.

can You show how You exactly put it in your Config. file

I got some error if I try change the confgi ( esphome_version: 1.15.0-dev)

Try disable “logger” in yaml device config.

logger disable did not help

I spoke too soon.

I’m going to try and roll back to ESPHome 1.13.6

Just wokeup and checked my logs and its the same.

image

Are you all running on RPi?

Just checked my dmesg and found this

No Ubuntu on a workstation pc. Have about 25 esphome devices, just having issues with the ones running 1.14.3. Have tried updating all to 1.15 but didn’t solve it for me. Can’t seem to downgrade to 1.13.6 either, getting an error when the dashboard is about to start, anybody succesfully downgraded to 1.13.6?