[Solved] OH2 KNX Binding not working

I have almost 2 years running OH. After a crash of my RPI I thought it was time to upgrade to OH2.

I’ve tried everything but I get the KNX connection not working. Sonos and Yamaha is not a problem except for KNX

My openhab log

  tuwien.auto.calimero.exception.KNXIllegalArgumentException: non-valid routing multicast /192.168.1.12
    	at tuwien.auto.calimero.knxnetip.KNXnetIPRouting.<init>(KNXnetIPRouting.java:151)[196:org.openhab.binding.knx:1.9.0.201612051712]
    	at tuwien.auto.calimero.knxnetip.KNXnetIPRouting.<init>(KNXnetIPRouting.java:134)[196:org.openhab.binding.knx:1.9.0.201612051712]
    	at tuwien.auto.calimero.link.KNXNetworkLinkIP.<init>(KNXNetworkLinkIP.java:154)[196:org.openhab.binding.knx:1.9.0.201612051712]
    	at org.openhab.binding.knx.internal.connection.KNXConnection.connectByIp(KNXConnection.java:292)[196:org.openhab.binding.knx:1.9.0.201612051712]
    	at org.openhab.binding.knx.internal.connection.KNXConnection.connect(KNXConnection.java:179)[196:org.openhab.binding.knx:1.9.0.201612051712]
    	at org.openhab.binding.knx.internal.connection.KNXConnection.updated(KNXConnection.java:448)[196:org.openhab.binding.knx:1.9.0.201612051712]

My knx.cfg

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

# 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=1.1.254

# Ignore local KNX Events, prevents internal events coming from
# 'openHAB event bus' a second time to be sent back to the 'openHAB event bus'.
# Note: To send back events second time is a Bug, but for backward compatibility, the behavior is not changed.
# For new installations, its recommend to set "ignorelocalevents=true"
# (optional, defaults to false)
ignorelocalevents=true

# 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

# KNX gateway port (optional, defaults to 3671)
# Note: If you use eibd, setting to 6720
#port=

# Local endpoint to specify the multicast interface, no port is used (optional)
#localIp=

# Serial port of FT1.2 KNX interface (ignored, if ip is specified)
# Valid values are e.g. COM1 for Windows and /dev/ttyS0 or /dev/ttyUSB0 for Linux
#serialPort=

# Pause in milliseconds between two read requests on the KNX bus during
# initialization (optional, defaults to 50)
#pause=

# Timeout in milliseconds to wait for a response from the KNX bus (optional, 
# defaults to 10000)
#timeout

# Number of read retries while initialization items from the KNX bus (optional,
# defaults to 3)
#readRetries

# 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=30

### Auto refresh feature
# Number of entries permissible in the item refresher queue. 
# (optional, defaults to 10000)
#maxRefreshQueueEntries=

# Number of parallel threads for refreshing items. (optional, defaults to 5)
#numberOfThreads=

# Seconds to wait for an orderly shutdown of the auto refresher's 
# ScheduledExecutorService. (optional, defaults to 5)
#scheduledExecutorServiceShutdownTimeoutString=

# Use NAT (Network Address Translation)
#  (optional; defaults to false)
#useNAT=true

I use a Gira Router.
In OH1.8.3 I used the same configuration, and it was no problem and this worked perfectly.
Does anyone have an idea ?
I tried on a NAS, Windows, and an RPI but same results everywhere.

Shouldn’t you set ip and localIp?
Fyi, I have the KNX1 binding working flawlessly on my OH2 instance.

KAi

Strange but it works.

My configuration is:

ip=224.0.23.12
ignorelocalevents=true
type=ROUTER

Thanks

When using Router type, the multicast IP must be set to 224.0.23.12 like you have it now.

Hey

MY KNX binding is working. When I send a value to the bus, this fine. However openhab not receive updates from the knx bus.
I suspect that something is wrong with my toplogy.
My configuration is as follows:

Gira KNX router 216700

ip=224.0.23.12
busaddr=0.0.1
type=ROUTER
localIp=192.168.1.146
ignorelocalevents=true

I have no idea how to fix this…

In OH1 i have no problems

Can anyone think of an explanation of why I have no problem with the same configuration in OH1 and OH2 4 times the same value to the bus is sent?
Also, the updates are not updated from the bus OH.

I’m using for testing OH B4 for windows.

You should try the latest SNAPSHOT rather than B4. Quite a lot of changes and enhancements have been merged.

