KNX Tunnel not closing properly

When I do a:

$/etc/init.d/openhab stop

It seems the KNX tunnel to my KNX/IP device is not closed properly at this point.
While editing the the configuration files and then launching again

$/etc/init.d/openhab start

My /var/log/openhab/openhab.log reports back that:

2015-12-21 15:13:50.028 [INFO ] [.b.knx.internal.bus.KNXBinding] - Calimero library version 2.2.0-alpha
2015-12-21 15:13:50.159 [ERROR] [tuwien.auto.calimero ] - [KNXnet/IP receiver] KNXnet/IP Tunneling 192.168.10.5:3671: could not accept new connection (maximum reached)
2015-12-21 15:13:50.161 [ERROR] [b.k.i.connection.KNXConnection] - Error connecting to KNX bus: error response from control endpoint /192.168.10.5:3671, could not accept new connection (maximum reached)
2015-12-21 15:13:53.266 [WARN ] [b.k.i.connection.KNXConnection] - Inital connection to KNX bus failed!

Is there a way to resolve this? It seems my old connection to the IP interace still lives. I don’t want to go resetting my KNX-IP interface every time.
I’m using an ABB IP/S 2.1

Do you have a static IP for your KNX IP Gateway as well as a static IP for your OH server?

Is your IP configured acc. to KNX binding wiki in openhab.cfg (section KNX)?

Did you try router mode?

IP stays the same, my IP is also in the config file.
Router mode won’t work because the gateway doesn’t work as a router.

Sounds like the [issue we had with modbus] (https://github.com/openhab/openhab/pull/3512). With a quick glance I did not see disconnect call when the configuration is updated.

Perhaps our knx binding developers can comment more.

Since Monday I have a problem.

After restarting my host server Windows Server 2016 and the openHAB 3.1 server, openHAB can no longer connect my GIRA IP interface.
The restart was necessary because of a Windows update. But nothing has changed with centOS and openHAB.

My openHAB ran on Hyper-V virtual centOS 8 for several months without any problems.

I only have one GIRA KNX IP interface.
The IP interface can connect 4 tunnels, but I use maximum three systems to connect to the bus. (ETS, Tobit David and openHAB).

If I enable the thing I get the following log:

16:46:01.695 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing ‘knx:ip:KNXGateway’ changed from UNINITIALIZED (DISABLED) to INITIALIZING
16:46:01.722 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing ‘knx:ip:KNXGateway’ changed from INITIALIZING to UNKNOWN

16:47:01.691 [DEBUG] [knx.internal.client.AbstractKNXClient] - Bridge knx:ip:KNXGateway is disconnecting from the KNX bus
16:47:01.693 [DEBUG] [knx.internal.client.AbstractKNXClient] - Bridge knx:ip:KNXGateway is connecting to the KNX bus
16:47:01.693 [DEBUG] [.binding.knx.internal.client.IPClient] - Establishing connection to KNX bus on 192.168.10.112:3671 in mode TUNNEL.
16:47:01.698 [ERROR] [Xnet/IP Tunneling 192.168.10.112:3671] - could not accept new connection (maximum reached)
16:47:01.699 [ERROR] [Xnet/IP Tunneling 192.168.10.112:3671] - establishing connection failed, error response from control endpoint /192.168.10.112:3671: could not accept new connection (maximum reached)
16:47:01.700 [DEBUG] [knx.internal.client.AbstractKNXClient] - Error connecting to the bus: error response from control endpoint /192.168.10.112:3671: could not accept new connection (maximum reached)
tuwien.auto.calimero.KNXRemoteException: error response from control endpoint /192.168.10.112:3671: could not accept new connection (maximum reached)

  •    at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:201) ~[?:?]*
    
  •    at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.<init>(KNXnetIPTunnel.java:158) ~[?:?]*
    
  •    at org.openhab.binding.knx.internal.client.IPClient.getConnection(IPClient.java:110) ~[?:?]*
    
  •    at org.openhab.binding.knx.internal.client.IPClient.createKNXNetworkLinkIP(IPClient.java:93) ~[?:?]*
    
  •    at org.openhab.binding.knx.internal.client.IPClient.establishConnection(IPClient.java:80) ~[?:?]*
    
  •    at org.openhab.binding.knx.internal.client.AbstractKNXClient.connect(AbstractKNXClient.java:178) ~[?:?]*
    
  •    at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]*
    
  •    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]*
    
  •    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]*
    
  •    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]*
    
  •    at java.lang.Thread.run(Thread.java:829) [?:?]*
    

16:47:01.703 [DEBUG] [knx.internal.client.AbstractKNXClient] - Bridge knx:ip:KNXGateway is disconnecting from the KNX bus
16:47:01.706 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing ‘knx:ip:KNXGateway’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): error response from control endpoint /192.168.10.112:3671: could not accept new connection (maximum reached)

My thin is configuratet as follow:

label: KNX/IP Gateway
thingTypeUID: knx:ip
configuration:
  useNAT: false
  readRetriesLimit: 3
  ipAddress: 192.168.10.112
  autoReconnectPeriod: 60
  localIp: 192.168.10.113
  type: TUNNEL
  localSourceAddr: 0.0.0
  readingPause: 50
  portNumber: 3671
  responseTimeout: 10

localIp is the IP adress of the openHAB server
In the KNX project, the localSourceAddr is actually 1.1.1 but I tried this too

I tried the following:

  • switch the IP interface off and on again
  • reprogram the IP interface
  • Changed the switch port and switched it off and on
  • restart all server
  • binding and thing deleted and reinstalled
  • booted old clean saved image
  • try router mode
  • closed all other software (tunnels)
  • searched the whole internet :wink:

But openHAB still cannot connect. My ETS can almost always connect. Only sometimes I get the message that no more tunnels are available.
But when I stop ETS there must be a free tunnel.

How can I see more than in the log? Can I display the existing connections? What else can I try.
A new IP interface cannot be the solution, it works perfectly with ETS and Tobit David.

Thank you for ideas and hlep…