ratgdo / esphome-ratgdo

ratgdo for ESPHome
GNU General Public License v2.0
308 stars 75 forks source link

device regularly becomes unresponsive for several minutes #246

Open marcone opened 2 months ago

marcone commented 2 months ago

I'm using the ratgdo 2.53i standalone, not integrated with any home automation setup. I flashed it with the ESPHome firmware and have a script that polls the REST API every few seconds to get the current state and automatically close the door when it's been accidentally left open.

What I'm noticing is that the ratgdo frequently stops responding, sometimes only briefly, sometimes for minutes at a time. pinging the device shows the same behavior: it'll regularly stop responding to pings for up to a few minutes, then resumes, and these interruptions coincide with the REST API becoming nonresponsive. I can ping the GDO itself as well as other devices on the same Wifi access point (I have a dedicated AP in the garage) without issue.

(as I was typing the above, it stopped responding again and stayed unresponsive for 6 minutes)

rlowens commented 1 month ago

How often does this happen? Can you plug in and capture the serial logs?

Also, have you disabled the Home Assistant "api:" on your firmware, since you aren't using Home Assistant? The device will automatically reboot if it cannot connect to Home Assistant after 15 minutes by default. https://esphome.io/components/api.html

To disable the api, you will need to compile your own firmware with ESPHome. You'll need to install ESPHome itself somewhere and then create a device .yaml for the ratgdo and compile and flash that new firmware.

Here's what the device .yaml could look like:

substitutions:
  name: ratgdo
  friendly_name: Garage
packages:
  ratgdo.esphome: github://ratgdo/esphome-ratgdo/v25iboard.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

#custom modifications using https://esphome.io/guides/configuration-types.html#remove
api: !remove
marcone commented 1 month ago

I did not edit any yaml files or build my own firmware, I just flashed it from https://ratgdo.github.io/esphome-ratgdo/ (choosing "security + 2.0" and "ratdgo v2.5x").

I do see messages about it rebooting in the log on the web UI, however the nonresponsive periods are much more frequent than that, e.g. just in the last half hour it was unresponsive from 8:29-8:31, 8:33-8:40, 8:43-8:44, 8:46-8:48, 8:50-8:51 and 8:54-8:55.

I'll see about getting serial logs. Might have to go buy a really long USB cable first.

PaulWieland commented 1 month ago

This is probably because the ESP Home firmware is rebooting because it's not connected to HA. Look at reboot_timeout on https://esphome.io/components/api.html

marcone commented 1 month ago

But doesn't that reboot only happen every 15 minutes? The nonresponsive periods happen way more frequently than that, and their duration varies a lot too.

marcone commented 1 month ago

I attached the ratgdo to a Raspberry Pi so I could capture serial logs while the ratgdo was attached to the opener. I've attached two logs: "ping.log" is the log of a script that pings the ratgdo every second. When it receives a response it logs "alive", and when it doesn't receive a ping response it logs "unreachable". "serial.log" is the serial log, with each line prefixed by the timestamp of the time it was read, so it can be correlated with the ping log.

Some things that stood out to me:

serial.txt ping.txt

chriscrowe commented 2 weeks ago

I have this issue too... Curious if you've found any resolution. For now I've dialed my reboot_timeout values way down to try to force the ratgdo to restart itself when it becomes unresponsive.