Openhab 3 - KNX binding (Raspberry Pi with KNXD and Openhab3)

hi all,

A few years back I already made my KNX system work with openhab on my Raspberry Pi with KNXD. Back than I already had to use a very strange setup.

A few days ago i installed OH3 but now i’m not able to connect OH3 to my knx system anymore.
First: my installation proces:

1. Installed clean raspbian OS
2. Gave pi static ip

[Match]
Name=eth0
[Network]
Address=192.168.178.2/24
Gateway=192.168.178.1
DNS=192.168.178.1
[Route]
Destination=224.0.23.12/32

3. installed KNXD

via Raspberry Pi: EIB/KNX IP Gateway and Router with knxd

made is USB backend (/etc/default/knxd)
K NXD_OPTIONS="--eibaddr=1.1.128 --client-addrs=1.1.129:8 -d -D -T -R -S -i --listen-local=/tmp/knx -b usb:

I think so far so good:
root@raspberrypi:~# ps ax|grep knxd
882 ? Ssl 0:00 /usr/local/bin/knxd -p /run/knxd/knxd.pid --eibaddr=1.1.128 --client-addrs=1.1.129:8 -d -D -T -R -S -i --listen-local=/tmp/knx -b usb:
12857 pts/9 S+ 0:00 grep knxd

I’m able to toggle my lights via the terminal:
knxtool groupswrite ip:localhost 7/0/0 1

----------------- OPENHAB 3 install --------------------

All worked great.

Next made a binding: knx.things

Bridge knx:ip:bridge [  
    type="ROUTER", 
    ipAddress="224.0.23.12", 
    portNumber=3671, 
    localIp="192.168.178.2",
    readingPause=50, 
    responseTimeout=10, 
    readRetriesLimit=3, 
    autoReconnectPeriod=60,
    localSourceAddr="1.1.128"
    ] {
        Type switch        : demoSwitch        "Licht OH3things ROUTER"       [ ga="1.001:7/0/0" ]
        Type switch        : demoSwitch2        "Licht3 OH3things ROUTER"       [ ga="1.001:<7/0/0" ]
        Type switch        : demoSwitch3        "Licht3 OH3things ROUTER"       [ ga="<7/0/0" ]
        Type switch        : demoSwitch4        "Licht4 OH3things ROUTER"       [ ga="7/0/0" ]
    }

(i made different switches to find out what adress format worked)

This bridge shows up in things as “Online

Made knx.items:

Switch        demoSwitch         "Light_ITEMs_OH3 [%s]"               <light>          { channel="knx:device:bridge:generic:demoSwitch" }
Switch        demoSwitch2         "Light_ITEMs_OH3 2 [%s]"               <light>          { channel="knx:device:bridge:generic:demoSwitch2" }
Switch        demoSwitch3         "Light_ITEMs_OH3 3[%s]"               <light>          { channel="knx:device:bridge:generic:demoSwitch3" }
Switch        demoSwitch4        "Light_ITEMs_OH3 4[%s]"               <light>          { channel="knx:device:bridge:generic:demoSwitch4" }

Made a sitemap;

sitemap knx label="KNX Demo Sitemap" {
Frame label="Demo Elements" {
Switch item=demoSwitch
Switch item=demoSwitch2
Switch item=demoSwitch3
Switch item=demoSwitch4
}                
}

However, i’m not able to control my lights :frowning:

Can anyone help me finding the mistake i’m making?

Kind regards,
Yarn

1 Like

I have the same issue. If I use the router mode with the knxd, reading from KNX bus works fine, writing to the KNX bus does not work. Writing with the knxtool works fine and also my OH2 installation works fine with the same knxd instance. So the problem seems to be related to OH3 somehow.

If I use the tunnel mode and connect directly to my MDT interface SCN-IP000.03, write works but very delayed and I got a lot of these errors:

2021-01-03 17:28:06.112 [WARN ] [NXnet/IP Tunneling 192.168.0.99:3671] - response timeout waiting for confirmation
tuwien.auto.calimero.KNXTimeoutException: no confirmation reply received for 1.1.3->5/2/1 L_Data.req, low priority hop count 6 repeat, tpdu 00 00
	at tuwien.auto.calimero.knxnetip.ClientConnection.doExtraBlockingModes(ClientConnection.java:244) [bundleFile:?]

Any ideas?

@Clover4x4 I’am using the 64 bit version of the Rasperry PI OS. You too?

I’m using 32 bit
Still not managed to get it up and running :frowning:

I have tested now a while with my two rasperry pi’s.

  1. is running 32 bit with OH 2.5
  2. is running 64 bit with OH 3.0
  • If I start knxd on the 1), OH 2.5 and OH 3.0 is working fine with the knx binding in the router mode
  • If I start knxd on the 2), OH 2.5 is working fine, OH 3.0 can only read from the knx bus

So what I know for now is, that knx itself and OH 3.0 seem to be ok. But the write commands to the knxd on the same machine are not working, it seems that the routing of the UDP packages to the local running knxd is not working. Very strange, no idea how to solve this problem.

Sorry, I’am wrong, also running the knxd on another computer does not work correct. In this case, writing to knx is working, but reading does only work, if the GA is set with the knxtool. If the change come from knx, OH3 does not receive it.

Hi @michi @Clover4x4

Did you manage to resolve this? I have the same/similar problem.

BasicUI can read from the bus, but not write.
PageUI can write to the bus but not read.

Latest stable version OH3 and KNXD running Debian Buster on a Pi3

Scenario 1
knxd in ROUTER mode.

  1. knxtools is able to read/write from the knx bus
  2. Using BasicUI, OH Sitemap controls do not dynamically update their value but a browser refresh does set them to the correct value.
  3. Using BasicUI, OH Sitemap controls cannot write to the bus.
  4. Using PageUI. PageUI controls cannot read or write to the bus.

Scenario 2
knxd in TUNNEL mode.

  1. knxtools is able to read/write from the knx bus
  2. Using BasicUI, OH Sitemap controls do not dynamically update their value but a browser refresh does set them to the correct value.
  3. Using BasicUI, OH Sitemap controls cannot write to the bus.
  4. Using PageUI. PageUI controls cannot read but can write to the bus.

Any help much appreciated.

Hi there,

I haven’t tested with the UIs yet, but I noticed, that switches and controls on the item views do not work reliably. The malfunction got worse the more “knx-things” I created (each actuator is represented by a thing, with all required channels added to it).
I have been using OH2.4 for years and did only have negligible problems with OH reading/writing to the KNX-bus via knxd (0.14.8).
I’m certainly not an expert in software development, yet I have a suspicion that there is a connection between a bug in knxd and the way the OH3 KNX-binding reacts to it.

I’m curious if the problem still exists! If not, what was your solution? And what version of knxd have you been using?
If yes, are there any error messages in the syslog (knxd-related)?
Do your knx-things change their state from online to err:bridge at times?

Best regards,
-bernie

Hello,
Have a similar problem with the OH 3.4.0.
knxd is working fine with ETS5 and knx utils with RPi A + (KNX HAT)[KNX Raspberry Pi HAT | Hackaday.io]

The knxd params:

--eibaddr=1.1.12 -E 1.1.1:5 -n RPihat -D -T -R -S -i --layer2=tpuarts:/dev/ttyKNX1

I am able to create both the tunnel and router gateways, but it is impossible to create a working device on either of them: they are both marked as offline and do not send messages to the bus, nor show any living signs:

What could be the reason? I could not see any errors in the OH logs.

Would appreciate any hints!
Chris