OPENHABIAN RP2 USB KNX issue

Hello everyone,

I have just migarted my PI to OH2 by using the greate “openHABian - Hassle-free openHAB Setup” discription.

Prior to the migartion I have tested everything on a Windows PC to ensure that I don’t bother my wife to much in case I would need a bit more time to get it fly. Anyways, the Setup, migation of the configuration and the homekit (main reason for me to migarte) works wonderfull. In this Setup I have used the OH1 running instatallation as IP Gateway for KNX.

Now I have in stalled my production RSP2 and I everything in the frontend is working as expected, but not the KNX Connections :frowning:
HW Setup: RSP2 + USB to GIRA

As I saw in different discussions I do not need KNXD (EIBD) as OH2 has everything available…

Error Messages in Openhab.log

2018-04-04 23:03:32.141 [ERROR] [nx.internal.connection.KNXConnection] - Error connecting to KNX bus: timeout connecting to control endpoint /192.168.xxx.xxx:3671
2018-04-04 23:03:32.146 [ERROR] [tuwien.auto.calimero ] - KNXnet/IP Tunneling 192.168.178.28:3671: establishing connection failed, timeout connecting to control endpoint /192.168.178.28:3671
2018-04-04 23:03:32.151 [WARN ] [nx.internal.connection.KNXConnection] - Initial connection to KNX bus failed!

So it seems to me, that I have an Issue to connect to the BUS, but out of the Messages.log it seems ok?

Apr 4 22:44:59 openHABianPi kernel: [ 3.330212] usb 1-1.5: Product: KNX-USB Data Interface
Apr 4 22:44:59 openHABianPi kernel: [ 3.337247] usb 1-1.5: Manufacturer: Gira Giersiepen GmbH & Co. KG
Apr 4 22:44:59 openHABianPi kernel: [ 3.353701] hid-generic 0003:135E:0022.0001: hiddev96,hidraw0: USB HID v1.01 Device [Gira Giersiepen GmbH & Co. KG KNX-USB Data Interface] on usb-

My knx.cfg Setup:

> **> # KNX gateway IP address **
> **> # (optional, if serialPort or connection type 'ROUTER' is specified)**
> **> ip=192.168.xxx.xxx**
> **> **
> **> # 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= 15.15.249**
> **> **
> **> # 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=**
> **> **
> **> # 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= TUNNEL**
> **> **
> **> # KNX gateway port (optional, defaults to 3671)**
> **> # Note: If you use eibd, setting to 6720**
> **> port= 3671**
> **> **
> **> # Local endpoint to specify the multicast interface, no port is used (optional)**
> **> localIp=192.168.xxx.xxx**

Do I miss anything due to late hours?

I would be more than gratefull to get a hint…

THX
MisterBop

I have chnaged the knx.cfg now but the openhab.log is not realy changing even after restart?

I have excluded the IP config as I guess that I have used it in OH1 to connect to EIBD. With the Setup of Serial “/dev/ttyUSB0”

Do I need to install EIBD?

BR
MisterBop

  1. that means “Raspberry Pi 2” + “USB KNX Gateway”?
  2. do you use the knx1 binding?

ad 1)
you won’t need another instance running, if your USB-Gateway is connected to the Pi running OH2

ad 1)
your configuration matches KNX1 binding - so are you sure, you’re using KNX1 binding?

Hi,

  1. Raspberry PI 2 + Gira USB Interface which I have connected to the PI via USB. In my old OH1 Installation I have used KNXD and configured OH1 via IP. I had the Impression, that this is not neccessary with OH2 anymore. But it seems I need to go the same route with OH2 as well :frowning:

  2. Yes. I use it and it is working as expected I would say beside that it is not connecting to the BUs :-). I have taken the text base Approach as this is easier for me as an OH1 user. All old Bindings like Astro1 etc are working proper in the frontend

Which Settings for knx.conf for GIRA USB would you recomand. Everything IP based configuration excluded and only the Serial to “/dev/ttyUSB0”?

Or do I have to adjust the pattern “/dev/ttyUSB0 somehow

Many Thanks
MisterBop

ok. I was just a bit confused by your abbreviations! :wink:
please post again your current knx.cfg (of Course you can obfuscate your IP-addresses and stuff…) but please use code fences - that way we can read also information, which was filtered out because of the use of < or >…

Hmm,

It seems that a couple of guys have managed to use the knx binding without an Addition istallation of KNXD…

I guess the config must be to only Setup the Serial port paramter correctly, correct?

My Problem is now, what is the correct one?

So I will comment out all IP related Parameters.

knx.conf


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

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

# 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=/dev/ttyUSB0

# 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

How can I identify on which USB I have attached the GIRA USB via Openhab?

OK. will do.

it appears nearly noone uses KNX-USB-Interfaces… but there’s some who want to use it and they have the same issues you’re facing:
https://community.openhab.org/search?q=knx%20usb

But, to see how your USB is attached to your PI:

dmesg | grep tty

it should list for each recognized USB-device (and console, btw) the name and you should see somehow GIRA or KNX in the messages.

Thanks. I read a lot of them last night already and it seems likly that I will not be able to use OH2 without KNXD. Grr

I will check the command and update the configuration of knx.conf accordingly.

Solved,

I have installed KNXD.

Thx
MisterBop

1 Like

that’s great - could you just write what you did to achieve that? So the other KNX-USB-Interface user can learn from that?

Sure…

  1. I have installed openHABian on my Pi 2 like this
    https://docs.openhab.org/installation/openhabian.html
  2. Before I have started to migrate my OH1 konfig i have installed, configured and tested KNXD like this (German HowTo) but simply follow the command line, but start at KNXD installation http://michlstechblog.info/blog/raspberry-pi-eibknx-ip-gateway-and-router-with-knxd/
  3. As I have a Gira USB Interface I changed the conf file accordingly (please add to the start option -t1023 before -b otherwise it might stop after a short time)
  4. Now took the text based configuration (knx1 as a addon)
  5. Knx.conf can niw connect to localist as Knx IP gateway

Afterwards openHAB is fully working again including HomeKit:slightly_smiling_face:

Only open topic for me is now to include rollsutters to HomeKit config.

BR
MisterBop

1 Like