knxmap icon indicating copy to clipboard operation
knxmap copied to clipboard

Timeout on connection lost

Open MaxXor opened this issue 5 years ago • 3 comments

Hi, is there any configurable timeout when knxmap loses the connection to the KNX/IP Gateway? Currently when you start knxmap in bus monitor mode and then disconnect the gateway by unplugging the cable knxmap is basically stuck forever. Is there any option for timeout or reconnect on timeout?

MaxXor avatar Sep 05 '18 13:09 MaxXor

Running the bus monitor does not establish a session because KNXnet/IP is based on UDP. The client will most likely not know if a gateway drops the connection. Introducing a timeout would be a potential solution. However, it might not make much sense to have one by default. There should be some kind of keep alive for the tunnel connection, but I have to look into the bus monitor to see if it will indeed kill the connection after some extended amount of time.

takeshixx avatar Sep 17 '18 08:09 takeshixx

@takeshixx Yes, that would be awesome.

MaxXor avatar Sep 18 '18 11:09 MaxXor

Look here: https://github.com/takeshixx/knxmap/blob/9d16a2e46ed232d4c00df9f8c8ef09917dddae47/knxmap/bus/monitor.py#L70-L71

I think a possible solution would be after sending the next keepalive packet, start a timer that checks if within the next X seconds no response is received, the connection should be restarted?

MaxXor avatar Sep 18 '18 11:09 MaxXor