da-anda / hass-io-addons

19 stars 22 forks source link

Restart every ~5 min with watchdog enabled #60

Closed lukeg777 closed 1 week ago

lukeg777 commented 2 weeks ago

Hi,

I'm running raspberry pi 5 with home assistant OS. All up-to-date. I use TPUART USB Modul from busware.

I think there is a problem with the watchdog. When the watchdog is enabled in the configuration of the knxd add-on, approximately every 5 minutes knxd is restarting. When I disable the watchdog in Home Assistant, knxd is running and do not restart.

Here is the knxd-log with watchdog enabled: knxd_log_with_watchdog.txt

da-anda commented 2 weeks ago

from a very very quick look, @VadimKraus had added the watchdog support/config back then. Maybe he knows more. From a quick look it appears as if HA might expect a HTTP server on the defined URL/Port, but the documentation is not really clear about it. (see https://developers.home-assistant.io/docs/add-ons/configuration#optional-configuration-options). So no idea. Maybe I'll just rip it out

VadimKraus commented 2 weeks ago

The watchdog is using TCP. https://github.com/da-anda/hass-io-addons/blob/a711450b7efc6ae86814af645e0fad2bae1be480/knxd/config.yaml#L39

I would assume that knxd is not accessible anymore when that happens, even if the addon is still marked as running.

Would recommend not to remove it as it generally improves stability of the KNX connectivity.

lukeg777 commented 2 weeks ago

@VadimKraus but is the watchdog implementation correct? Maybe something changed in home assistant regarding watchdog. I can easily reproduce the issue. KNXD Add-on only restart with watchdog enabled.

Do you run KNXD Add-on with watchdog enabled?

VadimKraus commented 2 weeks ago

I am running 0.4.7 and watch dog is on Pi4

Core 2024.10.3 Supervisor 2024.10.2 Operating System 12.2 Frontend 20241002.3

image
lukeg777 commented 2 weeks ago

Hmm, ok I'm running Pi5, but this should not be the reason I think.

Also run: Core 2024.10.3 Supervisor 2024.10.2

But: Operating System 13.2

lukeg777 commented 2 weeks ago

Maybe I try to uninstall/install the KNXD Add-on.

da-anda commented 1 week ago

did it help? I also enabled the watchdog now, and it does not seem to restart the add-on. My log also says link terminated, but the add-on itself was not restarted and everything is still working fine. I also asked on knxd's Github what all these TPUART state wait should not happen and TPUART error state x17 debug messages mean (as I also get these), but got no response so far. So as long as everything is working just fine for me, just ignore these (seem also to happen with other interfaces)

lukeg777 commented 1 week ago

I reinstalled the add-on and yes it really helped - its not restarting anymore. Dont know what was the problem.

Ok, thank you for the information. As long as its working, I will ignore the messages.

da-anda commented 1 week ago

@lukeg777 here a link to my question over at knxd's Github and the reply from smurfix https://github.com/knxd/knxd/issues/383#issuecomment-2439383363 https://github.com/knxd/knxd/issues/491#issuecomment-2438347215

probably needs further debugging on our end - but I won't have time for it