Supergiovane / node-red-contrib-knx-ultimate

Control your KNX intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer.
https://youtu.be/egRbR_KwP9I
MIT License
141 stars 34 forks source link

1home Server Disconnects #325

Closed Appelg closed 5 months ago

Appelg commented 5 months ago

Salutation (i'll not respond to users that doesn’t wrote at least "Hello") Hello! I hope all is well with you!

Describe the bug I'm trying to connect the node and "listen to all bus messages". But every 60 seconds it disconnects. I use the new 1Home Server as IP gateway. https://www.1home.io/server-for-knx

To Reproduce Write here the steps to reproduce the behavior:

  1. Add one 'KNX Device node'
  2. Add server config (Tunnel UDP)
  3. Add one debug output node
  4. Start flow
  5. Every 60 seconds, a disconnect from the IP gateway occurrs

Expected behavior No disconnects

Screenshots This is the node red log. This occurs every 60 seconds.

[error] 1/29/2024, 6:43:36 AM.633 KNXUltimate-KNXEngine: Received KNX packet: DISCONNECT_REQUEST, ChannelID:2 Host:192.168.42.232:3671
[warn] 1/29/2024, 6:43:37 AM.634 knxUltimate-config: Disconnected event 192.168.42.232:3671 Received KNX packet: DISCONNECT_REQUEST, ChannelID:2 Host:192.168.42.232:3671
[info] 1/29/2024, 6:43:42 AM.633 KNXUltimate-config: Bind KNX Bus to interface (Auto). Node KNX Gateway
[info] 1/29/2024, 6:43:42 AM.634 knxUltimate-config: perform websocket connection on KNX Gateway
[info] 1/29/2024, 6:43:42 AM.634 KNXUltimate-config: Connecting... KNX Gateway
[info] 1/29/2024, 6:43:44 AM.636 knxUltimate-config: Connected to {
  ipAddr: '192.168.42.232',
  ipPort: 3671,
  physAddr: KNXAddress { type: 0, level: 3, _address: 4353, length: 2 },
  suppress_ack_ldatareq: false,
  loglevel: 'error',
  localEchoInTunneling: true,
  hostProtocol: 'TunnelUDP',
  isSecureKNXEnabled: false,
  jKNXSecureKeyring: null,
  localIPAddress: '172.17.0.10',
  connectionKeepAliveTimeout: 60,
  localSocketAddress: { address: '172.17.0.10', family: 'IPv4', port: 42964 }
}

Knx-Ultimate Version 2.4.5-beta.0 Node Red: v3.1.3

Are you running node-red behind homematic, docker or anything similar? Docker

Additional context I think this is a 1home Server problem. As seen in the logs, for some reason it sends a "disconnect request". I just want to make sure this isn't either a configuration error on my side, or a problem with KNX-ultimate. I have placed a support ticket with 1home, but have gotten no response so far.

Thanks!

Supergiovane commented 5 months ago

Hi I currently not own any 1home-server to test with, but i see that the docker is using a different subnet (172.17.0.10) as the 1home-server (192.168.42.232). Make sure, your docker is allowing traffic between these subnets.

Appelg commented 5 months ago

Im sorry if I was unclear.

The connection works, and I receive KNX Messages.

The problem is that the connection drops and reconnects every 60 seconds. This takes like 5 seconds, so every minute I loose 5 seconds of messsges.

I think this is the same problem as here:

https://github.com/Supergiovane/node-red-contrib-knx-ultimate/issues/238#issuecomment-1520062664

Supergiovane commented 5 months ago

Hi this is not normal. Try enabling this. It's for compatibility with old devices, but you can try out...

Node-RED___Avvio
Appelg commented 5 months ago

Hi this is not normal. Try enabling this. It's for compatibility with old devices, but you can try out...

Node-RED___Avvio

Sorry, that did not work.

I think we can close this issue, I will update when I get an answer from the 1Home support, so that can help others in the future. I still think that they need to fix whatever is causing the disconnect reuqests.

Appelg commented 5 months ago

I wrote a quick C# console application that listens to the bus using Knx.Falcon.Sdk https://support.knx.org/hc/en-us/articles/360000932564-What-is-the-Falcon-NET-SDK-

This experiences the exact same problem, disconnects every 60 seconds. image

Still awaiting response from the 1Home team.

Supergiovane commented 5 months ago

I'm sorry for that. I had other users experiencing the same issue with others "all in one" devices. I suggest you to think to buy a cheap KNX/IP interface, because the connection must be rock solid.

Appelg commented 5 months ago

I'm sorry for that. I had other users experiencing the same issue with others "all in one" devices. I suggest you to think to buy a cheap KNX/IP interface, because the connection must be rock solid.

Good idea. Can you recommend a vendor / device?

Supergiovane commented 5 months ago

I'm finding very well with Enertex, but i've also a cheap Eibmarkt KNX/IP interface (manufactured by MDT)

Appelg commented 5 months ago

@Supergiovane

Update: The 1home team has great support. Thoghether we were able to find the issue:

In order to close unused tunnels faster, they had set the heartbeat timeout to 60 seconds in their gateway.

Since your code uses exactly 60 seconds as heartbeat timer, the tunnel got closed just a couple of milliseconds before the heartbeat.

They have now changed the timeout back to 120 seconds on their side, and its now working!

Supergiovane commented 5 months ago

Hi Great! But... the KNX specs says this:

UNI1607607_EEN_BANANA

I've seen many times a certified vendor moving out of the standard specs requirements. This is not good, because you can loose the compatibility with the KNX world. I understand 1Home needs to close open sockets as soon as possible, but it shall not disregard the specs, in any case. :-) Anyway, good to see you solved the issue!!

Appelg commented 5 months ago

@Supergiovane I agree, thanks for sharing the specs.

They understood and agreed, and switched back immediately.