[SOLVED] Communication openHAB2 with KNX via Gira USB

Hello together,

i´ve installed yesterday openhabian on my Raps 3. knxd works fine and i can switch on my demo light via knxtool groupswrite ip:localhost 1/2/6.

I´ve installed the knx binding 2.4.0 and after this created the knx.items and the knx.things like described in the documentation.

Unfortunately it doesn’t´t work and i don´t know why :confused:

Always the problem with the USB interface :frowning:

I would be very grateful for a tip.

Thank you.

regards, Christian

Your thing and item looks o.k. (btw. could you paste code in code fences instead of screen shots?)

Probably just a serial port issue. Have you checked your log if knx binding it is complaining while trying to access the serial port? If so:

https://www.openhab.org/docs/administration/serial.html#linux

If the serial port in /dev/ is really /dev/ttyUSB0 then adapt Java command line arguments in your case to include -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0 (where /dev/ttxUSB0 is the serial port).

i´ve changed my config to /dev/ttyAMA0 how described in the binding doc because of i´ve installed openhabian and following your link i´ve nothing to change.

the event Log shows only the switch on and off

2018-12-26 07:33:11.898 [ome.event.ItemCommandEvent] - Item ‘demoSwitch’ received command ON
2018-12-26 07:33:11.906 [nt.ItemStatePredictedEvent] - demoSwitch predicted to become NULL
2018-12-26 07:33:17.073 [ome.event.ItemCommandEvent] - Item ‘demoSwitch’ received command OFF
2018-12-26 07:33:17.083 [nt.ItemStatePredictedEvent] - demoSwitch predicted to become NULL

Bridge knx:serial:bridge [
serialPort="/dev/ttyAMA0",
readingPause=50,
responseTimeout=10,
readRetriesLimit=3,
autoReconnectPeriod=1
] {
Thing device generic [
adress=“1.1.33”,
fetch=true,
pingIntervall=300,
readIntervall=3600
] {
Type switch :demoSwitch “Light” [ ga=“1/2/6” ]
}
}

~ $ dmesg | grep tty
[ 0.000000] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=PARTUUID=4da393dc-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[ 0.000283] console [tty1] enabled
[ 0.745968] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[ 0.746020] console [ttyAMA0] enabled

~ $ usb-devices
T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=135e ProdID=0022 Rev=01.03
S: Manufacturer=Gira Giersiepen GmbH & Co. KG
S: Product=KNX-USB Data Interface
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=50mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=03(HID ) Sub=00 Prot=00 Driver=usbfs

Have you double-checked, that your serial port is really /dev/ttyAMA0 AND is mentioned in the Java command line args?

The binding doc is just an example and has to be adopted to your setup.

Please check you log again while you restart the KNX binding. Does the “bridge” get`s really connected/online via the serial port?

IIRC /dev/ttyAMA0 is the physical UART port of the Rpi (so not a USB serial)

Could you just unplug the Gira USB and then replug and watch you /dev/* to see, if some serial device is created for it?

Wait:

Have you knxd still running? If so, the serial port is hold by the knxd. If you want to go that route, you have to connect to knxd via network (127.0.0.1) instead of configuring the serial bridge.

Or: stop knxd and let the binding connect the serial port.

Hey curlyel,

many many thanks to you. Your last post was the right answer.

I´ve changed the bridge from serial to ip and put in the ip (knxd and rapsi) and my light switched on :slight_smile:

Unfortunately i can´t switch it off again but i´ll hope to fix it also.

best regards, Chris

Glad it helped :wink:
Mind marking that post as solution, so others may find it quicker if running in a similar issue?

@schic I edited your title to start with [Solved]. As @curlyel mentioned, this will also help to identify the topic as solved and help others.:wink:

Thanks

Continuing the discussion from [SOLVED] Communication openHAB2 with KNX via Gira USB:

hello togheter,
sorry, but on my openhabian 2.4, configured with paperUI,
and after i have installed knxd, this setting not working…
you can help me???

You may have to give a little more info. What setting? What does ‘not working’ look like?

Good morning,
sorry … I’ll summarize it.
Raspi pi3B +, openhabian and openhab 2.4 installed.
now I wanted to interface it with the knx system, via my USB stick.
from the config openhabian menu, I install knxd, and modify the file to make it work with usb and not TPUART.
Result:
if I use ETS, everything works but the knx address of raspi is 0.0.1 and not the one I set as --eibaddr.
if I use openHAB 2.4, entering tunnel mode and addressing 127.0.0.1 above, it doesn’t work.
If I use router mode, and default address 224.0.23.12:3761/UDP, the IP gateway becomes online, but if I try to bind with KNX devices it does not find them and I cannot control the system.
Thanks and sorry for the long post.