KNX IP connection fails on Debian/Raspian while working on Mac

Got openHAB 1.82 up and running on my Mac and I’m able to see and control KNX items. Connection is done via a Gira IP7KNX Router.

Then I took my Pi (which is running since weeks in my old house) and just copied the entire openhab directory to it. Give it a start … and the connection to the KNX gateway fails. Error see below.

For some weird reason ping is working only for the SU, but also running openHAB as sudo has not helped.

I tried it with a Debian laptop also, same result. So I assume there is something in Debian/Raspian which prevents me from using it. Anybody an idea where to look into?

2016-04-06 12:08:43.902 [ERROR] [tuwien.auto.calimero ] - [ManagedService Update Queue] KNXnet/IP Tunneling 192.168.1.34:3671: communication failure on connect
java.net.BindException: Die angeforderte Adresse kann nicht zugewiesen werden
at java.net.PlainDatagramSocketImpl.bind0(Native Method) ~[na:1.8.0_72]
at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:93) ~[na:1.8.0_72]
at java.net.DatagramSocket.bind(DatagramSocket.java:392) ~[na:1.8.0_72]
at java.net.DatagramSocket.(DatagramSocket.java:242) ~[na:1.8.0_72]
at tuwien.auto.calimero.knxnetip.ClientConnection.connect(ClientConnection.java:132) ~[na:na]
at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.(KNXnetIPTunnel.java:117) ~[na:na]
at tuwien.auto.calimero.link.KNXNetworkLinkIP.(KNXNetworkLinkIP.java:180) ~[na:na]
at org.openhab.binding.knx.internal.connection.KNXConnection.connectByIp(KNXConnection.java:263) ~[na:na]
at org.openhab.binding.knx.internal.connection.KNXConnection.connect(KNXConnection.java:159) ~[na:na]
at org.openhab.binding.knx.internal.connection.KNXConnection.updated(KNXConnection.java:409) ~[na:na]
at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183) ~[na:na]
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36) ~[na:na]
2016-04-06 12:08:43.903 [ERROR] [b.k.i.connection.KNXConnection] - Error connecting to KNX bus: on connect to /192.168.1.34:3671: Die angeforderte Adresse kann nicht zugewiesen werden

Did you setup the knx:localIp in openhab.cfg? For whatever reason this is necessary for knx tunnel under Linux.

knx:localIp=ip.address.of.raspberry

Thanks. It’s working.

Still no idea what difference between the TUNNEL and the ROUTER mode is. Is this something to be ignored?

In router mode knx uses ethernet as backbone, so if you have many knx lines, you can link those lines with knx ip routers (one per line/knx segment). Router mode makes use of multicast, thus it isn’t routed through the internet and the ip address of the router would be 224.0.23.12 The router will filter GAs to reduce traffic.
For knx ip tunnel there is no filtering for data, since it is singlecast, every software, which wants to make use of knx, needs an exclusive tunnel (today knx ip interfaces make more than one tunnel available, e.g. up to 5 tunnels).

So, if you own a small knx installation (< 63 bus members) router mode is of no real importance.

Ah. TX.

Is this something we should put to the KNX binding page? Maybe it helps others also?