Configure openHAB to run over USB with KNX

1.4k views Asked by At

I have some problems to establish a connection to my KNX over USB. There is no problem to run the demo-project or even my project.
I have configured my rooms on openHAB but can't get a connection, even if the debug log tells my something other.
My config looks like this:

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

# 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.
knx:type=ROUTER

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

# Local endpoint to specify the multicast interface, no port is used (optional)
#knx: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
#knx:serialPort=

The Debug Log tells me the following:

10:01:06.867 [INFO ] [runtime.busevents             :22   ] - Light_GF_Office received command ON
10:01:06.871 [INFO ] [tuwien.auto.calimero          :51   ] - [qtp29372484-54] link 224.0.23.12:3671: send message to 0/0/6, wait for confirmation
10:01:06.871 [DEBUG] [.b.knx.internal.bus.KNXBinding:163  ] - Received groupWrite Event.
10:01:06.871 [INFO ] [tuwien.auto.calimero          :51   ] - [KNXnet/IP receiver] link 224.0.23.12:3671: indication from 0.0.0
10:01:06.871 [INFO ] [runtime.busevents             :22   ] - Light_GF_Office received command ON
10:01:06.871 [DEBUG] [.b.knx.internal.bus.KNXBinding:138  ] - Wrote value 'ON' to datapoint 'command DP 0/0/6 Light_GF_Office, DPT main 0 id 1.001, low priority'

So there must be an Error in communication with the KNX-Bus. How to configure the openhab.cfg to communicate over my USB-Port.

2

There are 2 answers

0
Stephen Ivory Egg NZ On

I see this question was asked a long time ago but I may be able to contribute to an answer.

You were trying to connect via USB using IP. Routing and Tunnelling are properties of KNXnet/IP and you would need a device working as a KNX IP Router (for Routing or Tunnelling) or KNX IP interface (Tunneling only) to use this protocol - USB doesn't do IP.

Off hand I am not aware of any KNX devices which convert from USB to IP. You can get USB Interfaces (USB <--> KNX), IP Interfaces (IP <--> KNX), and IP Routers (which perform the same function of an IP Interface BUT ALSO enable KNX telegrams to be routed from one Area/Line to another Area/Line in the installation topology using IP (KNX line 1.1.x <--> IP <--> KNX line 1.1.y). IP provides much faster communication than the 9600baud of KNX twisted pair.

These documents may be helpful in understanding about KNXnet/IP:

http://www.knx.org/fileadmin/template/documents/downloads_support_menu/KNX_tutor_seminar_page/tutor_documentation/08_IP%20Communication_E0510a.pdf

http://www.knx.org/fileadmin/downloads/05%20-%20KNX%20Partners/03%20-%20Becoming%20a%20KNX%20Scientific%20Partner/2010-11%20Conference/Presentations/Session%202.pdf

0
ekarak On

You probably need to explicitly define the name of the USB port your KNX interface is connected to, as in:

knx:serialPort=/dev/ttyUSB0

You can find out which port this is by grepping your kernel logs:

dmesg | grep ttyUSB

You should also comment out the ROUTER definition as a USB interface is a direct connection to the bus.