brutella / hkknx-public

hkknx is a HomeKit KNX bridge for KNX.
https://hochgatterer.me/hkknx
97 stars 6 forks source link

hkknx restarts regularly #305

Closed areicherdt closed 3 months ago

areicherdt commented 3 months ago

Hi, I have the problem that hkknx (2.8.1) restarts regularly. Usually 1-2 per day. I cannot say whether the problem is new. Obviously I've only noticed it since I activated the restart script from the examples and get a push notification every time it starts.

The debug/verbose flag does not provide any helpful information (for me) either. Normally I would ignore the restarts, but unfortunately the restarts set cache values. And these cached values often end up in the heating actuator, which then heats up rooms unnecessarily. The debug message gives an indication of the network connection but at the time, there were also no problems with the IP interface used by MDT.

hkknx | 2024/03/13 12:53:21 discarding message with sequence number 65 (expected 66) hkknx | DEBUG 2024/03/13 12:53:37 characteristics.go:144: {"characteristics":[{"aid":1,"iid":7,"value":"2.8.1"}]} hkknx | DEBUG 2024/03/13 12:53:37 logger.go:161: "GET http://Home-hkknx._hap._tcp.local/characteristics?id=1.7 HTTP/1.1" from 192.168.1.217:59301 - 200 55B in 56.184µs hkknx | DEBUG 2024/03/13 12:54:43 characteristics.go:144: {"characteristics":[{"aid":1,"iid":7,"value":"2.8.1"}]} hkknx | DEBUG 2024/03/13 12:54:43 logger.go:161: "GET http://Home-hkknx._hap._tcp.local/characteristics?id=1.7 HTTP/1.1" from 192.168.1.217:59301 - 200 55B in 49.001µs hkknx | 2024/03/13 12:55:21 keep alive: channel closed hkknx | channel closed hkknx | 2024/03/13 12:55:21 disconnect: write udp4 192.168.1.35:51660->192.168.1.25:3671: use of closed network connection hkknx | DEBUG 2024/03/13 12:55:21 app.go:382: tunnel closed hkknx | DEBUG 2024/03/13 12:55:21 server.go:258: http server stopped hkknx | DEBUG 2024/03/13 12:55:21 app.go:475: ntp: stop hkknx | DEBUG 2024/03/13 12:55:21 app.go:505: scripts: stop hkknx | DEBUG 2024/03/13 12:55:21 script.go:768: sniffing channel canceled hkknx | DEBUG 2024/03/13 12:55:21 script.go:119: script: stop "Neustart" hkknx | DEBUG 2024/03/13 12:55:22 server.go:244: dnssd responder stopped hkknx | DEBUG 2024/03/13 12:55:22 app.go:429: homekit: stopped hkknx | DEBUG 2024/03/13 12:55:22 app.go:444: homekit: stop hkknx | INFO 2024/03/13 12:55:23 app.go:366: tunnel: connected to 192.168.1.25:3671 (udp) via 15.15.241 hkknx | DEBUG 2024/03/13 12:55:23 script.go:92: scripts: executing "Neustart" hkknx | DEBUG 2024/03/13 12:55:23 app.go:467: ntp: disabled hkknx | 2024/03/13 12:55:23 rate limiting: sleep 0s hkknx | DEBUG 2024/03/13 12:55:23 io.go:14: read: 3/3/34 hkknx | DEBUG 2024/03/13 12:55:23 io.go:14: read: 1/1/29 hkknx | 2024/03/13 12:55:23 rate limiting: sleep 142.398354ms hkknx | DEBUG 2024/03/13 12:55:23 io.go:14: read: 2/4/105 hkknx | 2024/03/13 12:55:23 rate limiting: sleep 136.299628ms hkknx | 2024/03/13 12:55:23 rate limiting: sleep 134.818228ms hkknx | DEBUG 2024/03/13 12:55:23 io.go:14: read: 2/1/105 hkknx | DEBUG 2024/03/13 12:55:23 io.go:14: read: 3/3/16 hkknx | 2024/03/13 12:55:23 rate limiting: sleep 138.348707ms hkknx | DEBUG 2024/03/13 12:55:23 io.go:14: read: 1/1/13 hkknx | 2024/03/13 12:55:23 rate limiting: sleep 138.35649ms hkknx | 2024/03/13 12:55:24 rate limiting: sleep 134.903673ms

brutella commented 3 months ago

Tell me more about your network topology.

Is hkknx connected via Ethernet to your KNX gateway? Is hkknx connected via UDP or TCP to your KNX gateway? Is there any other software connected with your KNX gateway?

areicherdt commented 3 months ago

It‘s a UDP connection via ethernet. Hkknx runs in a container which is configured as host mode. OpenHAB was connected to the same ip interface. For test purposes, I changed the openhab connection to a separate knxd router. No improvement

brutella commented 3 months ago

For test purposes, I changed the openhab connection to a separate knxd router. No improvement

So hkknx is connected to knxd to get access to the KNX bus and not to an KNX IP Gateway?

areicherdt commented 3 months ago

No. Openhab and hkknx were both connected to the MDT interface. To test whether Openhab was causing the problem, I connected Openhab via knxd. Hkknx always runs via the MDT interface, as knxd is only set up as a knx router for me.

I have done some research on the subject in connection with the MDT interface. Apparently the MDT interface has problems with L_Data.con/req frames.

Apparently there was a similar problem with ioBroker. https://github.com/ioBroker/ioBroker.knx/issues/184

I found the following messages in the Openhab log file at times when hkknx also restarted.

tuwien.auto.calimero.KNXTimeoutException: no confirmation reply received for 0.0.0->2/4/126 L_Data.req, low priority hop count 6 repeat, tpdu 00 00

areicherdt commented 3 months ago

I have changed the interface and now use a Weinzierl 732 (secure/tcp). No reboots for 3 days! Apparently the MDT really reacts differently than expected.

brutella commented 3 months ago

Thanks for coming back and clarifying that this issue was related to your gateway.