Let’s try some troubleshooting… (btw, I also recommend switching to the latest snapshot of OH2)

Check (and then post here) the output of the following commands in the Karaf console: (below is an example from my setup)

config:edit org.openhab.knx
config:property-list
openhab> config:edit org.openhab.knx
openhab> config:property-list 
   autoReconnectPeriod = 30
   busaddr = 1.2.200
   ignorelocalevents = true
   ip = 224.0.23.12
   localIp = 172.16.13.100
   maxRefreshQueueEntries = 10000
   numberOfThreads = 5
   pause = 50
   readRetries = 3
   scheduledExecutorServiceShutdownTimeoutString = 5
   service.pid = org.openhab.knx
   timeout = 10000
   type = ROUTER
openhab> 

(to enter into the Karaf console: "ssh openhab@localhost -p 8101" (password: habopen))

Maybe some stale config parameters are stored and are causing the problems…

You should make sure that you have ignorelocalevents = true to avoid telegram echo.
Even with this parameter set, the older version of the KNX Binding had some problems (sending 2 times the telegram to the KNX Bus). See here: https://github.com/openhab/openhab2-addons/issues/503 (by the way… I need to do some more testing @lewie :slight_smile:)

Regarding the status updates: Are you using a dummy application in your ETS?
You should have the GAs mapped to that dummy app in order for the GIRA KNX/IP Router to allow them to pass the filter table (and finally reach openHAB 2)

Thanks for your help.

I updated my openhab to the latest snapshot in Openhabian.
I aslo updated my router to firmware version 3. with help of your post HowTo: GIRA KNX/IP Router.

Maybe you can update these post with the TLS deactive workaround http://www.gira.com/en/service/download/download.html?id=2836

I cannot add a IP dummy is my toplogy. When i create a new project it’s possible to add a dummy in a ip line. Maybe it’s a bug in ETS.

I don’t have any problems with the same router in OH1. I cannot explain that.

My karaf output is:

openhab> config:edit org.openhab.knx
openhab> config:property-list
   autoReconnectPeriod = 30
   busaddr = 1.2.200
   ignorelocalevents = true
   ip = 224.0.23.12
   localIp = 192.168.1.120
   maxRefreshQueueEntries = 10000
   numberOfThreads = 5
   pause = 50
   port = 3671
   readRetries = 3
   scheduledExecutorServiceShutdownTimeoutString = 5
   service.pid = org.openhab.knx
   timeout = 10000
   type = ROUTER

It seems that switches the value is now sent only 1 time. with dimmers 2 more times.

This is strange… Are you using Tunnel or Router type of connection from OH1?
This means that the telegrams are crossing the GIRA Router and they reach to the openHAB (1) Host. So you don’t need to worry about the filter table (or the dummy app).

I can’t think what could be wrong when you use OH2 with the status updates…
Try enabling TRACE for the KNX binding and post the output… maybe we see there something regarding telegrams reaching OH2 but being dropped (for some strange reason…)

(in the karaf console)

log:set TRACE org.openhab.binding.knx
log:set TRACE tuwien.auto.calimero

Post also 1 or 2 items from your OH2 “*.items” config file to see the syntax.

It seems that it is working now.
I think I need a little more patience. After the initial startup KNX connection only works after 15 minutes.

Thank you for your help Dimitris

1 Like

Strange… In my setup (with the same GIRA Router) it works very fast…

Anyway… I am glad that you resolved it :wink:

I use a PI2 with Openhabian.
Which server do you use?

Raspberry Pi 3 with Raspbian
It works really fast
Maybe on the Pi2 it is slower.

OK maybe just switch to a PI3.
Do you have experience with a NUC?

No, I haven’t used the NUC yet. I see that some models accept a Hard Disk (which is good versus SD Cards)

Note: If you are planning to keep opanHAB in a simple / medium complexity level, you will be fine with the rPi3
If you want more advanced stuff to be deployed (like persistence, graphing, heavy logging, etc) you may want to consider a cheap laptop with a hard disk. The SD Cards can become corrupted when used heavily.

I have a Laptop running OH2 in parallel to the rPi3 and I am planning to move everything there (mostly for reliability, not necessarily performance)

My openhab1 is reasonable on a PI2 but every three months my SD corrupt and should I reinstall.
That’s why I was looking for a permanent solution.

1 Like

Nuc runs well, I have one running with Proxmox on it an OH in a KVM-machine, so I can do snapshots and backups when trying things out.