[Solved] Problems with KNX 1.9 binding: "wait for confirmation"

Hi,

I have the default openHAB2 (Snapshot) version installed on Debian 8.6 and would like to get the KNX binding working, it appears this is the KNX 1.9 binding.

My configuration:

The knx.items file:

Switch    KNX_Switch   "KNX Switch"  { knx="1.001:1/1/1+<1/1/2" }

The knx.sitemap file:

sitemap knx_sitemap label="KNX Sitemap" {
    Frame label="Main KNX Categories test" {
         Switch item=KNX_Switch  label="My KNX Switch" mappings=[1="ON", 0="OFF"]
    }
}

Initialisation Okay, but WARN messages:

openHAB2 connects to the KNX Router without any noticeable problems, see log below (dates have been removed):

[DEBUG] [org.openhab.binding.knx ] - BundleEvent STARTING - org.openhab.binding.knx
[DEBUG] [ab.binding.knx.internal.KNXActivator] - KNX binding has been started.
[DEBUG] [org.openhab.binding.knx ] - ServiceEvent REGISTERED - {org.openhab.binding.knx.config.KNXTypeMapper}={component.name=org.openhab.binding.knx.typemapper, component.id=158, service.id=285, service.bundleid=181, service.scope=bundle} - org.openhab.binding.knx
[DEBUG] [org.openhab.binding.knx ] - ServiceEvent REGISTERED - {org.openhab.model.item.binding.BindingConfigReader, org.openhab.binding.knx.config.KNXBindingProvider, org.openhab.core.autoupdate.AutoUpdateBindingProvider}={component.name=org.openhab.binding.knx.genericbindingprovider, component.id=159, service.id=286, service.bundleid=181, service.scope=bundle} - org.openhab.binding.knx
[INFO ] [g.apache.aries.spifly.dynamic.bundle] - Bundle Considered for SPI providers: org.openhab.binding.knx
[INFO ] [g.apache.aries.spifly.dynamic.bundle] - No 'SPI-Provider' Manifest header. Skipping bundle: org.openhab.binding.knx
[DEBUG] [org.openhab.binding.knx ] - BundleEvent STARTED - org.openhab.binding.knx
[DEBUG] [.binding.knx.internal.bus.KNXBinding] - Calimero library version 2.3-beta
[DEBUG] [x.internal.bus.KNXBusReaderScheduler] - Starting reader task.
[DEBUG] [x.internal.bus.KNXBusReaderScheduler] - Starting schedule executor.
[DEBUG] [nx.internal.connection.KNXConnection] - KNXBinding configuration present. Setting up KNX bus connection.
[DEBUG] [org.openhab.binding.knx ] - ServiceEvent REGISTERED - {org.osgi.service.cm.ManagedService}={service.pid=org.openhab.knx, component.name=org.openhab.binding.knx.config, component.id=156, service.id=290, service.bundleid=181, service.scope=bundle} - org.openhab.binding.knx
[DEBUG] [org.openhab.binding.knx ] - ServiceEvent REGISTERED - {org.osgi.service.event.EventHandler, tuwien.auto.calimero.process.ProcessListener}={event.topics=openhab/*, component.name=org.openhab.binding.knx, component.id=157, service.id=289, service.bundleid=181, service.scope=bundle} - org.openhab.binding.knx
[DEBUG] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: Waiting for new item in reader queue
[DEBUG] [nx.internal.connection.KNXConnection] - Not connected yet. Trying to connect.
[INFO ] [tuwien.auto.calimero ] - KNXnet/IP Routing 224.0.23.12:3671: multicast loopback mode enabled
[INFO ] [nx.internal.connection.KNXConnection] - Established connection to KNX bus on 224.0.23.12:8080 in mode ROUTER.
[INFO ] [g.apache.aries.spifly.dynamic.bundle] - Bundle Considered for SPI providers: org.openhab.core.compat1x
[DEBUG] [nx.internal.connection.KNXConnection] - Success: connected.

However these also appear in the same log file, after a while:

[INFO ] [tuwien.auto.calimero                ] - process 224.0.23.12:8080: timeout waiting for group read response
[WARN ] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'KNX_Switch' from KNX bus: timeout waiting for group read response: timeout
[WARN ] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '1/1/2' = '0'
[DEBUG] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: DatapointReaderTask Waiting 50 msecs to prevent KNX bus overload
[DEBUG] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: Waiting for new item in reader queue
[DEBUG] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: got new item KNX_Switch in reader queue
[DEBUG] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: Trying to read from KNX bus: state DP 1/1/2 KNX_Switch, DPT main 0 id 1.001, low priority
[DEBUG] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: Sending read request to KNX for item 'KNX_Switch' DPT '1.001'
[INFO ] [tuwien.auto.calimero                ] - calimero.link.224.0.23.12:8080: send message to 1/1/2, wait for confirmation

But when I turn a light on, the KNX router does not respond. The logs only show the following:

[INFO ] [tuwien.auto.calimero                ] - calimero.link.224.0.23.12:8080: send message to 1/1/1, wait for confirmation
[DEBUG] [.binding.knx.internal.bus.KNXBinding] - Wrote value 'ON' to datapoint 'command DP 1/1/1 KNX_Switch, DPT main 0 id 1.001, low priority'

However there is never a “confirmation”. And ideas?

UPDATE 1:

Below is my knx.cfg file:

# KNX gateway IP address 
# (optional, if serialPort or connection type 'ROUTER' is specified)
ip=224.0.23.12

# Local KNX Binding bus address.
# Use it, when two or more openHAB Instances are connected to the same KNX bus.
# (optional, defaults to 0.0.0)
busaddr=15.15.248

# KNX IP connection type. Could be either TUNNEL or ROUTER (optional, defaults to TUNNEL)
# Note: If you cannot get the ROUTER mode working (even if it claims it is connected), 
# use TUNNEL mode instead with setting both the ip of the KNX gateway and the localIp.
type=ROUTER

# Seconds between connect retries when KNX link has been lost
# 0 means never retry, it will only reconnect on next write or read request
# Note: without periodic retries all events will be lost up to the next read/write
#       request
# (optional, default is 0)
autoReconnectPeriod=10

Maybe the telegrams are not being routed back & forth from the KNX/IP router (which model are you using?) to OH2.
Have you configured a Dummy Application to represent OH2 in ETS?

The message in the log Established connection to KNX bus on 224.0.23.12:8080 in mode ROUTER. doesn’t really mean anything (other than that you have correctly installed the KNX binding. It does not really validate the connection.

Post your knx.cfg also to check it (just in case) :slight_smile:

Have you tried TUNNEL mode? Does it work?

Oops… now I saw something strange:

224.0.23.12:8080

set
port=3671 in your knx.cfg file
(and optionally: ignorelocalevents=true)

I’m using the GIRA 2167 IP-Router, similar to the one described here: HowTo: GIRA KNX/IP Router. However, the version is slightly different, the documentation has version “00 / I10”, I have “00 / I02”.

Can you point me to some documentation for doing this?

I could help you to configure this but it is not mandatory to use a Dummy App.

Try to set the port in your config file. Somehow, port 8080 is being used (wrongly) in the communication from OH2 to the Router.

I have done this and restarted openHAB and still the same errors.

I tried this too. Below are my error messages.

[WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.100.51
[WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.100.51
[DEBUG] [org.openhab.binding.knx             ] - BundleEvent STARTING - org.openhab.binding.knx
[DEBUG] [ab.binding.knx.internal.KNXActivator] - KNX binding has been started.
[DEBUG] [org.openhab.binding.knx             ] - BundleEvent STARTED - org.openhab.binding.knx
[INFO ] [g.apache.aries.spifly.dynamic.bundle] - Bundle Considered for SPI providers: org.openhab.binding.knx
[INFO ] [g.apache.aries.spifly.dynamic.bundle] - No 'SPI-Provider' Manifest header. Skipping bundle: org.openhab.binding.knx
[DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.openhab.binding.knx.config.KNXTypeMapper}={component.name=org.openhab.binding.knx.typemapper, component.id=158, service.id=285, service.bundleid=181, service.scope=bundle} - org.openhab.binding.knx
[DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.openhab.model.item.binding.BindingConfigReader, org.openhab.binding.knx.config.KNXBindingProvider, org.openhab.core.autoupdate.AutoUpdateBindingProvider}={component.name=org.openhab.binding.knx.genericbindingprovider, component.id=159, service.id=286, service.bundleid=181, service.scope=bundle} - org.openhab.binding.knx
[INFO ] [g.apache.aries.spifly.dynamic.bundle] - Bundle Considered for SPI providers: org.openhab.core.compat1x
[INFO ] [g.apache.aries.spifly.dynamic.bundle] - No 'SPI-Provider' Manifest header. Skipping bundle: org.openhab.core.compat1x
[DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.osgi.service.event.EventHandler, tuwien.auto.calimero.process.ProcessListener}={event.topics=openhab/*, component.name=org.openhab.binding.knx, component.id=157, service.id=289, service.bundleid=181, service.scope=bundle} - org.openhab.binding.knx
[DEBUG] [.binding.knx.internal.bus.KNXBinding] - Calimero library version 2.3-beta
[DEBUG] [x.internal.bus.KNXBusReaderScheduler] - Starting reader task.
[DEBUG] [x.internal.bus.KNXBusReaderScheduler] - Starting schedule executor.
[DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.osgi.service.cm.ManagedService}={service.pid=org.openhab.knx, component.name=org.openhab.binding.knx.config, component.id=156, service.id=290, service.bundleid=181, service.scope=bundle} - org.openhab.binding.knx
[DEBUG] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: Waiting for new item in reader queue
[DEBUG] [nx.internal.connection.KNXConnection] - KNXBinding configuration present. Setting up KNX bus connection.
[DEBUG] [nx.internal.connection.KNXConnection] - Not connected yet. Trying to connect.
[INFO ] [tuwien.auto.calimero                ] - KNXnet/IP Tunneling 192.168.100.58:3671: establish connection from /127.0.1.1:53854 to /192.168.100.58:3671
[ERROR] [tuwien.auto.calimero                ] - KNXnet/IP Tunneling 192.168.100.58:3671: communication failure on connect
java.io.IOException: Invalid argument (sendto failed)
	at java.net.PlainDatagramSocketImpl.send(Native Method)[:1.8.0_121]
	at java.net.DatagramSocket.send(DatagramSocket.java:693)[:1.8.0_121]
	at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:158)[181:org.openhab.binding.knx:1.9.0.201701081510]
	at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.<init>(KNXnetIPTunnel.java:131)[181:org.openhab.binding.knx:1.9.0.201701081510]
	at tuwien.auto.calimero.link.KNXNetworkLinkIP.<init>(KNXNetworkLinkIP.java:142)[181:org.openhab.binding.knx:1.9.0.201701081510]
	at org.openhab.binding.knx.internal.connection.KNXConnection.connectByIp(KNXConnection.java:292)[181:org.openhab.binding.knx:1.9.0.201701081510]
	at org.openhab.binding.knx.internal.connection.KNXConnection.connect(KNXConnection.java:179)[181:org.openhab.binding.knx:1.9.0.201701081510]
	at org.openhab.binding.knx.internal.connection.KNXConnection.updated(KNXConnection.java:448)[181:org.openhab.binding.knx:1.9.0.201701081510]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
[ERROR] [nx.internal.connection.KNXConnection] - Error connecting to KNX bus: on connect to /192.168.100.58:3671
[WARN ] [nx.internal.connection.KNXConnection] - Initial connection to KNX bus failed!
[INFO ] [nx.internal.connection.KNXConnection] - KNX link will be retried in 10 seconds
[WARN ] [tuwien.auto.calimero                ] - KNXnet/IP Tunneling 192.168.100.58:3671: try to specify the actual IP address of the local host

Set also:
localIp=192.168.100.51 (?) This should be the IP Address of your OH2 host that is on the same subnet as the KNX/IP Router (which has the IP=192.168.100.58 ?)

It seems that you have more than 1 IP interfaces on your host. This could cause the networking problem that you are experiencing.

Found multiple local interfaces - ignoring 192.168.100.51
&
establish connection from /127.0.1.1:53854

So, you should have the following in your knx.cfg:

type=ROUTER
ip=224.0.23.12
port=3671
localIp=192.168.100.51
busaddr=15.15.248
ignorelocalevents=true
autoReconnectPeriod=10

OR

type=TUNNEL
ip=192.168.100.58
port=3671
localIp=192.168.100.51
busaddr=15.15.248
ignorelocalevents=true
autoReconnectPeriod=10
1 Like

Yes, this works (using TUNNEL) and your configuration. Thanks a lot for your help.

1 Like

Hello, just because I had many troubles with the “wait for confirmation” error… I think that it is important in TUNNEL-mode that busaddr in the knx.cfg file is identical to the address which is given by your IP Interface (at least if there is “only” an IP interface and not an IP router in your installation). I don’t think that the default (busaddr=0.0.0) works in all hardware situations even if there is just one openHAB instance (e.g. I use the Enertex IP Interface).