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

Hi,

in my previous posts EIB/KNX Router with an USB Interface and KNX/EIB Router with a TPUART module I described how to use a Raspberry PI as EIB/KNX Router with eibd.

eibd is no longer in development so I decided to give knxd, a fork of eibd, a try:-) The script attached at the end of the post is written for raspbian but should also work an all debian system with systemd imit system.


This post is based on my previous posts regarding eibd. The script at the end of the post installs knxd with support for EIB/KNX Router with TPUART and for USB EIB/KNX interfaces. This is the first shot if you got any errors feel free to report it by a comment.

First of all install raspbian in the well known way and update to the latest version of firmware and operating system

pi@raspberry~: $ sudo su -
root@raspberry:~# apt-get update && apt-get upgrade
root@raspberry:~# rpi-update
root@raspberry:~# reboot

Hint for Raspberry Pi 3 User (Comment from Adrian): It is import to enable the serial device within raspi-config. The serial port must be set to ttyS0 not ttyAMA0 on RPI3 at the latest raspbian release.

login as root and configure a static IP Address. To get a root, login as user pi and call sudo

pi@raspberry~: $ sudo su -
root@raspberry:~#

Create new file /etc/systemd/network/eth0.network Name is not importend, just the suffix/extension network.

[Match]
# You can also use wildcards. Maybe you want enable dhcp
# an all eth* NICs
Name=eth0
[Network]
#DHCP=v4
# static IP
# 192.168.100.2 netmask 255.255.255.0
Address=192.168.100.2/24
Gateway=192.168.100.1
DNS=192.168.100.1
# Route for Multicast Address EIB/KNX
[Route]
Destination=224.0.23.12/32

Disable the old way to configure the network, enable systemd based network configuration, enable systemd generated resolve.conf (DNS resolution) and disable dhcpcd.

root@raspberry:~# mv /etc/network/interfaces /etc/network/interfaces.save
root@raspberry:~# systemctl enable systemd-networkd.service
root@raspberry:~# systemctl enable systemd-resolved.service
root@raspberry:~# systemctl start systemd-resolved.service
root@raspberry:~# systemctl disable dhcpcd.service
root@raspberry:~# systemctl enable systemd-networkd-wait-online.service

Set an link from the system wide resolve.conf to systemd

root@raspberry:~# mv /etc/resolv.conf /etc/resolv.conf.save
root@raspberry:~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Reboot to get the config active

root@raspberry:~# reboot

Make sure an internet connection is available

root@raspberry~: $  ping -c 2 www.heise.de
PING www.heise.de (193.99.144.85) 56(84) bytes of data
64 bytes from 193.99.144.85: icmp_req=1 ttl=128 time=8.551 ms
64 bytes from 193.99.144.85: icmp_req=2 ttl=128 time=9.680 ms

--- 193.99.144.85 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 0.551/0.615/0.680/0.069 ms

Time to start installing knxd. The script must be run as root because some files are copied and modified in locations where only root have the appropriate permissions. Access to /dev/ttyAMA0 is just requiered if you want to use TPUART or a FT1.2 (BCU2) backend.

What the script does:

  • Check for root permissions
  • Download and compile pthsem
  • Download knxd sources from github
  • installing knxd binaries to /usr/local/bin
  • create a systemd service knxd
  • Add a user and group knxd with group membership dialout (to access serial device /dev/ttyAMA0)
  • Add user pi to knxd group
  • Disable bootmessages on serial interface /dev/ttyAMA0
  • Disable console on serial interface /dev/ttyAMA0
  • Define udev rules to accessing the KNX USB Device at a low level layer by group knxd. I have added all interfaces for which I found a USB Vendor- and ProductID. Maybe your device is not in the list, then you have to add this manually to file /etc/udev/rules.d/90-knxusb-devices.rules. Determine the ID by lsusb.
  • On Raspberry Pi 3 it disable the bluetooth module because its uses ttyAMA0 by default

For the following devices a udev rule is installed (Source KNX User Forum).

KNX USB Interface Vendor ID Product ID
Siemens KNX/EIB-USB Interface (Flush mounted) 0e77 0111
Siemens KNX/EIB-USB Interface (DIN rail) 0e77 0112
Siemens OCI700 Service Interface 0681 0014
Merlin Gerin KNX-USB Interface (Flush mounted) 0e77 0141
Hensel KNX-USB Interface (Rail mounted) 0e77 0121
Busch-Jaeger KNX-USB Interface (Flush mounted) 145C 1330
Busch-Jaeger KNX-USB Interface (surface mounted) 145C 1490
ABB STOTZ-KONTAKT KNX-USB Interface (MDRC) 147B 5120
Feller KNX-USB Data Interface 135E 0026
JUNG KNX-USB Data Interface 135E 0023
Gira KNX-USB Data Interface 135E 0022
Berker KNX-USB Data Interface 135E 0021
Insta KNX-USB Data Interface 135E 0020
Weinzierl KNX-USB Interface (Flush mounted) 0e77 0102
Weinzierl KNX-USB Interface (RS232) 0e77 0103
Weinzierl KNX-USB Interface (Rail mounted) 0e77 0104
Tapko USB Interface 16D0 0490
Hager KNX-USB Data Interface 135E 0025
Preussen Automation USB2KNX 16D0 0492
Merten KNX-USB Data Interface 135E 0024
b+b EIBWeiche USB 04cc 0301
MDT KNX_USB_Interface 16D0 0491

If there are further more, please let me know and I will integrate them to script.

On a Raspberry Pi 3 it is strongly recommended to update to the latest Kernel to addressing some issues with the serial device ttyAMA0

pi@raspberry~: $ sudo su
root@raspberry~: # rpi-update
root@raspberry~: # reboot

Start a root shell, get the script.

pi@raspberry~: $ sudo su
root@raspberry~: #
root@raspberry~: # wget http://michlstechblog.info/blog/download/electronic/install_knxd_systemd.sh

The highlighted eibd features are enabled. Alter the script if you need additional features.
–enable-ft12 enable FT1.2 backend
–enable-pei16 enable BCU1 kernel driver backend
–enable-pei16s enable BCU1 user driver backend (very experimental)
–enable-tpuarts enable TPUART user driver backend
–enable-eibnetip enable EIBnet/IP routing backend
–enable-eibnetiptunnel enable EIBnet/IP tunneling backend
–enable-usb enable USB backend
–enable-eibnetipserver enable EIBnet/IP server frontend
–enable-groupcache enable Group Cache (default: yes)
–enable-java build java client library

Start the script. This should be run about 20 minutes. Do not execute update-rc.d on debian jessie.

root@raspberry~: # chmod +x ./install_knxd_systemd.sh
root@raspberry~: # ./install_knxd_systemd.sh

After the script has finished. knxd, findknxusb, knxtool, findknxusb and some other tools should be installed at /usr/local/bin, the systemd service script for knxd in /lib/systemd/system/knxd.service and the link to start knxd at boottime /etc/systemd/system/multi-user.target.wants/knxd.service must exists..

root@raspberry~: # ls -l /usr/local/bin
.....
-rwxr-xr-x 1 root staff 839016 Jun 13 22:14 knxd
-rwxr-xr-x 1 root staff   7584 Jun 13 22:14 findknxusb
....
root@raspberry~: # ls -l /etc/systemd/system/multi-user.target.wants/knxd.service
lrwxrwxrwx 1 root root 14 Jun 13 22:15 ...  -> /lib/systemd/system/knxd.service

Reboot your device

If you want to disable the graphic desktop and just want to boot into the text console change the default target

root@raspberry~: # systemctl set-default -f multi-user.target

After installing you have to decide which interfaces you want to use(Default TPUARTS at /dev/ttyAMA0). With this configuration knxd must come up after a reboot because knxd could check if a TPUART module is present.

root@raspberry~: # ps ax|grep knxd
 416 ?        Ss     0:00 /usr/local/bin/knxd -p /run/knxd/knxd.pid --eibaddr=1.1.128 -d -D -T -R -S -i --listen-local=/tmp/knx tpuarts:/dev/ttyAMA0

If you want use a USB Interfacces open /etc/default/knxd and comment the TPUART line and remove the comment # character at the begin of the USB definition.

# Command line parameters for knxd. TPUART Backend
# Serial device Raspberry
# KNXD_OPTIONS="--eibaddr=1.1.128 --client-addrs=1.1.129:8 -d -D -T -R -S -i --listen-local=/tmp/knx -b tpuart:/dev/ttyAMA0"
# Serial device PC
# KNXD_OPTIONS="--eibaddr=1.1.128 --client-addrs=1.1.129:8 -d -D -T -R -S -i --listen-local=/tmp/knx -b tpuart:/dev/ttyS0"
# Tunnel Backend
# KNXD_OPTIONS="--eibaddr=1.1.128 --client-addrs=1.1.129:8 -d -D -T -R -S -i --listen-local=/tmp/knx -b ipt:192.168.56.1"
# USB Backend
KNXD_OPTIONS="--eibaddr=1.1.128 --client-addrs=1.1.129:8 -d -D -T -R -S -i --listen-local=/tmp/knx -b usb:"

Since knxd Version 0.14 it is no longer necessary to specify the USB Device ID. knxd recognize possible devices at startup. Nevertheless when knxd is not running, you can look if a USB devices were found by using findknxusb.

The following knxd options are predefined at /etc/default/knxd

  • EIB Busaddress of the daemon 1.1.128
  • A range of EIB Busaddresses which were assigned to clients(e.q. ETS ..) connected to knxd. 1.1.129:8 means a range of 8 client addresses from 1.1.129 to 1.1.136
  • EIBnet/IP server
  • EIBnet/IP Routing
  • EIBnet/IP Tunneling
  • Answer discovery and description requests
  • Listen on UNIX domain socket /tmp/knx
  • Listen on TCP port, default 6720

Check if you see EIB packets on wire.

pi@raspberry~: # knxtool vbusmonitor1 ip:localhost
LPDU: BC 11 17 00 03 C1 00 81 06 :L_Data low from 1.1.23 to 0/0/3 hops: 04 T_DATA_XXX_REQ A_GroupValue_Write (small) 01 LPDU: CC :ACK
LPDU: BC 11 17 00 03 81 00 81 46 :L_Data low from 1.1.23 to 0/0/3 hops: 00 T_DATA_XXX_REQ A_GroupValue_Write (small) 01 LPDU: CC :ACK

Thats it. Comments are welcome!

Michael

Troubleshooting notes: When knxd does not start as system service/daemon start it in foreground with trace enabled to see whats happend:

Switch to user knxd

sudo su knxd -s /bin/bash

Then get your knxd options from /etc/default/knxd (for example –eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuart:/dev/ttyAMA0) , remove the -d switch, add the trace switches and start it

knxd -t 1023 --eibaddr=1.1.128 --client-addrs=1.1.129:8 -D -T -R -S -i --listen-local=/tmp/knx -t 1023 -b tpuart:/dev/ttyAMA0

If you have trouble to get knxd running you can also try the calimero server. I have written a script (first release expermimental) which do all tasks to install them.

Script to compile and install knxd on debian jessie/buster
install_knxd_systemd.sh
Version: 0.7.19

Script to compile and install knxd on debian jessie. Also available on github https://github.com/Race666/install-knxd

Author:Michael Albert
Category:Electronic
Date:April 20, 2020
14.7 KiB
16881 Downloads
Details...

556 thoughts on “Raspberry Pi: EIB/KNX IP Gateway and Router with knxd”

  1. Hi, Thanks for the info
    I have a problem when I run the scrip “chmod + x ./install_knxd_systemd.sh” and “./install_knxd_systemd.sh”
    nothing appears on the console.
    I am using a RPi2 and raspbian jessie

    Thank you so much!!

      1. Hello, Thanks for your help
        This is what he writes
        root@raspberrypi:~# chmod +x ./install_knxd_systemd.sh
        root@raspberrypi:~# ls -l
        total 12
        -rwxr-xr-x 1 root root 9886 Jul 14 06:53 install_knxd_systemd.sh
        root@raspberrypi:~# ./install_knxd_systemd.sh
        root@raspberrypi:~# ls -l
        total 12
        -rwxr-xr-x 1 root root 9886 Jul 14 06:53 install_knxd_systemd.sh
        root@raspberrypi:~#

  2. hey thanks for that great script. everything runs fine the knxd deamon is running on my side but when i try to see packets on the bus i cant see anything. i did a clean install on a Raspberry 2 with Jessie. I am an absolute Linux Noob and it took me nearly 2 nights to come to this point.
    I am using an ABB USB/S 1.1 KNX Interface changed the /etc/default/knxd to the USB option. and did everything as described. do i have to set parameters for the USB Interface from ETS Side ? or is something wrong with the route ip [Route]
    Destination=224.0.23.12/32
    i set everthing there like you described for static IP configuration accept for the IP an DNS Gateway. mine is 192.168.1.100 and gateway at 192.168.1.1

    this is what i get with the command you described

    pi@raspberrypi:~ $ ps ax|grep knxd
    414 ? Ss 0:00 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx usb:%DEVICEID%
    473 pts/0 S+ 0:00 grep –color=auto knxd
    pi@raspberrypi:~ $ knxtool vbusmonitor1 ip:localhost

    and then nothing 🙁

    do you have an idea what i can check to confirm service is running in htop it looks like everything is running fine htop is listing the knxd service.

    1. this is what eth0.network config looks like

      pi@raspberrypi:~ $ ip addr show
      1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
      2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
      link/ether b8:27:eb:82:fb:77 brd ff:ff:ff:ff:ff:ff
      inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0
      valid_lft forever preferred_lft forever
      inet6 fe80::ba27:ebff:fe82:fb77/64 scope link
      valid_lft forever preferred_lft forever

    2. Hi Philipp,

      pi@raspberrypi:~ $ ps ax|grep knxd
      414 ? Ss 0:00 /usr/local/bin/knxd -p /run/knxd/knxd.pid -eibaddr=1.1.128 -d -D -T -R -S -i -listen-local=/tmp/knx usb:%DEVICEID%
      473 pts/0 S+ 0:00 grep -color=auto knxd

      There is something wrong. %DEVICEID% as command line parameter is wrong. /usr/local/bin/knxd-findusb.sh must set the Device ID of your USB device in /etc/default/knxd .

      Can you execute

      /usr/local/bin/knxd-findusb.sh

      to see what’s happend. Whats the content of /etc/default/knxd

      cat /etc/default/knxd

      Michael

      1. Thanks for your fast reply. Yes this is what i was figuring out within the last few hours. I ran the findusb.sh and found the correct type of usb interface i am using abb. I did nothing just rebooted a few times checked knxd pid status and there it was i checked a groupwrite and the interface was blinking and the lamp turned on. Somehow i still get no response from vbusmonitor1 but some of the other busmonitor tools are working and i can check the traffic of the bus. awesome work dude !!!!

        All this is still blackmagic to me ^^ but now i connected the knxd service to fhem and can toggle the whole knx system through my ipad now. again thanks a lot for all your work realy appreciate this.

        Ah one point just to give some feedback from a linux noob point of view. Somehow your advice

        Create new file /etc/systemd/network/eth0.network. Name is not importend, just the prefix network.

        Confused me a lot and took me a whole night to figure out. I just didnt realize that you realy did a dot at the end of a sentence. I read it like i must call the file eth0.network.config or something else. The second sentence about the prefix network with again a dot at the end just confused everything for me. I think this is no prefix its an extension isnt it ? Maybe you can set this in ” ” to make everythin absolutly noob proof. But it was also the first time i was setting up a static ip on an linux system. I think everything i did the last two days was for the first time. But i learned a lot thx again. Have a nice day.

  3. Hi Michael, thanks a lot for your excelent work. I got yesterday my raspi3 and now knxd is running:-)
    Just a comment (maybe improvement). I have a USB interface, which wasn’t found by /usr/local/bin/knxd-findusb.sh (the grep didn’t work). I did the steps in your script manually and the USBID was found.
    Just change your grep to
    grep -e “^\s*KNXD_OPTIONS\=.*usb\:” /etc/default/knxd
    dont escape ^ like you did \^.

    As the device could change, e.g. when you change the USB connector, than the originally found USB device will be the wrong, but is hardcoded in /etc/defaults/knxd.
    Wouldn’t it be better to export the $USBID and just leave the variable in etc/defaults/knxd. Like this
    export USBID=$(/usr/local/bin/findknxusb | grep device: | cut -d’ ‘ -f2)

    KNXD_OPTIONS=”–eibaddr=0.1.254 -d -D -T -R -S -i –listen-local=/tmp/knx usb:$USBID”

    . /etc/defaults/knxd ; echo $KNXD_OPTIONS

    Than, the USBID can change and despite of the start script get the right ID.

    Unfortunately the knxd.service didn’t work as well. Don’t know why.
    A manually start of
    knxd –eibaddr=0.1.254 -d -D -T -R -S -i –listen-local=/tmp/knx usb:1:5:1:0:0 -p /run/knxd/knxd.pid
    works.

    1. Hi Michael,

      thank you. I fixed the bug with grep. You’re right. Just $ and ` have to escape by creating files with “cat”.

      “export USBID=$(/usr/local/bin/findknxusb | grep device: | cut -d’ ‘ -f2)

      KNXD_OPTIONS=”–eibaddr=0.1.254 -d -D -T -R -S -i –listen-local=/tmp/knx usb:$USBID”

      . /etc/defaults/knxd ; echo $KNXD_OPTIONS

      Then, the USBID can change and despite of the start script get the right ID.” => This is also a possibility. The USB device id is not hardcoded at /etc/default/knxd. In the knxd systemd service file findknxusb is called at each the service unit starts and should update /etc/default/knxd with the new USB Address.

      The problem on plugging the usb interface is that knxd have to restart each time you do such an action, because the Address is a command line parameter and could not changed for a running daemon. :-). An approach is to add a udevd rule on inserting a device. For example, if you owned a GIRA Interface add this line to /etc/udev/rules.d/90-knxusb-devices.rules

      SUBSYSTEM==”usb”, ATTR{idVendor}==”135e”, ATTR{idProduct}==”0022″, ACTION==”add”, RUN+=”systemctl restart knxd.service”

      But not 100% sure if this will work. I can’t test it because I have no USB device.

      Michael

      1. Hi Michael,
        >The USB device id is not hardcoded at /etc/default/knxd. In the knxd systemd service file findknxusb is called at each the service unit starts and should update /etc/default/knxd with the new USB Address.

        As far as I understand your script, it runs on every restart, that’s right. But the substitution in /etc/defaults/knxd can just take place once, as than the $USBID variable disapperes after the first start and your substitution wouldn’t find that string. In place of $USBID is now a different string.
        That’s why I made the above mentioned suggestion. The $USBID must be dynamic.

        At the moment I have no chance to look at your script (as I’m at work), so finally I could be wrong.

        Michael

        1. Hi Michael,

          substitution (should) is also done at every time the script runs:

          sed -e”s/usb:.*\$/usb:$USBID\”/”

          sed looks for the string “usb:Any Characters till end of line” and replaces them with usb:$USBID

          If not you found another bug 😉

          Michael

          1. No, I think you are right and I was wrong. Everything is fine then 🙂
            Thanks a lot for your excellent work!

  4. Hi Michael,
    I wonder if you could help me debug an issue I’m having. I have installed openhab with a KNX binding and your excellent knxd service on Raspberry Pi. I can connect to the knxd router from ETS4 and monitor KNX telegrams on the Pi using vbusmonitor1. However when trying to change a group address setting to turn off a light via Openhab it just doesn’t work. Everything in the logs looks ok, and I believe the configuration is correct for Openhab – I have tried various different combinations.
    Please see log snippet from openhab
    00:06:02.282 [DEBUG] [.KNXBindingDatapointReaderTask:58 ] – Autorefresh: Waiting for new item in reader queue
    00:06:02.289 [DEBUG] [b.k.i.connection.KNXConnection:296 ] – KNXBinding configuration present. Setting up KNX bus connection.
    00:06:02.295 [DEBUG] [b.k.i.connection.KNXConnection:408 ] – Not connected yet. Trying to connect.
    00:06:02.388 [INFO ] [b.k.i.connection.KNXConnection:212 ] – Established connection to KNX bus on 224.0.23.12:6720 in mode ROUTER.
    00:06:02.407 [DEBUG] [b.k.i.connection.KNXConnection:419 ] – Success: connected.
    00:06:17.520 [DEBUG] [.b.knx.internal.bus.KNXBinding:138 ] – Wrote value ‘ON’ to datapoint ‘command DP 2/0/0 light, DPT main 0 id 1.001, low pri ority’
    00:06:17.524 [DEBUG] [.b.knx.internal.bus.KNXBinding:169 ] – Received groupWrite Event.
    00:06:21.876 [DEBUG] [.b.knx.internal.bus.KNXBinding:138 ] – Wrote value ‘OFF’ to datapoint ‘command DP 2/0/0 light, DPT main 0 id 1.001, low pr iority’
    00:06:21.876 [DEBUG] [.b.knx.internal.bus.KNXBinding:169 ] – Received groupWrite Event.
    00:06:23.394 [DEBUG] [.b.knx.internal.bus.KNXBinding:169 ] – Received groupWrite Event.
    00:06:23.395 [DEBUG] [.b.knx.internal.bus.KNXBinding:138 ] – Wrote value ‘ON’ to datapoint ‘command DP 2/0/0 light, DPT main 0 id 1.001, low pri ority’
    00:06:25.157 [DEBUG] [.b.knx.internal.bus.KNXBinding:138 ] – Wrote value ‘OFF’ to datapoint ‘command DP 2/0/0 light, DPT main 0 id 1.001, low pr iority’
    00:06:25.157 [DEBUG] [.b.knx.internal.bus.KNXBinding:169 ] – Received groupWrite Event.
    00:06:26.310 [DEBUG] [.b.knx.internal.bus.KNXBinding:138 ] – Wrote value ‘ON’ to datapoint ‘command DP 2/0/0 light, DPT main 0 id 1.001, low pri ority’

    Very much hope you can help.
    Thanks – Colin

  5. Hi Michael,

    thanks for the great job! It works perfect for me and I learnt a lot.

    However, it looks like that the wireless network adapter on the Pi3 is now being deactivated and I wonder what needs to be done to get the wlan up and running again under systemd. I already spent some hours trying to find a solution but without any success.

    Can you please give some advice to a newbie?

    Best regards
    Joachim

  6. I’m running into some issues (two to be precise) as well.

    1) Knxd service is not starting (see: goo.gl/oZmxDt)
    /etc/systemd/system/multi-user.target.wants/knxd.service is there and configured as mentioned in your article. My initial idea is that there’s something wrong with the KNXD_OPTIONS environment variable, as I am able to get the knxd started by specifying the options manually and calling for instance “/usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx tpuarts:/dev/ttyAMA0” via the console. Also if I do “export KNXD_OPTIONS –eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx tpuarts:/dev/ttyAMA0” and then call “/usr/local/bin/knxd -p /run/knxd/knxd.pid ${KNXD_OPTIONS}” through console, the knxd is starting so… Any thoughts / troubleshooting tips to pinpoint what’s happening here? “systemctl status knxd” isn’t really providing much more information other than the generic ERROR: 1/FAILED knxd not being able to start.

    2) Using knxd as an interface in ETS5
    Issue 1 aside, starting knxd manually *briefly* shows the knxd interface under discovered interfaces in ETS5 (along with Qualcomm Atheros? I think it’s the wireless network card of my laptop? weird). However selecting knxd as my interface and clicking the “Test” button results in “The interface is not reachable” (see: goo.gl/emKTDd). What is weird to me as well is that when I kill and restart knxd, the device becomes discoverable again but under a different port number (see: goo.gl/F6mDTg). Adding the interface manually under “Configured Interfaces” by providing the same details and default port 6720 doesn’t help.

    The only thing that I recall now is that I’ve set up the static IP on my raspberry pi as described in your initial article (the eibd one):

    auto eth0
    iface eth0 inet static
    address 192.168.1.31
    netmask 255.255.255.0
    gateway 192.168.1.1
    post-up route add -net 224.0.23.12 netmask 255.255.255.255 eth0
    pre-down route del -net 224.0.23.12 netmask 255.255.255.255 eth0

    It has been working flawlessly for connecting remotely to the pi through Putty. I’ll try the approach as described in the knxd article when I get back home and report back. In the meantime if you have any other suggestions / troubleshooting tips, I would be glad to hear them!

    1. Hi Nick,

      first of all please configure a static ip over systemd. What kind of Raspberry Pi are you using and how much LAN Adapters are configured?

      Can you post the content of /etc/default/knxd please.

      Your PC is in the same network/IP Range? What is the IP Address of your PC?

      What happens you try to start knxd manually

      sudo systemctl start knxd

      sudo journalctl -xn -u knxd

      Michael

  7. Hello Michael,
    I’m getting a little desperate overhere. I was using KNXD for a couple of months on my RPI3 until my USB Bus Coupler Died. I thought the easiest way is to buy the exact same bus coupler. I’m using a Hager TH101. In the beginning I was not using your script to install KNXD and it worked perfectly just compiling KNXD and PTHSEM myself. Tonight I noticed that the only thing that does work with the new buscoupler is the busmonitor. not the vbusmonitor that connects to the routermode. When I noticed this I gave it another shot and installed KNXD the way you describe above. Since my RPI3 started updating and upgrading I was a bit hopeful but after starting al services I have the exact same problem.

    When I perform knxtool busmonitor1 ip:localhost I can see my telegrams.

    When I try knxtool vbusmonitor1 ip:localhost I see nothing ..

    All settings are exactly as you described above. Do you have any clue how I can debug such issue?

    Kind regards,
    Stijn

    1. Did you solved the Problem i think i ran into the same Situation here.
      Can see Telegrams in Busmonitor but not in vbusmonitor anymore.

      I can connect via ETS. but do not see Telegrams from Lightswitches. only when i do a ETS Groupswrite or KNXD Groupswrite i am able to see those via vbusmonitor.

      1. I have a board that use a NCN5130 chip from ON Semiconductor and i think that work in SPI mode, would this work with the raspberrypi’SPI interface? and how to set up.Thanks a lot.

        Kind regards,
        Adrian

        1. Hello Adrian,

          a NCN5120 is supported by knxd:
          –enable-eibnetiptunnel enable EIBnet/IP tunneling backend
          –enable-usb enable USB backend
          –enable-ncn5120 enable NCN5120 backend
          –enable-eibnetipserver enable EIBnet/IP server frontend
          –enable-groupcache enable Group Cache (default: yes)

          maybe it works also with a NCN5130. If want to test it you must change my script and add a line to enable the NCN5120 backend. like this:

          –enable-eibnetipserver \
          –enable-groupcache \
          –enable-usb \
          –enable-ncn5120 \
          ….
          to the configure section at line 84.

          I have taken a look at the knxd source code:
          NCN5120SerialLayer2Driver::NCN5120SerialLayer2Driver (const char *dev,
          L2options *opt, Layer3 * l3)
          : Layer2::Layer2(l3, opt)
          {

          I think SPI wouldn’t work but NCN5120 and 5130 also speaks UART so you have to connect it to the serial interface of the raspberry.

          To enable the backend set
          KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx ncn5120:/dev/ttyAMA0″
          in
          /etc/default/knxd

          Michael

          1. Hi Michael:
            Thans for your help,i tested so many times folow your guide,that work with USB interface is well.but one issue is that always got a random port(the default IP Tunneling port 3671)and when I use ETS to select this Raspberrypi IP Router .the Raspberrypi IP Router is gone from the ETS’s “Discovered Interface”list and I only can use the computer’s network adapter with 224.0.23.12 to connect to the bus.

            work with the tpuarts
            I cant got any telegram from the KNX BUS,i have tested when I use a USB to TTL
            cable connect to NCN5120’uart side ,there a lot of date from the NCN5120 to the Serial Port Utility but from the raspberrypi’s side is got nothing. I’m use a raspberrypi 3B with 2016-09-23-raspbian-jessie-lite

            Regards
            Adrian

          2. Hi Adrian,

            what do mean exactly with “always got a random port(the default IP Tunneling port 3671)and when I use ETS”. Which port do you mean? The port knxd listens to?

            A NCN5120 is not a tpuart but knxd supports that chip. I have altered the script to Version 0.6.3 and added the support for the ncn5120 backend. So have to recompile the knxd by downloading and executing the script again.

            In /etc/default/knxd you have to set

            KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx ncn5120:/dev/ttyAMA0

            Michael

          3. for example:192.168.100.2:3671 for IP tunneling connect with ETS,but it got a random port like;192.168.100.2:36766 or else.

            I have seted
            KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx ncn5120:/dev/ttyAMA0″
            is that format correct? tow —

            Adrian

          4. Hi Adrian,

            192.168.100.2 is the ip address where your knxd is running?

            NXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx ncn5120:/dev/ttyAMA0″ yes IMOO

            Michael

          5. Hi Michael:
            actually this my setting:
            [Match]
            # You can also use wildcards. Maybe you want enable dhcp
            # an all eth* NICs
            Name=eth0
            [Network]
            #DHCP=v4
            # static IP
            # 192.168.1.1 netmask 255.255.255.0
            Address=192.168.1.198/24
            Gateway=192.168.1.1
            DNS=192.168.1.1
            # Route for Multicast Address EIB/KNX
            [Route]
            Destination=224.0.23.12/32

            when I run ps ax|grep knxd got this;
            476 pts/0 S+ 0:00 grep –color=auto knxd

            Adrian

          6. Hi Adrian,

            192.168.100.2 is the IP Address of the box where ETS is running? Then the random port makes sence. Because outgoing connections usually uses random ports (source port). The import thing is the destination port in your environment 192.168.1.198:3671.

            To check the ports to which knxd is listen to

            root@debdev:~# netstat -pln|grep knxd
            tcp        0      0 0.0.0.0:6720            0.0.0.0:*               LISTEN      1587/knxd
            udp        0      0 0.0.0.0:3671            0.0.0.0:*                           1587/knxd
            

            But it seems your knxd isn’t running:
            ps ax|grep knxd got this;
            476 pts/0 S+ 0:00 grep –color=auto knxd
            because only the grep process is listed.

            What is the output of

            journalctl -xu knxd.service
            

            Michael

          7. HI Michael;
            knxd is listen to:
            root@raspberrypi:/home/pi# netstat -pln|grep knxd
            tcp 0 0 0.0.0.0:6720 0.0.0.0:* LISTEN 448/knxd
            udp 0 0 0.0.0.0:41315 0.0.0.0:* 448/knxd
            udp 0 0 0.0.0.0:3671 0.0.0.0:* 448/knxd
            unix 2 [ ACC ] STREAM LISTENING 8857 448/knxd / tmp/knx

            That is the output of:
            root@raspberrypi:/home/pi# journalctl -xu knxd.service
            — Logs begin at Thu TIME UTC, end at Thu TIME UTC
            TIME raspberrypi systemd[1]: Starting KNX Daemon…
            — Subject: Unit knxd.service has begun with start-up
            — Defined-By: systemd
            — Support:

            — Unit knxd.service has begun starting up.
            TIME raspberrypi systemd[1]: Started KNX Daemon.
            — Subject: Unit knxd.service has finished start-up
            — Defined-By: systemd
            — Support:

            — Unit knxd.service has finished starting up.

            — The start-up result is done.
            lines 1-15/15 (END)
            — Logs begin at Thu TIME UTC, end at Thu TIME UTC. —
            TIME raspberrypi systemd[1]: Starting KNX Daemon…
            — Subject: Unit knxd.service has begun with start-up
            — Defined-By: systemd
            — Support: //lists.freedesktop.org/mailman/listinfo/systemd-devel

            — Unit knxd.service has begun starting up.
            TIME raspberrypi systemd[1]: Started KNX Daemon.
            — Subject: Unit knxd.service has finished start-up
            — Defined-By: systemd
            — Support:lists.freedesktop.org/mailman/listinfo/systemd-devel

            — Unit knxd.service has finished starting up.

            — The start-up result is done.

          8. Hi Adrian,

            ok, it looks good 🙂 Aleady recompilied with the ncn5120 backend? And whats happend now? Connection possible?

            Michael

          9. HI Michael:
            sorry,those rebort above is running in tpuarts mode!

            This is running in ncn5120 mode:

            pi@raspberrypi:~ $ ps ax|grep knxd
            476 pts/0 S+ 0:00 grep –color=auto knxd

            root@raspberrypi:/home/pi# netstat -pln|grep knxd
            root@raspberrypi:/home/pi# (got nothing)

            root@raspberrypi:/home/pi# journalctl -xu knxd.service
            — Logs begin at Thu TIME UTC, end at Thu TIME UTC. —
            Dec TIME raspberrypi systemd[1]: Starting KNX Daemon…
            — Subject: Unit knxd.service has begun with start-up
            — Defined-By: systemd
            — Support:

            — Unit knxd.service has begun starting up.
            Dec TIME raspberrypi knxd[439]: url not supported: No such file or directory
            Dec TIME raspberrypi systemd[1]: knxd.service: control process exited, code=exited status=1
            Dec TIME raspberrypi systemd[1]: Failed to start KNX Daemon.
            — Subject: Unit knxd.service has failed
            — Defined-By: systemd
            — Support:

            — Unit knxd.service has failed.

            — The result is failed.
            Dec TIME raspberrypi systemd[1]: Unit knxd.service entered failed state.

            Adrian

          10. Hi Adrian,

            have you specified the correct serial device?

            url not supported: No such file or directory

            it seems knxd could not find the serial device. How your KNXD_OPTIONS option variable looks like?

            Michael

          11. Hi Michael”
            this my configuration:
            KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx ncn5120:/dev/ttyAMA0″

            by the way,the raspberrypi’s’serial work in which mode,8bit or 9bit?

          12. Hi Adrian,

            you are using an Raspberry Pi 3. Right? There are Raspberry Pi3 Serial devices regarding the serial interface since Pi2. By default the “real” serial device is used by the bluetooth module => install_knxd_systemd.sh changes this. There is also a second serial device, called miniUART, but this cannot be used for knxd. I think the name is also changed to /dev/serial0. Check the name of the device:

            dmesg|grep tty
            dmesg|grep serial

            Michael

          13. Hi Michael
            Finally I got this worked,a big step:)for me! more details :
            i have updated image to the 2016-11-25-raspbian-jessie-lite and reinstall the Script 0.63. a little tips for the newbee like me.
            two need to be done before you install the script .
            1.enable the serial in the raspi-config and the serial port must be set to ttyS0 not ttyAMA0 on RPI3 with the latest raspbine.
            2.install rpi-update before use it:(
            a little trouble with my board that only can received date from the BUS can’t send,late I fix it I will give it a completely test.
            thank a lot for your patience to answer me and the great work!

            Best regards

            Adrian

        2. HI Michael:
          This is report with :
          root@raspberrypi:/home/pi# dmesg|grep tty
          [ 0.000000] Kernel command line: 8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm 2709.boardrev=0xa02082 bcm2709.serial=0x30944112 smsc95xx.macaddr=B8:27:EB:94:41:12 bcm2708_fb.fbswap=1 bcm2709.uart_clock =48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 enable_uart=1 dtoverlay=pi3-disable- bt console=tty1 console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
          [ 0.001357] console [tty1] enabled
          [ 0.282638] console [ttyS0] disabled
          [ 0.285078] 3f215040.uart: ttyS0 at MMIO 0x3f215040 (irq = 59, base_baud = 31250000) is a 16550
          [ 1.024337] console [ttyS0] enabled
          [ 2.941084] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
          [ 4.055001] systemd[1]: Expecting device dev-ttyS0.device…
          [ 4.748102] systemd[1]: Starting system-getty.slice.
          [ 4.755856] systemd[1]: Created slice system-getty.slice.
          [ 4.763641] systemd[1]: Starting system-serial\x2dgetty.slice.
          [ 4.772323] systemd[1]: Created slice system-serial\x2dgetty.slice.

          and :
          root@raspberrypi:/home/pi# dmesg|grep serial
          [ 0.000000] Kernel command line: 8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm 2709.boardrev=0xa02082 bcm2709.serial=0x30944112 smsc95xx.macaddr=B8:27:EB:94:41:12 bcm2708_fb.fbswap=1 bcm2709.uart_clock =48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 enable_uart=1 dtoverlay=pi3-disable- bt console=tty1 console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
          [ 4.763641] systemd[1]: Starting system-serial\x2dgetty.slice.
          [ 4.772323] systemd[1]: Created slice system-serial\x2dgetty.slice.

          1. Hi Adrian

            /dev/ttyAMA0 is the right one. Please check /etc/default/knxd, reboot and check if knxd is starting.

            Michael

  8. Hi Michael,

    great site and want to thank you for your work. Very nice your´re sharing this. Unfortunately I am stuck. I tried a lot the last 10 hours but can´t connect to the knx bus.
    I have a raspi b, the siemens AB12 buscoupler and ADUM1201ARZ. I installed Jessie lite,
    followed exactly your instructions and to be sure, twice (clean install). No error was shown while install. I can see the process but after calling “knxtool vbusmonitor1 ip:localhost” ist happens nothing. I tried to enable logging but the file remains zero byte.

    Sylog says:
    /var/log/syslog:Nov 26 21:04:41 raspberrypi knxd[417]: Layer 0(01A462B0,5839F8E9) Open
    /var/log/syslog:Nov 26 21:04:41 raspberrypi knxd[417]: Layer 0(01A462B0,5839F8E9) Openend
    /var/log/syslog:Nov 26 21:04:41 raspberrypi knxd[417]: Layer 0(01A56C50,5839F8E9) Open
    /var/log/syslog:Nov 26 21:04:41 raspberrypi knxd[417]: Layer 0(01A56C50,5839F8E9) Openend
    /var/log/syslog:Nov 26 21:04:41 raspberrypi knxd[417]: Layer 2(01AA8620,5839F8E9) Open
    /var/log/syslog:Nov 26 21:04:41 raspberrypi knxd[417]: Layer 2(01AA8620,5839F8E9) Openend
    /var/log/syslog:Nov 26 21:04:41 raspberrypi knxd[417]: Layer 2(01AA8620,5839F8E9) open-reset(001): 01

    and repeating.

    I only added the logging parameter in knxd conf.

    PS says:
    425 ? Ss 0:00 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 –daemon=/tmp/knxd.log –trace=5 -d -D -T -R -S -i –listen-local=/tmp/knx tpuarts:/dev/ttyAMA0
    466 pts/0 S+ 0:00 grep knxd

    Nothing. Any help would be appreciated. What else can i check for errors.

    Regards
    Vince

    1. I tested some more. After playing and starting ETS5.5.1 some times, i could see for some seconds a found interface at 1.1.128 an my IP. Test told me to be Ok, choosing the interface the same. But, right after clicking onto Busmonitor oder looking for devices in programing mode, knxd stopped.

      Nov 27 14:57:10 raspberrypi systemd[1]: Started KNX Daemon.
      root@raspberrypi:/home/pi# systemctl status knxd.service
      ● knxd.service – KNX Daemon
      Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
      Active: active (running) since Sun 2016-11-27 14:57:10 UTC; 31s ago
      Process: 517 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)
      Process: 513 ExecStartPre=/usr/local/bin/knxd-findusb.sh (code=exited, status=0/SUCCESS)
      Main PID: 518 (knxd)
      CGroup: /system.slice/knxd.service
      └─518 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx tpuarts:/dev/ttyAMA0

      Nov 27 14:57:10 raspberrypi systemd[1]: Started KNX Daemon.
      root@raspberrypi:/home/pi# systemctl status knxd.service
      ● knxd.service – KNX Daemon
      Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
      Active: failed (Result: signal) since Sun 2016-11-27 14:57:48 UTC; 7s ago
      Process: 517 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)
      Process: 513 ExecStartPre=/usr/local/bin/knxd-findusb.sh (code=exited, status=0/SUCCESS)
      Main PID: 518 (code=killed, signal=ABRT)

      Nov 27 14:57:10 raspberrypi systemd[1]: Started KNX Daemon.
      Nov 27 14:57:48 raspberrypi systemd[1]: knxd.service: main process exited, code=killed, status=6/ABRT
      Nov 27 14:57:48 raspberrypi systemd[1]: Unit knxd.service entered failed state.
      root@raspberrypi:/home/pi#

      Btw. im using ETS on my Mac in a VM, network is in bridged mode.

      Any ideas ?

    2. Hi Vince

      another post describes also issues with knxtool vbusmonitor1. Habe you also tried

      knxtool busmonitor1 ip:localhost

      ? Your hardware is working correctly?

      Michael

    3. Hi Michael,

      oder können wir auch auf Deutsch ?
      I tried busmonitor parameter without v. I dunno if hardware works. KNX aktor, power supply and Siemens bus coupler and ADUM1201 are new. I ordered now an scn000.02 IP interface from MDT at voltus. Tomorrow I will try one last time with a backup raspberry pi 2. I don´t unterstand why knxd closes right after confirming the found interface with “choose/auswählen” in ETS5.5 (5.05. is acting same way).
      Thanks for your reply.

      Ciao,
      Vince

      1. Hi Vince,

        don´t unterstand why knxd closes right after confirming the found interface with “choose/auswählen” => Starte den knxd auf der command line und nicht als daemon um mehr Details zu bekommen:

        # Make root
        sudo su
        # Stop knxd
        systemctl stop knxd.service
        # Kill processes if exist
        killall knxd
        # Switch to User knxd. Start Shell as user
        su knxd -s /bin/sh
        # knxd in foreground
        /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 -D -T -R -S -i –-trace=5 –error=5 –listen-local=/tmp/knx tpuarts:/dev/ttyAMA0

        und teste anschließend nochmal die Verbindung von ETS aus.

        eibd hatte sich wenn das Interface nicht verfügbar war nicht beendet.

        Michael

        1. Guten Abend Michael,

          leider nicht möglich. Jessie ist noch frisch und unverändert. Aufruf der URL sagt in der knxd shell invalid url. Wenn ich — statt – vor eibaddr und error=5 setze, bekomme ich “initialisation of the knxd inet protocol failed”. Also so:

          /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 -D -T -R -S -i –-trace=5 –error=5 –listen-local=/tmp/knx tpuarts:/dev/ttyAMA0

          Danke für Deine Unterstützung bisher.

          Gruß
          Vince

          1. Hallo Vince,

            ist es dann bei dem Fehler “initialisation of the knxd inet protocol failed” geblieben? Also korrekter Aufruf wäre

            /usr/local/bin/knxd -p /run/knxd/knxd.pid --eibaddr=1.1.128 -D -T -R -S -i --trace=5 --error=5 --listen-local=/tmp/knx tpuarts:/dev/ttyAMA0
            

            Michael

  9. Hello Michael,

    I have a question, a raspberry and your script knxd can replace an IP KNX gateway ?

    or is it necessary to buy other things ?

    Thanks for your feed-back

    Laurent Friboulet

  10. Hi
    I’m trying to install the daemon on Jessie 8 Light version (to be combined Jeedom) but I can not. There are incompatibilities with this version of the OS?
    thank you

    1. Hi pete68,

      please read comment from Adrian, maybe you ran into the same problem.

      I never tried it on Jessie Light. Any error messages form the script?

      Michael

      1. Hmmm … I can not even Jessie Full. With Jessie and Knx was easier!
        just a question!
        since we all have problems, it would not be logical that someone who is able to install knxd share the image?

      2. I’m back!
        I managed to install knxd du jessie, but I still have a problem, I’m trying to configure Jeedom to interface to knxd just installed. Unfortunately the Jeedom Plugin KNX does not provide the serial interface AMA0 and expects the connection to an external router KNX.
        I think it can “confuse” Jeedom into believing they are connected to an external router, however, giving an ip address of that raspberry it’s running knxd.

        Basically, if you’ve installed knxd with address on raspberry:

        Address = 192 168 200 201/24
        Gateway = 192.168.200.1
        DNS = 192.168.200.1
        [Route]
        Destination = 224.0.23.12 / 32

        which address should I provide Jeedom to link to this fictitious router (which runs on the same Raspberry)?

        thanks for your patience

        1. Hi pete68,

          you cannot use a serial interface from more then one process.

          We’re right you have to connect via network. If Jeedom runs at the same host you can use 127.0.0.1 (loopback/localhost interface) Port 6720 or the public IP Address 192 168 200 201.

          Michael

  11. HI Michael
    Good news is that ncn5120 backed finally got worked,a big step for me(:

    more details:
    I have updated the baspbine to the latest version 2016-11-25-raspbian-jessie-lite
    nad reinstalled the script 0.63

    a little tip for the newbee like me.
    1.before install the script you must have enabled the serial port in the raspi-config and the correct is ttyS0 not the ttyAMA0 on a raspberrypi3

    2.install rpi-update before use it ):

    now I can monitor the group telegram but can’t sent any to the bus.I have checked the pi’s side is worked well, I think this is due to my hardware’s problem. when I solved this issue i will give it a complete test.and I expect it will work in SPI(:

    a lot thanks for your patience to help me and great work.

    Best regard !

    Adrian

  12. Hallo Michael,

    ich versuche mittels deines Scripts den KNXD unter Ubuntu (aktuelle Server LTS) ans Laufen zu bekommen; leider bricht er mir die eigentliche KNXD-Installation bzw. Compilierung ab mit
    checking systemd/sd-daemon.h usability… no
    checking systemd/sd-daemon.h presence… no
    checking for systemd/sd-daemon.h… no
    ./configure: line 17574: syntax error near unexpected token `SYSTEMD,’
    ./configure: line 17574: ` PKG_CHECK_MODULES(SYSTEMD, libsystemd-daemon)’
    make: *** No rule to make target ‘clean’. Stop.

    Ich vermute mal, dass “er” es nicht mag, dass es unter Ubuntu keinen Systemd mehr gibt, oder?

    Hast Du mir einen Tipp?

    Danke und Grüße
    Hans

    1. Grund gefunden – es fehlten Libraries, die ich mit dpkg identifizieren konnte:

      dpkg-checkbuilddeps: error: Unmet build dependencies: libusb-1.0-0-dev (>= 1.0.10) pkg-config dh-systemd | base-files (<= 1.0.10) pkg-config dh-systemd hat das Problem gelöst

  13. Hi,

    nice description … I like to setup a raspberry (still connected to a heater) as an KNX forwarding device, because I have WIFI available there only.

    Main KNX Installation KNX IP Router Raspberry secondary KNX Installation

    Is this possible to use a local FT1.2 KNX Interface to forward all telegrams to the secondary bus?

    Grüße,
    Nils

    Any ideas regarding this?

    Cheers,
    Nils

  14. Hey,

    your script no longer seems to work since knxd moved to 0.12. Could you please check this? Would be great.

    I came across the issue when using openhabian’s config option “Install KNX” which internally uses your script. This fails due to the above mentioned reason. At least that’s my first guess.

    After adding ‘git checkout tags/v0.10.18 -b install’ after ‘git clone … cd knxd’ in your script, the installation succeeds. However, I guess it’s better to migrate your script to knxd 0.12 (no pthsem dependency).

    Are there any chances that you “fix” this soon? I guess a lot of people are stumbling over this when they want to try out the new openhab 2.0 release via openhabian (+KNX)

    By the way: Thank you for your great work!

  15. Hi,

    I have problems with the install. I have tested it with a few fresh installation on Rasp 3. When I execute the script it ends with message:

    configure: error: libev not found
    make: *** No rule to make target ‘clean’. Schluss.

    After that there is no knxd folder and I cannot find it anywhere:

    pi@raspberrypi:~ $ ls -l /usr/local/bin
    insgesamt 8
    -rwxr-xr-x 1 root staff 408 Jan 24 22:12 knxd-findusb.sh
    -rwxr-xr-x 1 root staff 3973 Jan 24 22:09 pthsem-config

    Is there missing a requirement? Hopefully someone can give me hint. Thanks!

  16. Hi,

    script always stops with:

    checking for LIBUSB… yes
    EMI because of usb
    checking for ev_run in -lev… no
    configure: error: libev not found
    make: *** No rule to make target ‘clean’. Stop.

    tried: apt-get install libev-dev
    didn’t help

    Thx

  17. Hey Michael.

    After spending several hours with knxd I’m here again asking you for help because I don’t get any further.

    My setup:

    – Raspberry 3
    – Busware TUL flashed with “transparent TPUART” firmware plugged into RPI3 and connected to KNX bus (done by my electrician, so should be okay)
    – clean install of openHABian (raspbian + openhab2 + …)
    – nothing else has been done (neither on software nor on hardware side)

    My expectations:

    – install “knxd” by simply executing “./install_knxd_systemd.sh” (nothing else)
    – after successful installation “knxtool vbusmonitor1 ip:localhost” on my pi should list some KNX packages when I turn on/off my lights, shutters, …

    Real world:

    – I need to adjust the install script to successfully install knxd 0.10.18 or 0.11.18 instead of master (fails)
    – Even after successful installation of knxd the command “knxtool vbusmonitor1 ip:localhost” on my pi never brings any output

    Questions?

    – Are my expectations wrong?
    – Is there anything I misundestood?
    – Is the “transparent TPUART” firmware the correct one or do I have to use the “FT1.2 serial port BCU” firmware (IMHO not, but I also tried this without success)
    – “knxtool vbusmonitor1 ip:localhost” SHOULD list something when I switch lights, right?

    Thank you so much.

  18. Sorry for spamming you. Just wanted to let you know that it’s working as expected now.

    What I did:
    – new clean install of openHABian
    – build the latest source code of knxd (0.12.x) exactly as detailed on their Github homepage.
    – followed the stuff in section “Adding a TPUART USB interface”
    – modified /etc/knxd.conf
    – reboot

    Done. I can see the packages with knxtool. Perfect. Now I can move on …

  19. Hallo,

    ich habe das KNXD ueber die aktuelen OpenHABianPi Release 2.0 installiert (Raspian Pi 2B GNU/Limux 8 )jessie
    Angebunden werden soll Busch Jaeger Powernet ueber USB
    Dort wird die Installation auch ueber das Script michlstechblog.info/blog/download/electronic/install_knxd_systemd.sh
    Installiert, allerdings funktioniert die USB Port Erkennung danach nicht, weiterhin fehlen auch die knxtools , Dort sind nur folgende Programme:

    [19:22:55] root@openHABianPi:/usr/local/bin# ls
    knxd-findusb.sh openhabian-config pthsem-config

    Der Dienst scheint aber vorhanden zu sein:
    [19:22:56] root@openHABianPi:/usr/local/bin# ps -ax | grep knxd
    1549 pts/0 S+ 0:00 grep –color=auto knxd

    Auch ein manuelle Nachinstallieren über das install_knxd_systemd.sh Script brachte nichts

    Die letzten Meldungen des Script:

    checking whether __APPLE__ is declared… no
    checking for gethostbyname_r… yes
    EMI because of ft12
    checking for LIBUSB… yes
    EMI because of usb
    checking for ev_run in -lev… no
    configure: error: libev not found
    make: *** No rule to make target ‘clean’. Stop.

    Irgend jemand eine Idee?

    Im /var/log/messages wird das USB Device wohl erkannt…
    Jan 26 21:29:04 openHABianPi kernel: [ 3.737192] usb 1-1.5: new full-speed USB device number 4 using dwc_otg
    Jan 26 21:29:04 openHABianPi kernel: [ 3.857222] usb 1-1.5: New USB device found, idVendor=145c, idProduct=1330
    Jan 26 21:29:04 openHABianPi kernel: [ 3.859061] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    Jan 26 21:29:04 openHABianPi kernel: [ 3.860873] usb 1-1.5: Product: KNX-USB Interface (Flush mounted)
    Jan 26 21:29:04 openHABianPi kernel: [ 3.862714] usb 1-1.5: Manufacturer: Busch-Jaeger Elektro GmbH
    Jan 26 21:29:04 openHABianPi kernel: [ 3.880048] hid-generic 0003:145C:1330.0001: hiddev0,hidraw0: USB HID v1.01 Device [Busch-Jaeger Elektro GmbH KNX-USB Interface (Flush mounted)] on usb-3f980000.usb-1.5/input0

    Gruß Boris

  20. Hi Michael,
    danke für die echt ausführliche Beschreibung!

    Leider beendet sich das Installskript mit folgenden Fehler:
    checking whether SA_SIZE is declared… no
    checking whether __FreeBSD__ is declared… no
    checking whether __APPLE__ is declared… no
    checking for gethostbyname_r… yes
    EMI because of ft12
    checking for LIBUSB… yes
    EMI because of usb
    checking for ev_run in -lev… no
    configure: error: libev not found
    make: *** No rule to make target ‘clean’. Stop.

    Ich habe bereits mehrfach Jessie neu aufgesetzt und nichts weiter als die oben gelisteten Punkte ausgeführt.
    Eine Idee?

    Es ist ein Pi3

    Danke und Grüße
    Marc

        1. Hi Marc,

          have you tried

          knxtool busmonitor1 ip:localhost

          instead of

          knxtool vbusmonitor1 ip:localhost ?

          I think vbusmonitor1 has some problems.

          Michael

          1. Hi Michael,
            i have flashed my BUSSER and use tpuarts:/dev/ttyACM0 instead of tpuarts:/dev/ttyAMA0.

            Now i see traffic on my bus.

            Thanks
            Marc

  21. Hallo,

    ich habe alles komplett nach der Anleitung von Boerni aufgesetzt und möchte den KNXD einfach auf mein bereits mit dem Homeserver laufendendes Busch Jaeger IP Gateway connecten lassen.

    Leider kommt bei jedem Schaltversuch immer nur folgende Fehlermeldung:

    Feb 2 19:41:31 raspberrypi homebridge[998]: [2017-02-02 19:41:31] [homebridge-knx.KNX] DEBUG got dest=4622
    Feb 2 19:41:31 raspberrypi homebridge[998]: [2017-02-02 19:41:31] [homebridge-knx.KNX] [ERROR] knxwrite:openTGroup: Error: request invalid

    hab schon massig KNX_Opts versucht – aktuell ist diese hier aktiv:

    KNXD_OPTS=”-e 1.7.199 -D -T -R -S”

    Fehlermeldung ist aber immer die gleiche – egal welche Opts ich setze.
    IP Gateway hat die IP 192.168.0.200

    Bin für jede Hilfe sehr dankbar !

    1. Hi Oliver,

      was heißt Schaltversuch? Welche knxd Installation verwendest Du? KNXD_OPTS deutet nicht auf mein Installscript hin. Weche knxd/knxtool Version ist installiert? Wie ist die komplette knxd Konfig?

      Grüße Michael

      1. The same error when i run the status of homebridge:
        pi@raspberrypi:~ $ sudo systemctl status homebridge
        ● homebridge.service – Node.js HomeKit Server
        Loaded: loaded (/etc/systemd/system/homebridge.service; enabled)
        Active: active (running) since Mon 2017-02-13 14:10:25 MSK; 3min 52s ago
        Main PID: 661 (homebridge)
        CGroup: /system.slice/homebridge.service
        └─661 homebridge

        Feb 13 14:12:27 raspberrypi homebridge[661]: ================================
        Feb 13 14:12:27 raspberrypi homebridge[661]: [2/13/2017, 2:12:27 PM] [homebridge-knx.KNX] DEBUG got dest=4103
        Feb 13 14:12:27 raspberrypi homebridge[661]: [2/13/2017, 2:12:27 PM] [homebridge-knx.KNX] [ERROR] knxwrite:openTGroup: Error: request invalid
        Feb 13 14:12:28 raspberrypi homebridge[661]: —iterating——————–
        Feb 13 14:12:28 raspberrypi homebridge[661]: address: 2/0/7
        Feb 13 14:12:28 raspberrypi homebridge[661]: reversed: false
        Feb 13 14:12:28 raspberrypi homebridge[661]: dptype: DPT1
        Feb 13 14:12:28 raspberrypi homebridge[661]: ================================
        Feb 13 14:12:28 raspberrypi homebridge[661]: [2/13/2017, 2:12:28 PM] [homebridge-knx.KNX] DEBUG got dest=4103
        Feb 13 14:12:28 raspberrypi homebridge[661]: [2/13/2017, 2:12:28 PM] [homebridge-knx.KNX] [ERROR] knxwrite:openTGroup: Error: request invalid

        I have to say that first i installed your new knxd (v0.7.4), got it worked with my ABB USB/S 1.1 and after that i installed homebridge-knx from this page:
        boernyblog dot de/raspberry-pi-3-als-knx-bridge-fuer-ios-homekit/
        and it seems that they do not want to work together.
        Commands from HomeKit dont go to the knxd. Certainly, HomeKit can not get the status of any lamp.
        There is a 4-th day of my battle with the homebridge-knx 🙂

          1. Hi Tim,

            I altered the script. Master branch is currently under heavy development and unstable. The script checks out v0.12 by default.

            Michael

        1. Hi Tim,

          I think this issue is not knxd related. Your knxd is running and your config is ok? Can you post the homebridge knxd config the device config of 2/0/7?

          Have you tried to query the group address with knxtool?

          Michael

          1. Hi Michael!
            Thank your for your replay!
            My config for the lamp:
            {
            “knxd_ip”: “192.168.0.31”,
            “knxd_port”: 6720,
            “AllowKillHomebridge”: true,
            “Devices”: [
            {
            “DeviceName”: “Lamp”,
            “Services”: [
            {
            “ServiceType”: “Lightbulb”,
            “ServiceName”: “WorkTable”,
            “Characteristics”: [
            {
            “Type”: “On”,
            “Set”: [
            “2/0/7”
            ],
            “Listen”: [
            “2/2/6”
            ]
            }
            ]
            }
            ]
            }
            ]
            }
            Yes. i’ve tried to control the lamp with knxtool. It’s ok, only if i stopped the homebridge service. Overwise, it seys folowing:
            pi@raspberrypi:~ $ sudo knxtool groupswrite ip:localhost 2/0/7 0
            Connect failed: Connection reset by peer
            pi@raspberrypi:~ $ sudo systemctl stop homebridge
            pi@raspberrypi:~ $ sudo knxtool groupswrite ip:localhost 2/0/7 0
            Send request
            pi@raspberrypi:~ $ sudo knxtool groupswrite ip:localhost 2/0/7 1
            Send request
            pi@raspberrypi:~ $
            I guess i sow somewhere command “knxtool groupswrite” without “ip:localhost”.
            One more thing. I found that: github dot com/snowdd1/homebridge-knx/issues/80

          2. Hi Tim,

            as written in my previous post the homebridge-knx maintainer have something to do 🙂

            Yes. i’ve tried to control the lamp with knxtool. It’s ok, only if i stopped the homebridge service. Overwise, it seys folowing:
            pi@raspberrypi:~ $ sudo knxtool groupswrite ip:localhost 2/0/7 0

            => There is a new option in knxd which assigns an individual KNX Adresse to each connected client. If have set this to just one:

            –client-addrs=1.1.129:1

            may be when you increase it to 2 or more you do not have to stop the homebridge service to use knxtool and homebridge together:

            –client-addrs=1.1.129:4

  22. Hi

    using: knxtool busmonitor1 ip:localhost
    brings: knxtool: error while loading shared libraries: libeibclient.so.0: cannot open shared object file: No such file or directory

    Why does libeibclient.so.0 not exit ? How to Install it?
    THX
    Roland

    1. Hi Roland,

      the reason is the switch from static to dynamic linked binaries. Debian is not looking into /usr/local/lib for libraries.

      Copy the following lines into a shell:

      cat > /etc/ld.so.conf.d/knxd.conf

  23. OK, this is a stupid question from the current maintainer of knxd.

    What is wrong with installing knxd via the .deb file it creates? That’d install libeibclient.so.0 to /usr/lib where it’ll be found without playing with ld.so.conf, and register dependencies like libev.

    Also, knxd already comes with a working systemd script.

    Also, “-b usb:” should be sufficient. No need to hard-code the device’s bus ID (which may change).

    1. Why would you need to create a pid file?
      Don’t add knxd to dialout, fix permissions with udev instead. (my personal opinion)
      You still have a –with-pth option in your configure call.

      I’ll add your USB rules to the udev file that’s shipped with knxd.

      1. Hi Matthias,

        thanks for your comments:-)

        The script has it origins in compiling and installing eibd at once. May be some things are not up to date what’s currently possible with knxd 🙂

        What is wrong with installing knxd via the .deb file it creates? => Well I’ll give it a try. Currently my time is really rare.

        “-b usb:” should be sufficient. => Ok, I’ll add this to /etc/default/knxd as an option example. I don’t know that the ID is not needed anymore. However the device id isn’t hardcoded. It is determined by findknx-usb and /etc/default/knxd is changed before knxd starts. But the smartest way is when knxd finds the device itself 🙂

        libeibclient.so.0 to /usr/lib => Because I strictly want to isolate the debian system files from self installed binaries. Another possibility is a symink from /usr/local/lib/libeibclient.so.0 to /usr/lib

        Don’t add knxd to dialout, fix permissions with udev instead. (my personal opinion) => My approach is keep it simple and stupid 🙂 The permissions (group dialout) on the serial device(s) are already in place and serial devices are usually very static (like ttyAMA0 of the Raspberry). In my opinion udevd is oversized for that case.

        You still have a –with-pth option in your configure call. => I remove it

        Why would you need to create a pid file? => Because I compiled knxd without direct systemd support. Some earlier version of knxd aborted compiling with builtin systemd support. To control the daemon by systemctl and systemd I need the pid file.

        I really appreciate your work. Thank you!

        I think most guys which want to use knxd have less experience in Linux Systems. They need a “one shot” solution (in case of the raspberry: installing/compiling knxd, modifing /boot/cmdline, …..) to get knxd running. May be this is an option for future releases of knxd to provide some platform specific scripts. This would make my script no longer necessary 😉 If you are intressent I can spend some lines code 🙂

        Michael

  24. Thank you for all your work on this! I am using your latest script from github and it fails while building:

    In file included from ncn5120.cpp:23:0:
    ncn5120.h:36:8: error: extra qualification ‘NCN5120SerialLayer2Driver::’ on member ‘setstate’ [-fpermissive]
    void NCN5120SerialLayer2Driver::setstate(enum TSTATE state);
    ^
    In file included from ncn5120.h:24:0,
    from ncn5120.cpp:23:
    tpuartserial.h: In member function ‘virtual void NCN5120SerialLayer2Driver::setstate(TSTATE)’:
    tpuartserial.h:36:8: error: ‘virtual void TPUARTSerialLayer2Driver::setstate(TSTATE)’ is private
    void setstate(enum TSTATE state);
    ^
    ncn5120.cpp:66:47: error: within this context
    TPUARTSerialLayer2Driver::setstate(new_state);
    ^
    ncn5120.cpp:66:48: error: expected ‘}’ at end of input
    TPUARTSerialLayer2Driver::setstate(new_state);
    ^
    Makefile:452: recipe for target ‘ncn5120.o’ failed
    make[3]: *** [ncn5120.o] Error 1
    make[3]: Leaving directory ‘/root/knxdbuild/knxd/src/backend’
    Makefile:385: recipe for target ‘all-recursive’ failed
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory ‘/root/knxdbuild/knxd/src’
    Makefile:434: recipe for target ‘all-recursive’ failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory ‘/root/knxdbuild/knxd’
    Makefile:369: recipe for target ‘all’ failed
    make: *** [all] Error 2

    Any advice on what I can do to fix this is appreciated!

  25. Hello!
    Almost a week i’m trying to set up the homebridge-knx on Raspberry Pi3.
    Found your manual. Thank you so much!
    Unfortunately i got the error:

    Making install in tools
    make[2]: Entering directory ‘/root/knxdbuild/knxd/tools’
    make[3]: Entering directory ‘/root/knxdbuild/knxd/tools’
    make[3]: Nothing to be done for ‘install-exec-am’.
    make[3]: Nothing to be done for ‘install-data-am’.
    make[3]: Leaving directory ‘/root/knxdbuild/knxd/tools’
    make[2]: Leaving directory ‘/root/knxdbuild/knxd/tools’
    make[1]: Leaving directory ‘/root/knxdbuild/knxd’
    chmod: cannot access ‘/usr/local/bin/knxd-findusb.sh’: No such file or directory
    root@raspberrypi:/home/pi#

    on the clean system twice. So, i dont know, if the script finished correctly. And i dont have /usr/local/bin/knxd-findusb.sh
    How can i configure my ABB USB/S 1.1 in this case?
    Thank you in advance!

  26. Dear Michael,

    as a complete noob to the field of KNX/Raspberry, please apologize my silly questions in advance …

    I am trying to setup openHABian (running on a Pi3) to connect to my Hager USB interface. Following your excellent script and instructions, the installation (install_knxd_systemd.sh) script stopped when trying to execute /usr/local/bin/knxd-findusb.sh: actually, there is no such file in the directory. However, since an executable named findknxusb is present, I changed the installation script correspondingly and re-started it. After commenting another line (useradd knxd failed since this user was already known), the installation script completes successfully and findknxusb correctly identifies my Hager interface (device: 1:4:1:0:0 Hager…).

    However, after rebooting, there is no knxd service running. And listening to the bus using knxtool busmonitor1 ip:localhost fails with the error “Connection refused”. All installation steps took place with superuser privileges, though.

    Any idea what I am doing wrong …?

    Thanks & best regards,

    Thorsten

    1. P.S: When manually starting the knxd (/usr/local/bin/knxd -p /run/knxd/knx.pid –eibaddr=1.1.128 -D -T -R -S -i –trace=5 –error=5 –listen-local=/tmp/knx usb:%DEVICEID%, as described in one of the previous comments), it is successfully tracing EIB activity! That’s my personal glimpse of light for today 🙂

      1. Hi Thorsten,

        when you start knxd manually, you do this as which user? Command line changed in newer versions of knxd. Try the following cmommands to start as user knxd(like daemon also run)

        sudo su -s/bin/bash knxd
        /usr/local/bin/knxd –eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:

        May be if you start knxd as root you habe to manually remove /tmp/knx otherwise you will have no permissions with user knxd.

        When knxd does not start at boot time. What are the log entries about knxd:

        sudo journalctl -u knxd.service

        Michael

        1. Hi Michael,

          many thanks for your ultra-fast response!

          Immediately after booting, the log entries (journalctl -u knxd.service) read as follows:
          — Logs begin at Mon 2017-02-13 18:11:18 CET, end at Mon 2017-02-13 18:13:57 CET. —
          Feb 13 18:12:23 openHABianPi systemd[1]: Starting KNX Daemon…
          Feb 13 18:12:24 openHABianPi knxd[388]: initialization of the EIBnet/IP server failed: No such device
          Feb 13 18:12:24 openHABianPi systemd[1]: knxd.service: control process exited, code=exited status=1
          Feb 13 18:12:24 openHABianPi systemd[1]: Failed to start KNX Daemon.
          Feb 13 18:12:24 openHABianPi systemd[1]: Unit knxd.service entered failed state.

          Starting the knxd service as user knxd following your description succeeds, though! Afterwards, knxtool busmonitor1 ip:localhost appears to work and starts tracing the EIB activity.

          So apparently my problem boils down to an issue related to the knxd configuration at boot time? Is the missing bash script knxd-findusb.sh somehow related to this?

          Thanks,
          Thorsten

          P.S.: I immediately checked that the USB is configured in my /etc/bin/knxd:

          # Command line parameters for knxd. TPUART Backend
          # Serial device Raspberry
          # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
          # Serial device PC
          # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
          # Tunnel Backend
          # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
          # USB Backend
          KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

          1. Hi Thorsten,

            it seems the Network isn’t ready when knxd tries to start. Have you set a static IP Address? What happens when you boot your Raspberry and try the systemd method to start knxd manually:

            sudo systemctl start knxd.service

            Michael

          2. Hi Michael,

            ah, we are getting closer! Manually starting the knxd service (using exactly the command you suggested) works without problems.

            Here is the point: yes, my Raspberry does have a static IP address. BUT: a) the PI3 connects to my router using Wifi (no LAN connection) and b) it’s the router (a Fritz!Box) which assigns the static IP (thought that would be easiest and safest way). So one could at least imagine that the IP gets assigned only after (!) the system tries to start knxd.

            Looks like I have to figure out how to delay the start of knxd until Wifi is up and connected?

            Thorsten

          3. Hi Michael,

            bad luck: looks like I completely messed up the network configuration when trying to set up a static IP 🙁 – currently, the Raspberry does neither connect to LAN nor to Wifi. Getting this fixed might take a few days: I don’t have a USB keyboard available, so I will probably re-install openHabian from scratch. Regarding the Wifi setup: the openHabian configuration includes a corresponding option, which is what I used.
            I will let you know how this proceeds …

            Thorsten

          4. Hi Michael,

            just a brief update: success! After a) setting up my PI3 from scratch (openHABian), including b) customized Wifi setup according to your instructions, c) assigning a static IP following your guide and d) running through your setup instructions (again), knxd starts up successfully when booting the PI, connects to the EIB via the Hager USB interface and readily monitors bus traffic. ETS4 recognizes the knxd interface, and the integrated bus-monitor works. Yes 🙂 🙂 :)!

            openHAB(2) might still require some configuration (it does not show the knx binding in the Inbox after installation of the corresponding addon), but that’s probably a different story … If you know of any links to noob-proof setup instructions, please let me know!

            Thanks again for your great support and excellent blog!

            Thorsten

          5. Hi Thorsten,

            first thank you for all the effort you put into this!
            I’ve installed knxd on a fresh debian stretch install on a rpi2. I’ve not setup the static IP (yet, last time I tried something went wrong), but unlike Michael, I cannot even start knxd with the manual command. I get a timeout (see below). FYI, at some point I could see that knxd had correctly recognised my GIRA USB interface. Anything I might try?

            root@raspberrypi:/home/pi# sudo systemctl start knxd.service
            Job for knxd.service failed because a timeout was exceeded.
            See “systemctl status knxd.service” and “journalctl -xe” for details.
            root@raspberrypi:/home/pi# service knxd status
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
            Active: failed (Result: timeout) since Fri 2017-08-25 17:00:07 UTC; 36s ago
            Process: 520 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)

            Aug 25 16:58:37 raspberrypi systemd[1]: Starting KNX Daemon…
            Aug 25 17:00:07 raspberrypi systemd[1]: knxd.service: Start operation timed out. Terminating.
            Aug 25 17:00:07 raspberrypi systemd[1]: Failed to start KNX Daemon.
            Aug 25 17:00:07 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Aug 25 17:00:07 raspberrypi systemd[1]: knxd.service: Failed with result ‘timeout’.

            Thank you!

          6. Hi Thorsten,

            I have now managed to set the static IP:
            I needed to change Name=eth0 to the name of the interface provided by “ifconfig”.

            However my problem persists, also when runing the suggest command:

            knxd@raspberrypi:/home/pi$ /usr/local/bin/knxd –eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:1:4:1:0
            I don’t know of options for –eibaddr=1.1.128
            E00000055: [ 1:main] There is no KNX addr= in section ‘main’.
            F00000000: [ 1:main] Error setting up the KNX router.

            Marc

          7. Hi Marc,

            how your setup looks like? USB..?

            Whats the content of /etc/default/knxd

            cat /etc/default/knxd

            knxd logs/state

            journalctl -xu knxd.service

            Michael

          8. Hi Michael,

            I have a GIRA USB interface.

            pi@raspberrypi:~ $ cat /etc/default/knxd
            # Command line parameters for knxd. TPUART Backend
            # Serial device Raspberry
            #KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
            # Serial device PC
            # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
            # Tunnel Backend
            # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
            # USB Backend
            KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:4 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

            —————————-
            journalctl -xu knxd.service
            — Logs begin at Sat 2017-08-26 14:33:15 UTC, end at Sat 2017-09-30 12:07:13 UTC
            Aug 26 14:33:26 raspberrypi systemd[1]: Starting KNX Daemon…
            — Subject: Unit knxd.service has begun start-up
            — Defined-By: systemd


            — Unit knxd.service has begun starting up.
            Aug 26 14:33:28 raspberrypi knxd[280]: E00000032: [20:router] router: setup rout
            Aug 26 14:33:28 raspberrypi systemd[1]: knxd.service: Control process exited, co
            Aug 26 14:33:28 raspberrypi systemd[1]: Failed to start KNX Daemon.
            — Subject: Unit knxd.service has failed
            — Defined-By: systemd


            — Unit knxd.service has failed.

            — The result is failed.
            Aug 26 14:33:28 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Aug 26 14:33:28 raspberrypi systemd[1]: knxd.service: Failed with result ‘signal
            lines 1-19/19 (END)…skipping…
            — Logs begin at Sat 2017-08-26 14:33:15 UTC, end at Sat 2017-09-30 12:07:13 UTC. —
            Aug 26 14:33:26 raspberrypi systemd[1]: Starting KNX Daemon…
            — Subject: Unit knxd.service has begun start-up
            — Defined-By: systemd


            — Unit knxd.service has begun starting up.
            Aug 26 14:33:28 raspberrypi knxd[280]: E00000032: [20:router] router: setup router: failed
            Aug 26 14:33:28 raspberrypi systemd[1]: knxd.service: Control process exited, code=killed status=6
            Aug 26 14:33:28 raspberrypi systemd[1]: Failed to start KNX Daemon.
            — Subject: Unit knxd.service has failed
            — Defined-By: systemd


            — Unit knxd.service has failed.

            — The result is failed.
            Aug 26 14:33:28 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Aug 26 14:33:28 raspberrypi systemd[1]: knxd.service: Failed with result ‘signal’.

            Thank you !

          9. Hi,
            I just restarted the raspberry and managed to get a different message in the log:

            journalctl -xu knxd.service
            — Logs begin at Sat 2017-09-30 12:51:19 UTC, end at Sat 2017-09-30 12:58:17 UTC. —
            Sep 30 12:51:47 raspberrypi systemd[1]: Starting KNX Daemon…
            — Subject: Unit knxd.service has begun start-up
            — Defined-By: systemd


            — Unit knxd.service has begun starting up.
            Sep 30 12:51:49 raspberrypi knxd[295]: E00000000: [16:C.usb] send_Local timed out!
            Sep 30 12:51:49 raspberrypi knxd[295]: F00000035: [18:C.usb] Send while buffer not empty
            Sep 30 12:51:49 raspberrypi systemd[1]: knxd.service: Control process exited, code=killed status=6
            Sep 30 12:51:49 raspberrypi systemd[1]: Failed to start KNX Daemon.
            — Subject: Unit knxd.service has failed
            — Defined-By: systemd

            — Unit knxd.service has failed.

            — The result is failed.
            Sep 30 12:51:49 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 30 12:51:49 raspberrypi systemd[1]: knxd.service: Failed with result ‘signal’.
            —————————-
            I hope that helps

  27. Thank you, this is a grade script! Two things could be improved.
    * Check if the user knxd already exists. So the script can be executed a second time.
    * Checkout the v0.12 branch also when the repository already exists.

    Michael

  28. Hello
    Thank you so much for the great work
    I have a problem running the script:
    EMI because of ft12
    checking for LIBUSB… yes
    EMI because of usb
    configure: error: libfmt (string formatting library) is not installed.
    root@raspberrypi:~#
    Because it may be failing?
    I’ve searched for the missing library, but I can not find it.
    a greeting

    1. Hi Pedro,

      I’ve added support for the libfmt lib. But currently (19.2.2017 commit 6f477ea802b7989267cda85a61bb046d1c138dd6)the master branch stops with an error when compiling against libfmt. Must take a closer look at this…

      Michael

          1. Hi Michael,

            now i have got it working, thx. vbusmonitor, groupswrite etc is working. I want to use this also with OPENHAB2/KNX2.0 from Karel Goderis and I configured knx.cfg for OPENHAB2 where i have put as serialport /tty/ttyAMA0 but i get the following error:

            17:58:57.367 [INFO ] [tuwien.auto.calimero ] – FT1.2 /dev/ttyAMA0: open rxtx library serial port connection
            17:58:57.368 [ERROR] [nx.handler.KNXBridgeBaseThingHandler] – An exception occurred while connecting to the KNX bus: Serial port ‘/dev/ttyAMA0’ could not be opened. Available ports are:

            Does this have to do with ownership of ttyAMA0? What can i do to rectify this?

            Regards,

            Bert

          2. Hi Bert,

            what permissions are set to ttyAMA0?

            ls -l /dev/ttyAMA0

            is the port opened by another program?

            lsof|grep tty

            Michael

          3. Hi Michael,

            i just ran the 2 commands and here are the results:

            root@raspberrypi:/home/pi# ls -l /dev/ttyAMA0
            crwxrwxrwx 1 root tty 204, 64 Feb 22 16:13 /dev/ttyAMA0

            root@raspberrypi:/home/pi# lsof |grep tty
            lsof: WARNING: can’t stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
            Output information may be incomplete.
            systemd-l 381 root 6r REG 0,16 4096 2166 /sys/devices/virtual/tty/tty0/active
            systemd-l 381 root 13u CHR 4,6 0t0 1047 /dev/tty6
            vncserver 446 root 8r REG 0,16 4096 2166 /sys/devices/virtual/tty/tty0/active
            vncserver 446 14068 root 8r REG 0,16 4096 2166 /sys/devices/virtual/tty/tty0/active
            login 452 root mem REG 179,2 9520 14919 /lib/arm-linux-gnueabihf/security/pam_securetty.so
            login 452 root 0u CHR 4,1 0t0 1042 /dev/tty1
            login 452 root 1u CHR 4,1 0t0 1042 /dev/tty1
            login 452 root 2u CHR 4,1 0t0 1042 /dev/tty1
            agetty 453 root cwd DIR 179,2 4096 2 /
            agetty 453 root rtd DIR 179,2 4096 2 /
            agetty 453 root txt REG 179,2 30508 11722 /sbin/agetty
            agetty 453 root mem REG 179,2 46820 14154 /lib/arm-linux-gnueabihf/libnss_files-2.19.so
            agetty 453 root mem REG 179,2 38612 14156 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
            agetty 453 root mem REG 179,2 71628 14151 /lib/arm-linux-gnueabihf/libnsl-2.19.so
            agetty 453 root mem REG 179,2 30592 14152 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
            agetty 453 root mem REG 179,2 1607760 1945 /usr/lib/locale/locale-archive
            agetty 453 root mem REG 179,2 1242776 13269 /lib/arm-linux-gnueabihf/libc-2.19.so
            agetty 453 root mem REG 179,2 18920 138554 /usr/lib/arm-linux-gnueabihf/libarmmem.so
            agetty 453 root mem REG 179,2 134448 13266 /lib/arm-linux-gnueabihf/ld-2.19.so
            agetty 453 root 0u CHR 204,64 0t0 1026 /dev/ttyAMA0
            agetty 453 root 1u CHR 204,64 0t0 1026 /dev/ttyAMA0
            agetty 453 root 2u CHR 204,64 0t0 1026 /dev/ttyAMA0
            Xorg 568 root 7u CHR 4,7 0t0 1048 /dev/tty7
            llvmpipe- 568 587 root 7u CHR 4,7 0t0 1048 /dev/tty7
            llvmpipe- 568 588 root 7u CHR 4,7 0t0 1048 /dev/tty7
            llvmpipe- 568 589 root 7u CHR 4,7 0t0 1048 /dev/tty7
            llvmpipe- 568 590 root 7u CHR 4,7 0t0 1048 /dev/tty7
            bash 608 pi 0u CHR 4,1 0t0 1042 /dev/tty1
            bash 608 pi 1u CHR 4,1 0t0 1042 /dev/tty1
            bash 608 pi 2u CHR 4,1 0t0 1042 /dev/tty1
            bash 608 pi 255u CHR 4,1 0t0 1042 /dev/tty1

            Regards,

            Bert

          4. Hi Bert,

            your serial device is opened by agetty (Console)

            agetty 453 root 0u CHR 204,64 0t0 1026 /dev/ttyAMA0

            Please check /boot/cmdline.txt there should be NO options containing /dev/ttyAMA0.

            Whats the state of the serial getty:

            systemctl status serial-getty@ttyAMA0.service

            Michael

      1. Hello
        Thank you very much for the help
        Now works perfectly
        Just a detail, setting a fixed ip address, ETS does not detect any programmer but if I leave the ip dhcp, if it detects raspberry and works perfectly.

  29. Hi Michl,

    Can we find your last Script on Github ?
    I will check all changes for the future 😉

    Thanks again for your Script

    Is this your Git Place ?
    https : // github.com / Race666 / install-knxd

  30. Dear Michail ;
    First of all many thanks for the clever solutions . But I fortunately I tried may be 100 times it’s not working .
    You are technical person and you are thinking that everybody know the linux or whatever else language commands . If its possible can you explain all issues from the begining step by step . For example how can I do static ip fixing on my rpi . Some part of your explain is not enough for get the any solution .

    Thanks and Regards ….

    1. Hi Bego,

      the post is already written for less experienced Linux Users but some basics operating system know how like creating/editing a file, executing commands is essential. WhenI should explain that too the post would grow and grow… I think you should start with a linux for beginner tutorial otherwise you will have no fun with your Raspberry at all.

      Michael

      1. KNX support answered that win10 must be emulated on the PI. Never seen anybody managed to do that. But interesting is that ELKA Elektronik GMBH saying they managed to get ETS Inside running on Win10IoT.

  31. Hi Michael,

    if you thinks that the following questions are off-topic, please feel free to ignore this post.

    After the successful setup of knxd on my PI3 (see previous discussion – thanks again!), I am stuck with the corresponding binding in openHAB. Using knxtool, I am able to control my rollershutter on GA 3/2/1. In my .items, the device is configured as

    Rollershutter Rolladen_Test “Rolladen Test” [“Rollershutter”] {knx=”3/2/1″}

    It shows up correctly in the openHAB Basic UI – however, the shutter does not do anything when pushing the “up” or “down” buttons. In knx.cfg, the binding is configured as ROUTER, and openhab2.log confirms the connection (I also tried TUNNEL mode, but this leads to a timeout error):

    2017-03-12 12:12:14.517 [INFO ] [nx.internal.connection.KNXConnection] – Established connection to KNX bus on 224.0.23.12:6720 in mode ROUTER.

    After enabling some traces in the Karaf console, the log file contains additional information when pressing the “up” button (attached below), but no obvious indication of errors.

    Any help or hint would be highly appreciated!

    Thorsten

    2017-03-12 13:36:31.543 [TRACE] [.binding.knx.internal.bus.KNXBinding] – Received update (item=’Rolladen_Test’, state=’UP’)
    2017-03-12 13:36:31.547 [TRACE] [.binding.knx.internal.bus.KNXBinding] – Received command (item=’Rolladen_Test’, command=’UP’)
    2017-03-12 13:36:31.553 [TRACE] [g.knx.internal.dpt.KNXCoreTypeMapper] – toTypeClass looking for dptId = 1.008
    2017-03-12 13:36:31.554 [TRACE] [g.knx.internal.dpt.KNXCoreTypeMapper] – toTypeClass looking for dptId = 1.008
    2017-03-12 13:36:31.555 [TRACE] [.binding.knx.internal.bus.KNXBinding] – found 1 compatible datapoints for item Rolladen_Test (org.openhab.core.library.types.UpDownType)
    2017-03-12 13:36:31.555 [TRACE] [.binding.knx.internal.bus.KNXBinding] – found 1 compatible datapoints for item Rolladen_Test (org.openhab.core.library.types.UpDownType)
    2017-03-12 13:36:31.582 [DEBUG] [tuwien.auto.calimero ] – KNXnet/IP Routing 224.0.23.12:3671: add to multicast loopback frame buffer: L-Data.ind from 0.0.0 to 3/2/1, low priority hop count 6 tpdu 00 80
    2017-03-12 13:36:31.583 [DEBUG] [tuwien.auto.calimero ] – KNXnet/IP Routing 224.0.23.12:3671: add to multicast loopback frame buffer: L-Data.ind from 0.0.0 to 3/2/1, low priority hop count 6 tpdu 00 80
    2017-03-12 13:36:31.589 [DEBUG] [tuwien.auto.calimero ] – KNXnet/IP Routing 224.0.23.12:3671: sending cEMI frame seq 0, non-blocking, attempt 1 (channel 0) 06 10 05 30 00 11 29 00 bc e0 00 00 1a 01 01 00 80
    2017-03-12 13:36:31.590 [DEBUG] [.binding.knx.internal.bus.KNXBinding] – Wrote value ‘UP’ to datapoint ‘command DP 3/2/1 Rolladen_OG_Ankleidezimmer, DPT main 0 id 1.008, low priority’
    2017-03-12 13:36:31.592 [DEBUG] [.binding.knx.internal.bus.KNXBinding] – Wrote value ‘UP’ to datapoint ‘command DP 3/2/1 Rolladen_OG_Ankleidezimmer, DPT main 0 id 1.008, low priority’
    2017-03-12 13:36:31.593 [DEBUG] [tuwien.auto.calimero ] – KNXnet/IP Routing 224.0.23.12:3671: discard multicast loopback cEMI frame: L-Data.ind from 0.0.0 to 3/2/1, low priority hop count 6 tpdu 00 80
    2017-03-12 13:36:31.594 [DEBUG] [tuwien.auto.calimero ] – KNXnet/IP Routing 224.0.23.12:3671: sending cEMI frame seq 0, non-blocking, attempt 1 (channel 0) 06 10 05 30 00 11 29 00 bc e0 00 00 1a 01 01 00 80
    2017-03-12 13:36:31.596 [DEBUG] [tuwien.auto.calimero ] – KNXnet/IP Routing 224.0.23.12:3671: discard multicast loopback cEMI frame: L-Data.ind from 0.0.0 to 3/2/1, low priority hop count 6 tpdu 00 80

    1. Hi Thorsten,

      have you tried to increase the number of clients?

      /etc/default/knxd

      …. –client-addrs=1.1.129:16 …..

      I think my default value is choosen too small.

      Michael

      1. Hi Michael,

        my error: knx.cfg was configured to use the KNX gateway port 6720. After changing this to 3671 (and using TUNNEL instead of ROUTER connection type – with port 3671, TUNNELing works), openHAB successfully operates the roller shutter!

        Thanks again for your ultra-fast responses!

        Thorsten

  32. Hi Michael,

    thanks for the great work – the installation on a Raspberry Pi3 with busware TUL worked fine and the installation didn´t show an error-message.

    But when I try to see if the knxd runs the ps ax | grep knxd only provides:
    1604 pts/0 S+ 0:00 grep –color=auto knxd
    and
    root@RasPi:/home/pi# systemctl status knxd
    ● knxd.service
    Loaded: masked (/dev/null)
    Active: inactive (dead)

    checking on some logs/status doesn´t tell me much:
    /etc/default/knxd has the active line:
    # Serial device Raspberry
    KNXD_OPTIONS=”–eibaddr=1.0.1 –client-addrs=1.0.2:1 -d -D -T -R -S -i –listen-
    local=/tmp/knx -b tpuarts:/dev/ttyAMA0″

    root@RasPi:/dev# ls -als ttyA*
    0 crw-rw—- 1 root dialout 166, 0 Mär 19 21:17 ttyACM0
    0 crw-rw—- 1 root dialout 166, 1 Mär 19 21:17 ttyACM1
    0 crw-rw—- 1 root dialout 204, 64 Mär 19 21:17 ttyAMA0

    And as expected any connection to the KNX-Bus doesn´t work
    root@RasPi:~# knxtool busmonitor1 ip:localhost
    Open failed: Connection refused

    Any help welcome where to look into to figure out what is going on and what to fix.

    Thanks in advance

    Peter

  33. Hi Michael

    did some further test and trial after browsing through the Blog – the best result via manual start I could achieve so far is the follwing start&trace – but a parallel busmonitor call just hangs until ^C:

    pi@RasPi:/dev $ /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -t1023 -c -u /tmp/knx -p /run/knxd/knxd.pid -i -D -T -R -S –trace=5 –error=5 tpuarts:/dev/ttyAMA0
    [1] 1371
    pi@RasPi:/dev $ knxd: Layer 3 [ 2:layer3 0.000] Open
    knxd: Layer 3 [ 2:layer3 0.000] L3 started
    knxd: Layer 4 [ 3:cache 0.000] GroupCacheInit
    knxd: Layer 3 [ 2:layer3 0.001] registerLayer2 3:cache
    knxd: Layer 3 [ 2:layer3 0.001] registerLayer2 3:cache = 1
    knxd: Layer 4 [ 3:cache 0.001] GroupCacheEnable
    knxd: Layer 8 [ 4:/tmp/knx 0.001] OpenLocalSocket /tmp/knx
    knxd: Layer 8 [ 4:/tmp/knx 0.001] LocalSocket opened
    knxd: Layer 3 [ 2:layer3 0.001] registerLayer2 4:/tmp/knx
    knxd: Layer 3 [ 2:layer3 0.001] registerLayer2 4:/tmp/knx = 1
    knxd: Layer 8 [ 5:inet 0.001] OpenInetSocket 6720
    knxd: Layer 8 [ 5:inet 0.001] InetSocket opened
    knxd: Layer 3 [ 2:layer3 0.001] registerLayer2 5:inet
    knxd: Layer 3 [ 2:layer3 0.001] registerLayer2 5:inet = 1
    knxd: Layer 8 [ 6:mcast:knxd 0.001] Open
    knxd: Layer 0 [ 6:mcast:knxd 0.001] Open
    knxd: Layer 0 [ 6:mcast:knxd 0.001] Openend
    knxd: Layer 8 [ 6:mcast:knxd 0.001] OpenD
    knxd: Layer 8 [ 6:mcast:knxd 0.002] OpenedD
    knxd: Layer 8 [ 6:mcast:knxd 0.002] Opened
    knxd: Layer 3 [ 2:layer3 0.002] registerLayer2 6:mcast:knxd
    knxd: Layer 3 [ 2:layer3 0.002] registerLayer2 6:mcast:knxd = 1
    knxd: Layer 2 [ 7:tpuarts:/dev/ttyAMA0 0.002] Open
    knxd: Layer 2 [ 7:tpuarts:/dev/ttyAMA0 0.002] Open
    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 0.003] Opened /dev/ttyAMA0 with baud 19200
    knxd: Layer 2 [ 7:tpuarts:/dev/ttyAMA0 0.003] Openend
    knxd: Layer 2 [ 7:tpuarts:/dev/ttyAMA0 0.003] Buffer Setup
    knxd: Layer 3 [ 2:layer3 0.003] registerLayer2 7:tpuarts:/dev/ttyAMA0
    knxd: Layer 2 [ 7:tpuarts:/dev/ttyAMA0 0.003] open
    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 0.003] SendReset 01
    knxd: Layer 3 [ 2:layer3 0.003] registerLayer2 7:tpuarts:/dev/ttyAMA0 = 1
    knxd: Layer 0 [ 1:main 0.003] 0.12.15:776a315: /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -t1023 -c -u /tmp/knx -p /run/knxd/knxd.pid -i -D -T -R -S –trace=5 –error=5 tpuarts:/dev/ttyAMA0
    knxd: I00000000: 0.12.15:776a315: /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -t1023 -c -u /tmp/knx -p /run/knxd/knxd.pid -i -D -T -R -S –trace=5 –error=5 tpuarts:/dev/ttyAMA0
    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 0.600] SendReset 01
    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 1.201] SendReset 01
    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 1.802] SendReset 01


    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 51.059] SendReset 01
    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 51.660] SendReset 01
    knxd: Layer 8 [ 5:inet 51.820] New Connection
    knxd: Layer 8 [ 5:inet 51.820] ClientConnection Init
    knxd: Layer 8 [ 2:layer3 51.820] unknown addr 1.0.2
    knxd: Layer 3 [ 8:inet 51.821] Allocate 1.0.2
    knxd: Layer 0 [ 8:inet 51.821] ReadMessage(002): 00 11
    knxd: Layer 7 [ 9:inet:monitor 51.821] Open A_Busmonitor
    knxd: Layer 3 [ 2:layer3 51.821] registerBusmonitor 001774E8
    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 51.821] Send openBusmonitor 7EE37E6F
    knxd: Layer 3 [ 2:layer3 51.821] registerBusmontitr 001774E8 = 1
    knxd: Layer 0 [ 8:inet 51.821] Send(002): 00 11

    # Start from separate shell
    pi@RasPi:~ $ ps ax | grep knxd
    1371 pts/0 S 0:00 /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -t1023 -c -u /tmp/knx -p /run/knxd/knxd.pid -i -D -T -R -S –trace=5 –error=5 tpuarts:/dev/ttyAMA0
    1395 pts/1 S+ 0:00 grep –color=auto knxd

    pi@RasPi:~ $ knxtool busmonitor1 ip:localhost

    ^C

    knxd: Layer 8 [ 8:inet 101.558] ClientConnection 1.0.2 closing
    knxd: Layer 3 [ 2:layer3 101.558] Release 1.0.2
    knxd: Layer 7 [ 9:inet:monitor 101.558] Close A_Busmonitor
    knxd: Layer 2 [ 7:tpuarts:/dev/ttyAMA0 101.558] leaveBusmonitor
    knxd: Layer 2 [ 7:tpuarts:/dev/ttyAMA0 101.558] open
    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 101.558] SendReset 01
    knxd: Layer 3 [ 2:layer3 101.558] deregisterBusmonitor 001774E8 = 1
    knxd: Layer 0 [ 7:tpuarts:/dev/ttyAMA0 102.158] SendReset 01

    Hope this helps

    Peter

  34. Ciao Michael,

    that was quick – here is the log of dmesg – just can´t read it to understand which device is doing what:

    pi@RasPi:~ $ dmesg | grep tty
    [ 0.000000] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 dma.dmachans=0x7f35 bcm2709.boardrev=0xa02082 bcm2709.serial=0x60c987c2 bcm2709.uart_clock=48000000 smsc95xx.macaddr=B8:27:EB:C9:87:C2 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 enable_uart=1 dtoverlay=pi3-disable-bt console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
    [ 0.001350] console [tty1] enabled
    [ 1.007158] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
    [ 5.766001] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
    [ 5.767844] cdc_acm 1-1.4:1.2: ttyACM1: USB ACM device

    Thanks for your help

    Peter

  35. Ciao Michael

    changed tpuarts to ttyACM0 and it worked with this command directly:
    pi@RasPi:~ $ /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -p /run/knxd/knxd.pid -d -D -T -R -S -i -b tpuarts:/dev/ttyACM0
    pi@RasPi:~ $ knxtool groupsocketlisten ip:localhost
    Write from 1.1.123 to 2/1/34: 00
    Write from 1.1.106 to 1/1/10: 00

    But when I tried to start it as a service is tell me “masked” – Any idea ?

    pi@RasPi:~ $ sudo systemctl enable knxd.service
    Synchronizing state for knxd.service with sysvinit using update-rc.d…
    Executing /usr/sbin/update-rc.d knxd defaults
    Executing /usr/sbin/update-rc.d knxd enable

    pi@RasPi:~ $ sudo systemctl start knxd.service
    Failed to start knxd.service: Unit knxd.service is masked.
    pi@RasPi:~ $ sudo systemctl status knxd.service
    ● knxd.service
    Loaded: masked (/dev/null)
    Active: inactive (dead)

    Mär 20 23:56:21 RasPi systemd[1]: Stopped knxd.service.

    Any help welcome

    Peter

    1. Hi Peter,

      what says the log:

      sudo journalctl -xu knxd.service

      Try to unmask
      sudo systemctl unmask knxd.service

      and enable again
      sudo systemctl enable knxd.service

      Michael

  36. Hi Michael,

    pi@RasPi:~ $ sudo systemctl unmask knxd.service
    Removed symlink /etc/systemd/system/knxd.service.
    pi@RasPi:~ $ sudo systemctl enable knxd.service
    Synchronizing state for knxd.service with sysvinit using update-rc.d…
    Executing /usr/sbin/update-rc.d knxd defaults
    Executing /usr/sbin/update-rc.d knxd enable
    pi@RasPi:~ $ sudo systemctl start knxd.service
    Job for knxd.service failed. See ‘systemctl status knxd.service’ and ‘journalctl -xn’ for details.

    and then:
    Mär 22 08:31:36 RasPi systemd[1]: Starting KNX Daemon…
    — Subject: Unit knxd.service has begun with start-up
    — Defined-By: systemd
    — —
    — Unit knxd.service has begun starting up.
    Mär 22 08:31:36 RasPi systemd[1]: PID 2660 read from file /run/knxd/knxd.pid does not exist or is a zombie.
    Mär 22 08:31:36 RasPi systemd[1]: Failed to start KNX Daemon.
    — Subject: Unit knxd.service has failed
    — Defined-By: systemd

    — Unit knxd.service has failed.

    — The result is failed.
    Mär 22 08:31:36 RasPi systemd[1]: Unit knxd.service entered failed state.

    I know its cumbersome but may this have to do with access rights of users or groups ? –
    Thanks for your help

    Peter

    1. Hi Peter,

      access rights of users or groups => may be 🙂 have you you started knxd one time as root ?

      does /run/knxd/knxd.pid exists?

      ls -l /run/knxd/knxd.pid

      have you already rebooted your raspberry?

      Michael

  37. Hi Michael,

    Rebooted the Raspi, maybe I user root or sudo during installation or testing – that maybe the case – how do I found out if it created a problem?
    The folder /run/knxd exist for owner knxd and group knxd but it is empty and can only be accessed as user ‘su’ not as user ‘pi’ !
    When i try to start the systemctl start knxd.service it still shows the:
    Mär 22 18:15:12 RasPi systemd[1]: PID 2393 read from file /run/knxd/knxd.pid does not exist or is a zombie.
    Mär 22 18:15:12 RasPi systemd[1]: Failed to start KNX Daemon.
    message in the journalctl

    Is some process supposed to write such a pid file ? – does this fail ? –

    Best Regards

    Peter

  38. Hi Michael

    added the tracing to the /etc/defaul/knxd with -t1023 and I get a different log/behaviour after reboot and refreshing via “enable, start” of the service afterwards – maybe this gives a hint where the issue may be:

    pi@RasPi:~ $ sudo reboot
    pi@RasPi:~ $ sudo systemctl status knxd.service
    ● knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
    Active: failed (Result: exit-code) since Mit 2017-03-22 22:17:04 CET; 7min ago
    Process: 463 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=1/FAILURE)

    Mär 22 22:17:04 RasPi knxd[463]: knxd: Layer 8 [ 2:mcast:knxd 0.043] Open
    Mär 22 22:17:04 RasPi knxd[463]: knxd: Layer 0 [ 2:mcast:knxd 0.043] Open
    Mär 22 22:17:04 RasPi knxd[463]: knxd: Layer 0 [ 2:mcast:knxd 0.044] Openend
    Mär 22 22:17:04 RasPi knxd[463]: knxd: Layer 8 [ 2:mcast:knxd 0.044] OpenD
    Mär 22 22:17:04 RasPi knxd[463]: knxd: Layer 8 [ 2:mcast:knxd 0.044] CloseD
    Mär 22 22:17:04 RasPi knxd[463]: knxd: Layer 0 [ 2:mcast:knxd 0.044] Close
    Mär 22 22:17:04 RasPi knxd[463]: initialization of the EIBnet/IP server failed: No such device
    Mär 22 22:17:04 RasPi systemd[1]: knxd.service: control process exited, code=exited status=1
    Mär 22 22:17:04 RasPi systemd[1]: Failed to start KNX Daemon.
    Mär 22 22:17:04 RasPi systemd[1]: Unit knxd.service entered failed state.

    The try to restart:

    pi@RasPi:~ $ sudo systemctl stop knxd.service
    pi@RasPi:~ $ sudo systemctl daemon-reload
    pi@RasPi:~ $ sudo systemctl enable knxd.service
    Synchronizing state for knxd.service with sysvinit using update-rc.d…
    Executing /usr/sbin/update-rc.d knxd defaults
    Executing /usr/sbin/update-rc.d knxd enable
    pi@RasPi:~ $ sudo systemctl start knxd.service
    Job for knxd.service failed. See ‘systemctl status knxd.service’ and ‘journalctl -xn’ for details.
    pi@RasPi:~ $ sudo systemctl status knxd.service
    ● knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
    Active: failed (Result: resources) since Mit 2017-03-22 22:29:00 CET; 5s ago
    Process: 1586 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)

    Mär 22 22:29:00 RasPi knxd[1586]: knxd: Layer 0 [ 5:tpuarts:/dev/ttyACM0 0.002] Opening /dev/ttyACM0 failed: Permission denied
    Mär 22 22:29:00 RasPi knxd[1586]: knxd: Layer 3 [ 3:layer3 0.002] registerLayer2 5:tpuarts:/dev/ttyACM0
    Mär 22 22:29:00 RasPi knxd[1586]: knxd: Layer 2 [ 5:tpuarts:/dev/ttyACM0 0.002] open
    Mär 22 22:29:00 RasPi knxd[1586]: knxd: Layer 8 [ 5:tpuarts:/dev/ttyACM0 0.002] ser state 0>12
    Mär 22 22:29:00 RasPi knxd[1586]: knxd: Layer 8 [ 5:tpuarts:/dev/ttyACM0 0.002] ser state 0>5
    Mär 22 22:29:00 RasPi knxd[1586]: knxd: Layer 3 [ 3:layer3 0.003] registerLayer2 5:tpuarts:/dev/ttyACM0 = 1
    Mär 22 22:29:00 RasPi knxd[1586]: knxd: Layer 0 [ 1:main 0.003] 0.12.15:776a315: /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.0….dev/ttyACM0
    Mär 22 22:29:00 RasPi systemd[1]: PID 1588 read from file /run/knxd/knxd.pid does not exist or is a zombie.
    Mär 22 22:29:00 RasPi systemd[1]: Failed to start KNX Daemon.
    Mär 22 22:29:00 RasPi systemd[1]: Unit knxd.service entered failed state.

    It looks like there is either a problem with the availability of the ttyACM01 at reboot time or some access right to the ttyACM0 ??

    I do not know how to get more tracing/logs to really figure out what to try next:-(

    Thanks in advance

    Peter

    1. Hi Peter,

      Mär 22 22:17:04 RasPi knxd[463]: initialization of the EIBnet/IP server failed: No such device => Is your network properly configured? Have you set a static IP and is the Mulitcast Address 224.0.23.12/32 in place? Post the output of

      route

      Opening /dev/ttyACM0 failed: Permission denied => knxd starts as user knxd. What are the permission on ttyACM0

      ls -l /dev/ttyACM0

      Mär 22 22:29:00 RasPi systemd[1]: PID 1588 read from file /run/knxd/knxd.pid does not exist or is a zombie. => Permissions here?

      ls -l /run/

      Try to start knxd as User knxd in foreground. Start a shell as user knxd

      sudo su knxd -s /bin/sh

      and start knxd without daemonize (without -d) and see whats happend. Adjust the tracelevel…..

      /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -p /run/knxd/knxd.pid -D -T -R -S -i -b tpuarts:/dev/ttyACM0

      Michael

      1. Hi Michael,
        thank’s for your job.
        I can’t get busware tul to work on my new Raspberry Pi 4.
        This is the configuration:
        Release = Raspbian GNU/Linux 10 (buster)
        Kernel = Linux 4.19.93-v7l+
        Platform = Raspberry Pi 4 Model B Rev 1.1

        When I run the commands:
        pi@raspberrypi:~$ sudo su knxd -s /bin/sh
        $ /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -p /run/knxd/knxd.pid -t1022 -D -T -R -S -i -b tpuarts:/dev/ttyACM0

        I get:
        Layer 3 [ 4:server/Server 0.000] registerLink: 4:server
        Layer 3 [ 4:server/Server 0.007] Start: cfg:server
        Layer 5 [ 4:server/Server 0.007] down => >up
        Layer 8 [ 4:server/Server 0.007] Open
        Layer 8 [17:router/driver 0.007] OpenD
        Layer 8 [17:router/driver 0.008] OpenedD
        Layer 3 [16:router/ConnC 0.008] registerLink: 16:router_16
        Layer 3 [16:router/ConnC 0.008] Start: cfg:router
        Layer 5 [16:router/ConnC 0.008] down => >up
        Layer 5 [16:router/ConnC 0.008] Starting
        Layer 5 [16:router/ConnC 0.008] >up => up
        Layer 4 [16:router/ConnC 0.008] up
        Layer 5 [16:router/ConnC 0.008] Started
        Layer 4 [16:router/ConnC 0.008] up
        Layer 8 [ 4:server/Server 0.008] Opened
        Layer 5 [ 4:server/Server 0.008] >up => up
        Layer 4 [ 4:server/Server 0.008] up
        Layer 5 [ 4:server/Server 0.008] Started
        Layer 4 [ 4:server/Server 0.008] up
        Layer 6 [ 4:server/Server 0.015] is OK
        Layer 6 [16:router/ConnC 0.015] is OK
        Layer 6 [16:router/ConnC 23.996] sending, send_more clear
        Layer 1 [ 4:server/Server 23.996] Send(011): 29 00 B4 D0 10 14 0D F9 01 00 80
        Layer 2 [18:router.pace_/router 23.996] out 1/2: delay for 0.017 sec
        Layer 6 [ 4:server/Server 23.996] is OK
        Layer 6 [16:router/ConnC 23.996] still waiting
        Layer 2 [18:router.pace_/router 24.013] delay done
        Layer 6 [16:router/ConnC 24.013] sendNext called, send_more set
        Layer 6 [ 4:server/Server 24.013] is OK
        Layer 6 [16:router/ConnC 24.013] is OK
        Layer 6 [16:router/ConnC 32.994] sending, send_more clear
        Layer 1 [ 4:server/Server 32.994] Send(011): 29 00 B4 D0 10 17 0D F9 01 00 81
        Layer 2 [18:router.pace_/router 32.994] out 1/2: delay for 0.017 sec
        Layer 6 [ 4:server/Server 32.994] is OK
        Layer 6 [16:router/ConnC 32.994] still waiting
        Layer 2 [18:router.pace_/router 33.011] delay done
        Layer 6 [16:router/ConnC 33.011] sendNext called, send_more set
        Layer 6 [ 4:server/Server 33.011] is OK
        Layer 6 [16:router/ConnC 33.011] is OK
        Layer 6 [16:router/ConnC 58.930] sending, send_more clear
        Layer 1 [ 4:server/Server 58.930] Send(011): 29 00 B4 D0 10 1C 0E 21 01 00 80
        Layer 2 [18:router.pace_/router 58.930] out 1/2: delay for 0.017 sec
        Layer 6 [ 4:server/Server 58.930] is OK
        Layer 6 [16:router/ConnC 58.930] still waiting
        Layer 2 [18:router.pace_/router 58.947] delay done
        Layer 6 [16:router/ConnC 58.947] sendNext called, send_more set
        Layer 6 [ 4:server/Server 58.947] is OK
        Layer 6 [16:router/ConnC 58.947] is OK
        Layer 6 [16:router/ConnC 108.096] sending, send_more clear
        Layer 1 [ 4:server/Server 108.096] Send(011): 29 00 B4 D0 10 1A 0E 11 01 00 80
        Layer 2 [18:router.pace_/router 108.096] out 1/2: delay for 0.017 sec
        Layer 6 [ 4:server/Server 108.096] is OK
        Layer 6 [16:router/ConnC 108.096] still waiting
        Layer 2 [18:router.pace_/router 108.113] delay done
        Layer 6 [16:router/ConnC 108.113] sendNext called, send_more set
        Layer 6 [ 4:server/Server 108.113] is OK
        Layer 6 [16:router/ConnC 108.113] is OK

        But I can’t get openhab to work.
        Do you have any suggestions?

          1. Hi Michael,
            this is my knx.cfg file:
            ip=localhost
            ignorelocalevents=true
            type=TUNNEL
            localIp=192.168.1.6
            autoReconnectPeriod=30

            Thanks in advance

          2. Hi Gabriele,

            please set the port

            port=3671

            Does knxd runs on the same host as openhab? If yes, omit the localIP property. If it runs on a different host set

            ip=localhost

            to the correct IP Address

            Michael

          3. Hi Michael,
            I think that the problem is the same of Peter because the system work correctly when I run the command:

            /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -p /run/knxd/knxd.pid -d -D -T -R -S -i -b tpuarts:/dev/ttyACM0

            but dosn’t work when I try to start it as a service.
            The following configuration of /etc/default/knxd is correct?

            KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -D -T -R -S -i –liste$-listen-local=/tmp/knx -b tpuarts:/dev/ttyACM0″

            Thank you for your support.

          4. Hi Gabriele,

            reboot the system and check if knxd is not running. Then post the log getting by

            journalctl -xu knxd.service
            

            Michael

          5. Hi Michael,
            this is the result:
            [21:43:53] pi@raspberrypi:~$ journalctl -xu knxd.service
            — Logs begin at Sun 2020-02-16 15:25:57 CET, end at Wed 2020-02-19 21:51:00 CET. —
            Feb 16 15:26:00 raspberrypi systemd[1]: Starting KNX Daemon…
            — Subject: A start job for unit knxd.service has begun execution
            — Defined-By: systemd

            — A start job for unit knxd.service has begun execution.

            — The job identifier is 81.
            Feb 16 15:26:01 raspberrypi knxd[388]: E00000064: [19:router] router: setup router: failed
            Feb 16 15:26:01 raspberrypi knxd[388]: F00000105: [ 4:server] Link down, terminating
            Feb 16 15:26:01 raspberrypi systemd[1]: knxd.service: Control process exited, code=exited, status=1/FAILURE
            — Subject: Unit process exited
            — Defined-By: systemd

            — An ExecStart= process belonging to unit knxd.service has exited.

            — The process’ exit code is ‘exited’ and its exit status is 1.
            Feb 16 15:26:01 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-code’.
            — Subject: Unit failed
            — Defined-By: systemd

            — The unit knxd.service has entered the ‘failed’ state with result ‘exit-code’.
            Feb 16 15:26:01 raspberrypi systemd[1]: Failed to start KNX Daemon.
            — Subject: A start job for unit knxd.service has failed
            — Defined-By: systemd

            — A start job for unit knxd.service has finished with a failure.

            — The job identifier is 81 and the job result is failed.
            Feb 16 16:17:57 raspberrypi systemd[1]: Starting KNX Daemon…
            — Subject: A start job for unit knxd.service has begun execution
            — Defined-By: systemd

            — A start job for unit knxd.service has begun execution.

            — The job identifier is 457.
            Feb 16 16:19:27 raspberrypi systemd[1]: knxd.service: Start operation timed out. Terminating.
            Feb 16 16:19:27 raspberrypi systemd[1]: knxd.service: Failed with result ‘timeout’.
            — Subject: Unit failed
            — Defined-By: systemd

            — The unit knxd.service has entered the ‘failed’ state with result ‘timeout’.
            Feb 16 16:19:27 raspberrypi systemd[1]: Failed to start KNX Daemon.
            — Subject: A start job for unit knxd.service has failed
            — Defined-By: systemd

            — A start job for unit knxd.service has finished with a failure.

            — The job identifier is 457 and the job result is failed.

            I look forward to hearing from you.

            Best Regards,
            Gabriele

          6. Hi Michael,
            my raspberry is connected through the wired network. I have disabled both WiFi and Bluetooth connections.

            Gabriele

          7. Hi Gabriele,

            can you remove the Hash from line

            ExecStartPre=/lib/systemd/systemd-networkd-wait-online --timeout=60

            in file /lib/systemd/system/knxd.service. This tells the unit to wait until the Network is up.
            then reload config

            root@devdeb ~ # systemctl daemon-reload
            

            Michael

          8. Hi Michael,
            I followed your instructions, but after restarting the raspberry the problem persists and to make the system work I have to give the command:
            /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -p /run/knxd/knxd.pid -d -D -T -R -S -i -b tpuarts:/dev/ttyACM0
            do you have any ideas to solve the problem?

          9. Hi Gabriele,

            starts knxd when you tried to start it manually via systemctl?

            systemctl start knxd.service
            

            Michael

        1. Hi Michael,
          I try to execute the command, but the respons is the following:

          [18:27:27] pi@raspberrypi:~$ sudo systemctl start knxd.service
          Job for knxd.service failed because a timeout was exceeded.
          See “systemctl status knxd.service” and “journalctl -xe” for details.

          The result of “systemctl status knxd.service” is:

          ● knxd.service – KNX Daemon
          Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: ena
          Active: failed (Result: timeout) since Sat 2020-03-07 18:29:13 CET; 1min 58s
          Process: 3616 ExecStartPre=/lib/systemd/systemd-networkd-wait-online –timeout
          Process: 3617 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTION

          Mar 07 18:27:43 raspberrypi systemd[1]: Starting KNX Daemon…
          Mar 07 18:27:43 raspberrypi systemd-networkd-wait-online[3616]: ignoring: lo
          Mar 07 18:29:13 raspberrypi systemd[1]: knxd.service: Start operation timed out.
          Mar 07 18:29:13 raspberrypi systemd[1]: knxd.service: Failed with result ‘timeou
          Mar 07 18:29:13 raspberrypi systemd[1]: Failed to start KNX Daemon.

          Best Regards,
          Gabriele

          1. Hi Gabriele,

            it seems ExecStartPre=/lib/systemd/systemd-networkd-wait-online –timeout is only working if the network interface(s) are configuered by systemd rather then networkManager.

            try

            ExecStartPre=sleep 30

            Michael

  39. Hi Michael,

    I think we are getting close.

    Concerning the Multicast Address I do not get the point why I would need an external internet address 224.0.23.12/32 setup – so the Raspi is currnenty fixed to
    192.168.1.15 and I need this fixed for other services as well.
    pi@RasPi:~ $ route provides:
    Kernel-IP-Routentabelle
    Ziel Router Genmask Flags Metric Ref Use Iface
    default 192.168.1.1 0.0.0.0 UG 202 0 0 eth0
    192.168.1.0 * 255.255.255.0 U 202 0 0 eth0

    ip addr
    2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:c9:87:c2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.15/24 brd 192.168.1.255 scope global eth0
    valid_lft forever preferred_lft forever
    inet6 fe80::6ed8:459c:aee3:be6b/64 scope link
    valid_lft forever preferred_lft forever

    and therefore no file in /etc/systemd/network: ls -als

    4 drwxr-xr-x 2 root root 4096 Jan 24 2016 .
    4 drwxr-xr-x 6 root root 4096 Jan 29 10:35 ..

    Concerning the rights: – The /dev/ttyAMCO is owned by root ?
    root@RasPi:~# ls -l /dev/ttyACM0
    crw-rw—- 1 root dialout 166, 0 Mär 23 21:17 /dev/ttyACM0

    and the knxd is owned by “knxd”
    pi@RasPi:~ $ ls -l /run/
    drwxr–r– 2 knxd knxd 40 Mär 23 22:03 knxd

    The starting of the knxd is failing (as user “root” and “pi” it actually works fine!):

    root@RasPi:~# sudo su knxd -s /bin/sh
    $ /usr/local/bin/knxd -e 1.0.1 -E 1.0.2:8 -p /run/knxd/knxd.pid -t1022 -D -T -R -S -i -b tpuarts:/dev/ttyACM0
    knxd: Layer 8 [ 2:mcast:knxd 0.000] Open
    knxd: Layer 8 [ 2:mcast:knxd 0.000] OpenD
    knxd: Layer 8 [ 2:mcast:knxd 0.001] OpenedD
    knxd: Layer 8 [ 2:mcast:knxd 0.001] Opened
    knxd: Layer 3 [ 3:layer3 0.001] Open
    knxd: Layer 3 [ 3:layer3 0.001] L3 started
    knxd: Layer 3 [ 3:layer3 0.001] registerLayer2 2:mcast:knxd
    knxd: Layer 3 [ 3:layer3 0.001] registerLayer2 2:mcast:knxd = 1
    knxd: Layer 8 [ 4:inet 0.001] OpenInetSocket 6720
    knxd: Layer 8 [ 4:inet 0.002] InetSocket opened
    knxd: Layer 3 [ 3:layer3 0.002] registerLayer2 4:inet
    knxd: Layer 3 [ 3:layer3 0.002] registerLayer2 4:inet = 1
    knxd: Layer 2 [ 5:tpuarts:/dev/ttyACM0 0.002] Open
    knxd: Layer 2 [ 5:tpuarts:/dev/ttyACM0 0.002] Open
    knxd: Layer 8 [ 5:tpuarts:/dev/ttyACM0 0.002] ser state 0>2
    knxd: Layer 3 [ 3:layer3 0.002] registerLayer2 5:tpuarts:/dev/ttyACM0
    knxd: Layer 2 [ 5:tpuarts:/dev/ttyACM0 0.002] open
    knxd: Layer 8 [ 5:tpuarts:/dev/ttyACM0 0.002] ser state 0>12
    knxd: Layer 8 [ 5:tpuarts:/dev/ttyACM0 0.002] ser state 0>5
    knxd: Layer 3 [ 3:layer3 0.002] registerLayer2 5:tpuarts:/dev/ttyACM0 = 1
    Segmentation fault

    Do I need to get ttyACM0 owned by knxd ?? – I do not even know how to do this?
    Whatfor do I need such a strange Multicast address ?

    Warm Regards

    Peter

    1. Hi Peter,

      224.0.23.12/32 is not an external IP Address. This is a multicast address and only available in your local network. The router will not forward this address to the internet. Simple explaintation: Mulicast addresses are used when multiple computer should talk together means one of them sends and all other should receive the packets. knxd needs this for tunneling.

      Do I need to get ttyACM0 owned by knxd ?? => No, the dialout group has permissions to the serial devices. Add the user knxd to the dialout group (what my script does 🙂 )

      Michael

  40. Hi Michael,

    thanks – something new I learned – I´ve setup the network address as described and now route shows:
    pi@RasPi:~ $ route
    Kernel-IP-Routentabelle
    Ziel Router Genmask Flags Metric Ref Use Iface
    default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
    192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
    224.0.23.12 * 255.255.255.255 UH 0 0 0 eth0

    But after reboot the Raspi still showed the:
    knxd: Layer 0 [ 5:tpuarts:/dev/ttyACM0 0.040] Opening /dev/ttyACM0 failed: Permission denied

    I´ve used initially your install_knxd_systemd.sh script for installation and didn´t see an error-message.
    As a try I added user “knxd” again to the group “dialout” – now it works and all is fine

    Thanks for your help and patience

    Warm Regards

    Peter

  41. Hi Michael,

    all fine with knxd but with the changes in /etc/resolv.conf the raspi doesn´t find any DNS names anymore: but /run/systemd/resolve/resolv.conf shows:
    nameserver 62.202.44.223
    nameserver 62.2.121.84
    which should work – but any ping leads to “unknown host” – any idea why this shoudl be now broken with the setup I used at the beginning of your article?

    Any help welcome

    Peter

    1. Hi Peter,

      the link from /etc/resolv.conf to /run/systemd/resolve/resolv.conf exists?

      ls -l /etc/resolv.conf

      Nameserver are working? Whats output of (without the leading http:// WordPress add this):

      nslookup http://www.heise.de 62.202.44.223

      Michael

      1. Hi Michael,

        the links exists as
        pi@RasPi:~ $ ls -l /etc/resolv.conf
        lrwxrwxrwx 1 root root 24 Mär 24 09:20 /etc/resolv.conf -> /run/systemd/resolv.conf

        but nslookup is not installed “-bash: nslookup: Kommando nicht gefunden.”
        and without nameserver I can not update or download packages 🙁
        Is there another way to see if the nameserver is working – it seems that there is the issue.
        Regards
        Peter

  42. upgraded to raspberry2 with latest release, eibd 100% problem. used your guide to set knxd up, worked at the first try. thanks for this great guide and the greater script!!!

  43. Hi Michael,

    I am trying to set this up with a RPi, OpenhabianPi as the installed OS, and a Weinzierl module: knx-baos-module-838

    Any idea if this will work with that setup? Will the Weinzierl module work with the TPUART config as indicated in your guide?

    Thanks for all your help!

  44. hi Michael,

    many thanks for all your help!

    I’ve been trying this all day with no luck. Here are my outputs:
    [ 0.000000] Kernel command line: 8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa02082 bcm2709.serial=0xf42202f7 smsc95xx.macaddr=B8:27:EB:22:02:F7 bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3ea00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 enable_uart=1 dtoverlay=pi3-disable-bt console=tty1 elevator=deadline net.ifnames=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
    [ 0.001324] console [tty1] enabled
    [ 0.839357] 3f215040.uart: ttyS0 at MMIO 0x3f215040 (irq = 59, base_baud = 31250000) is a 16550
    [ 2.327040] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
    [ 9.391195] systemd[1]: Starting system-getty.slice.
    [ 9.395523] systemd[1]: Created slice system-getty.slice.

    /etc/default/knxd:

    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:10 -d -D -T -R -S -i –listen-local=/tmp/knx -b ft12cemi:/dev/ttyAMA0″

    (I tried changing this to ft12:/dev/ttyAMA0 and ft12cemi:/dev/ttyS0

    knxtool vbusmonitor1 ip:localhost
    and
    knxtool busmonitor1 ip:localhost

    provide no output or:
    Open Busmonitor failed: Device or resource busy

    I have ETS5 with the following settings:
    individual address:
    1.1.128
    server:
    192.168.178.2 (openhabianpi)
    port:
    6720

    any help would be greatly appreciated

  45. Thank you for this great tutorial!!

    My Setup:
    – Raspberry Pi Zero W
    – Abelelectronics Serial Pi Zero (Pi RS232 Extension Board)
    – Busch Jäger 6186 (RS232 EIB Interface)

    I’ve tried various config setting but I cant get any connection via knxtool busmonitor.

    I tried the following configurations:
    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:10 -d -D -T -R -S -i –listen-local=/tmp/knx -b ft12cemi:/dev/ttyAMA0″

    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:10 -d -D -T -R -S -i –listen-local=/tmp/knx -b ft12:/dev/ttyAMA0″

    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:10 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″

    but nothing seems to work

    What am I doing wrong? 🙁

    Thanks in advance,
    Jan

    1. Hi Jan,

      in my opinion you cannot couple a Busch Jäger 6186 (http://archiv.busch-jaeger-katalog.de/files/files_ONLINE/b_6186_20.pdf) interface with the Raspberry Pi. I think this interface is just speaking PEI 16 protocol not FT1.2 nor tpuart which are the minimum requierments to couple with an Raspberry because these two interfaces types are needing only the RxD and the TxD lines of the serial interface. As descripted in the Datasheet for 6186 an addional RTS Pin (may be for Handshake), which a raspberry does not provide, is requiered.

      Michael

  46. Hi Michael

    Wrote you a few month ago. But now i am in trouble again. I managed to set up the Connection for a few month now.
    Accidently after a restart now i am not able to read the Bus anymore. I can see telegrams in busmonitor1 but not in vbusmonitor1 anymore. The same for ETS and FHEM. It is still possible to write to the bus via ETS FHEM or Groupswrite but i dont recieve Telegrams from Light Switches not in vbusmonitor nor in ETS. Funny thing is that it was working yesterday. i tried to stop and start the service manualy without success.
    You mentioned that %DEVICEID is not correct here is the result of

    ps ax|grep knxd
    438 ? Ss 0:00 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx usb:%DEVICEID%
    914 pts/0 S+ 0:00 grep –color=auto knxd

    do you have any idea what i did wrong. i unplugged the system few days ago but it was working after that. I think i just switched off the System today to make some Installations and after that vbusmonitor was gone. Could it have something to do with the Problem the other Michael described. With the Substitution of USBID i am a total noob when it comes to debugging stuff like that.

  47. tried a little bit

    /usr/local/bin/knxd-findusb.sh

    the result is

    cat /etc/default/knxd
    # Command line parameters for knxd. TPUART Backend
    # Serial device Raspberry
    # KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx tpuarts:/dev/ttyAMA0″
    # Serial device PC
    # KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx tpuarts:/dev/ttyS0″
    # Tunnel Backend
    # KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx ipt:192.168.56.1″
    # USB Backend
    KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx usb:%DEVICEID%”

    route
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    default fritz.box 0.0.0.0 UG 0 0 0 eth0
    192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
    224.0.23.12 * 255.255.255.255 UH 0 0 0 eth0

    dmesg | grep tty
    [ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0xe bcm2708.serial=0xed82fb77 smsc95xx.macaddr=B8:27:EB:82:FB:77 bcm2708_fb.fbswap=1 bcm2708.uart_clock=3000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait fbcon=map:10 consoleblank=0
    [ 0.001388] console [tty1] enabled
    [ 0.204581] 20201000.uart: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2

  48. Sorry for spamming the last Info i could achieve was that. But i have no idea how to interpret that.

    sudo ls -l /dev/ttyAMA0
    crw-rw—- 1 root dialout 204, 64 May 2 23:38 /dev/ttyAMA0

  49. Okay Problem solved with ABB KNX USB Interface. I did a clean install of KNXD with your Script again and set the Option string in
    /etc/default/knxd manualy

    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:10 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:1:4:1:0:0″

    somehow this changed at some point cause at first i got %DEVICEID% behind the usb. So seems you already updated your Script to new circumstances in KNXD.
    I read out the Device ID by

    pi@raspberrypi:/usr/local/bin $ findknxusb

    In Github smurfix already got this problem with another guy on Github. Same Interface ABB and only vbusmonitor not working for switches.

    USB only as root working #204
    was the thread

    Somehow this problem got realy close to mine and seems not have been solved at this point in time i think. So in the end after 2 month your Script runs flawless. Thanks a lot for keeping this stuff up to date its a great for noobs like me.
    sorry for just posting my thoughts here feel free to erase that stuff Michael.

    Keep up that great work.

    1. Hi Philipp,

      newer Versions (the version the script installs, stable 0.12) of knxd does not need to specify the USB Address. knxd finds the device himself at startup:

      KNXD_OPTIONS=”–eibaddr=$EIB_ADDRESS_KNXD –client-addrs=$EIB_START_ADDRESS_CLIENTS_KNXD:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

      so simply leave the KNXD_OPTIONS line as it is 🙂

      Michael

  50. Hi Michael

    I have a Pi 3 running the latest openhabian and a TPUART GIRA Busankoppier 3. I cannot get the busmonitor to show any output so am doing something wrong.

    The only doubt I have is the wiring to the BTM. The BTM PIN numbers in your schematic diagram in the previous post don’t seem to match with the standard TP-UART spec published by siemens, PCBA_UP117-12_datasheet.pdf.

    Please can you explain the mapping of the BTM PINs in your schematic.

    many thanks
    Rich

    1. Hi Rich,

      as described in a previous comment:
      I used a standard pin header in the schematic and this has an different pin layout/couterwise then the TPUART Module:

      http://www.hqs.sbt.siemens.com/cps_product_data/gamma-b2b/PCBA_UP117-12_datasheet.pdf

      TPUART layout is

      10 9 8 7 6
      1 2 3 4 5
      | | | |

      while PIN Header is

      2 4 6 8 10
      1 3 5 7 9

      And therefore you have to translate
      Pin 1 TPUART is Pin 2 Pin Header
      Pin 2 TPUART is Pin 4 Pin Header
      Pin 4 TPUART is Pin 8 Pin Header
      Pin 5 TPUART is Pin 10 Pin Header

      Which interface do you use? A Siemens TPUART module or an Gria Busankoppler? In my opinion this is not the same.

      Michael

      1. Hi Michael.

        Thanks for the reply and posting the pin translation (again). My interpretation of the PIN translation was correct ….

        … but I was using the Gira Busankoppler. I swapped it for the Siemens TPUART and huzzah! All working now. Simple user error.

        I now know the Busankoppler and TPUART are not interchangeable!

  51. Hi Michael,
    Thanks for this post. It works great.
    I have a question: I am using an knx/ip interface which is configured with dhcp address. so when i am using the ipt=”x.x.x.x” it works fine as long as i know the IP address of the interface. Is there a way to instruct knxd to search for the knx/IP and automatically use it in the ipt param (e.g. ipt=auto)
    Thank you again for the great post
    David Anidjar

    1. Hi David,

      I think not because a Tunnel always ends in an unicast address and you need to know this address.

      Why not assiging a static IP Address?

      Michael

      1. Hi Michael,
        Thank you for your answer.
        I do not have ETS program nor I am familiar with it. I thought it would be a nice feature to have.
        By the way, the /tmp/knx Unix domain socket uses Knx/IP protocol?
        Thanks again

  52. Hi Micheal,
    I’m trying to use openhab2 on my knx home installation. I followed all your steps.
    My first Problem is, that I’m completey new to Linux and the second is when i type
    ps ax|grep knxd all i get is 1616 pts/0 S+ 0:00 grep knxd.
    I try to use the knxd on a raspberry pi 3 with raspbian and a Merten USB interface.

    Thanks in advance,
    Carsten

    1. Hi Carsten,

      it seems your knxd isn’t running. ps ax lists all running processes and it only founds the grep process with parameter knxd.

      Post the systemd log of the knxd.service:
      sudo journalctl -xu knxd

      Which interface do you use?

      Michael

      1. Hey Michael,
        thanks for the help.
        I’m using a Merten USB interface.
        This is what the log says:

        Logs begin at So 2017-07-30 20:56:01 CEST, end at Mo 2017-07-31 20:56:00 CEST
        Jul 30 20:56:04 raspberrypi systemd[1]: Starting KNX Daemon…
        — Subject: Unit knxd.service has begun with start-up
        — Defined-By: systemd


        — Unit knxd.service has begun starting up.
        Jul 30 20:56:05 raspberrypi knxd[506]: initialization of the EIBnet/IP server fa
        Jul 30 20:56:05 raspberrypi systemd[1]: knxd.service: control process exited, co
        Jul 30 20:56:05 raspberrypi systemd[1]: Failed to start KNX Daemon.
        — Subject: Unit knxd.service has failed
        — Defined-By: systemd


        — Unit knxd.service has failed.

        — The result is failed.

        ~
        — Logs begin at So 2017-07-30 20:56:01 CEST, end at Mo 2017-07-31 20:56:00 CEST
        Jul 30 20:56:04 raspberrypi systemd[1]: Starting KNX Daemon…
        — Subject: Unit knxd.service has begun with start-up
        — Defined-By: systemd


        — Unit knxd.service has begun starting up.
        Jul 30 20:56:05 raspberrypi knxd[506]: initialization of the EIBnet/IP server fa
        Jul 30 20:56:05 raspberrypi systemd[1]: knxd.service: control process exited, co
        Jul 30 20:56:05 raspberrypi systemd[1]: Failed to start KNX Daemon.
        — Subject: Unit knxd.service has failed
        — Defined-By: systemd


        — Unit knxd.service has failed.

        — The result is failed.
        Jul 30 20:56:05 raspberrypi systemd[1]: Unit knxd.service entered failed state.

        1. Hi Carsten,

          have you set a static IP Address?

          Jul 30 20:56:05 raspberrypi knxd[506]: initialization of the EIBnet/IP server fa => Means no Network interface (Multicast Address) is available.

          Have you tried to start knxd manually:

          sudo systemctl start knxd.service

          Michael

          1. Hey Michael,
            that was the fault, I set a static IP on the Pixel interface, doesn’t seem to work.
            Now I set the IP in the config and it works, great, thank you!

    1. Hi maxx,

      I assume want to establish a tunnel connection to an IP Gateway, right?

      Edit /etc/default/knxd

      Comment the tpuarts config line
      # KNXD_OPTIONS=”–eibaddr=….. -b tpuarts:/dev/ttyAMA0″

      and remove the comment character from the ipt line
      KNXD_OPTIONS=”–eibaddr= ….. -b ipt:192.168.56.1″

      replace the IP Address with the address your gateway.

      Michael

  53. Hi Michael,

    Installation works partly.

    What works: communication between homeserver and KNX

    Does not work:
    root@Raspberrypi:~# knxtool busmonitor1 ip:localhost
    Open Busmonitor failed: Connection reset by peer

    ETS5 it finds ip Tunneling, but no Connection possible.

    More Information:
    root@Raspberrypi:~# findknxusb
    Possible addresses for KNX USB devices:
    device: 1:4:1:0:0 (Gira Giersiepen GmbH & Co. KG:KNX-USB Data Interface)

  54. Hi! Trying to set this up, but starting to wondering if it is possible to set it up on an older Raspberry Pi Model B or not?

    If it is I am wondering about the “destination IP” that one needs to setup when assigning static IP. Where is this IP supposed to point to?

  55. Hi. I have problem with start knxd.service for KNX Usb interface. I get failed to start KNX Daemon. Content error:
    Aug 16 12:29:33 Hunter1 knxd[1053]: initialisation of backend ‘usb:1:4:1:0:0’ failed: Resource temporarily unavailable
    Aug 16 12:29:33 pi systemd[1]: knxd.service: control process exited, code=exited status=1
    Aug 16 12:29:33 pi systemd[1]: Failed to start KNX Daemon.
    Aug 16 12:29:33 pi systemd[1]: Unit knxd.service entered failed state.

    I try in Raspberry Pi 3 and don’t working…
    I setting inside file /etc/default/knxd:
    KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx usb:%DEVICEID%”

    And add file /usr/local/bin/knxd-findusb.sh to get serial address usb which join interface KNX/USB

    1. Hi bmcor,

      which Version of the script did you use? In 0.76 findusb.sh is no longer necessary, knxd finds an available KNX device. The config line for USB in the latest version of the script in /etc/default/knxd is like:

      # KNXD_OPTIONS=”–eibaddr=$EIB_ADDRESS_KNXD –client-addrs=$EIB_START_ADDRESS_CLIENTS_KNXD:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

      Please retry it with the current version of the script.

      Michael

  56. Hi Michael,
    I used script with link in your post.
    # Michael Albert
    # 09.06.2016
    # Changes
    # Version: 0.1
    # This is the first release of the try to install knxd
    # Currently state is experimental

      1. Yes, I used this link.
        Now, I installed knxd and started daemon knxd.service:
        1590 ? Ss 0:00 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:
        1593 pts/0 S+ 0:00 grep knxd

        Daemon:
        Active: active (running) since Wed 2017-08-16 15:20:11 CEST; 6s ago
        Process: 1588 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)
        Main PID: 1590 (knxd)
        CGroup: /system.slice/knxd.service
        └─1590 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:

        But, when i want use knxtool busmonitor1 ip:localhost get fail:
        Open Busmonitor failed: Connection reset by peer

        1. Hi Michael,
          I installed new image for rapsberry pi 3 and used your script to configuration.
          Now, when I want to run knxd.service I getting error and I can’t to start knxd.service.
          And I don’t now where is problem…
          Content:
          Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
          Active: failed (Result: exit-code) since Thu 2017-08-17 09:53:47 UTC; 10s ago
          Process: 576 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=1/FAILURE)
          Main PID: 441 (code=exited, status=0/SUCCESS)
          Aug 17 09:53:47 raspberrypi knxd[576]: initialisation of backend ‘usb:’ failed: Resource temporarily unavailable
          Aug 17 09:53:47 raspberrypi systemd[1]: knxd.service: control process exited, code=exited status=1
          Aug 17 09:53:47 raspberrypi systemd[1]: Failed to start KNX Daemon.
          Aug 17 09:53:47 raspberrypi systemd[1]: Unit knxd.service entered failed state.

          1. Hi bmcor,

            is your USB device recognized? Whats the output of command

            sudo lsusb

            respectivily

            dmesg | grep -i usb

            Michael

          2. root@raspberrypi:~# sudo lsusb
            Bus 001 Device 006: ID 135e:0024
            Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
            Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
            Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

            root@raspberrypi:~# dmesg | grep -i usb
            [ 0.152192] usbcore: registered new interface driver usbfs
            [ 0.152292] usbcore: registered new interface driver hub
            [ 0.152407] usbcore: registered new device driver usb
            [ 0.314939] usbcore: registered new interface driver smsc95xx
            [ 0.787697] dwc_otg 3f980000.usb: DWC OTG Controller
            [ 0.790014] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
            [ 0.792399] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
            [ 0.799371] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
            [ 0.801704] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
            [ 0.804012] usb usb1: Product: DWC OTG Controller
            [ 0.806262] usb usb1: Manufacturer: Linux 4.9.43-v7+ dwc_otg_hcd
            [ 0.808532] usb usb1: SerialNumber: 3f980000.usb
            [ 0.811617] hub 1-0:1.0: USB hub found
            [ 0.816796] usbcore: registered new interface driver usb-storage
            [ 0.844876] usbcore: registered new interface driver usbhid
            [ 0.847308] usbhid: USB HID core driver
            [ 1.231209] usb 1-1: new high-speed USB device number 2 using dwc_otg
            [ 1.460745] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
            [ 1.463247] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
            [ 1.466505] hub 1-1:1.0: USB hub found
            [ 1.790510] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
            [ 1.930791] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
            [ 1.933363] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
            [ 2.044219] smsc95xx 1-1.1:1.0 eth0: register ‘smsc95xx’ at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:b2:44:22
            [ 2.140464] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
            [ 2.680510] usb 1-1.2: device not accepting address 4, error -32
            [ 3.020596] usb 1-1.2: new full-speed USB device number 6 using dwc_otg
            [ 3.171293] usb 1-1.2: New USB device found, idVendor=135e, idProduct=0024
            [ 3.171311] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
            [ 3.171319] usb 1-1.2: Product: KNX-USB Data Interface
            [ 3.171326] usb 1-1.2: Manufacturer: Merten GmbH & Co. KG
            [ 3.184121] hid-generic 0003:135E:0024.0001: hiddev0,hidraw0: USB HID v1.01 Device [Merten GmbH & Co. KG KNX-USB Data Interface] on usb-3f980000.usb-1.2/input0

          3. I see joined knx-usb interface. When use findknxusb i getted:
            root@raspberrypi:~# findknxusb
            Possible addresses for KNX USB devices:
            device: 1:6:1:0:0 (Merten GmbH & Co. KG:KNX-USB Data Interface)

          4. Hi bmcor,

            whats happend when you try to start knxd manually:

            systemctl start knxd.service
            journalctl -xu knxd.service
            knxd –version

            Michael

  57. Hi Michael you made an amazing work !

    When I want to see if packet on the bus it’s said connection refused. I tried manually to launch the usb but doesn’t work too.

    I tried this command systemctl start knxd.service and this is the answer.
    Aug 18 06:50:55 raspberrypi knxd[514]: initialization of the EIBnet/IP server failed: No such device
    Aug 18 06:50:55 raspberrypi systemd[1]: knxd.service: control process exited, code=exited status=1
    Aug 18 06:50:55 raspberrypi systemd[1]: Failed to start KNX Daemon.
    — Subject: Unit knxd.service has failed
    — Defined-By: systemd


    — Unit knxd.service has failed.

    — The result is failed.
    Aug 18 06:50:55 raspberrypi systemd[1]: Unit knxd.service entered failed state.
    Aug 18 06:58:30 raspberrypi systemd[1]: Starting KNX Daemon…
    — Subject: Unit knxd.service has begun with start-up
    — Defined-By: systemd

    I don’t understand the problem. I read the other comments with people who had the same problem and maybe my problem comes to my static IP?

    I wrote this in my dhcpcd.conf :
    nterface eth0
    static ip_address=10.108.146.55/24
    static routers=10.108.146.1
    static domain_name_servers=8.8.8.8 8.8.4.4
    # Route for Multicast Address EIB/KNX
    [Route]
    Destination=224.0.23.12/32

    I follow an other tutorial because when i follow yours after the reboot i lost all the connection ethernet and wifi on my rpi 3.

    Do you have some idea on my issue?
    Regards

    1. Oh i just re-installed and it’s semi works I have :
      root@raspberrypi:/home/pi# knxtool busmonitor1 ip:localhost
      LPDU: 03 :Unknown LPDU: 03

      But I thinks is my data on the bus which are false and not knxd, right?

    2. Hi Marc,

      initialization of the EIBnet/IP server failed: No such device => Means no device with a route to the mulicast Address 224.0.23.12 is found. Check with

      route -n

      This is usually a problem if some network interfaces uses dhcp instead of a static ip address. knxd starts before the interface is ready.

      Michael

      1. Thanks for the fast reply !

        I follow your tutorial to set a static address and now the deamon is running but I lost my internet connection and I don’t know if it’s normal like dhcpcd is disable?

        1. Now I can see the data on the bus thanks knxtool busmonitor1 ip:localhost. It’s work !
          However I would like to switch on/off the light thanks to the rpi but when i used this commands :
          knxtool on ip:localhost 0/0/1 it’s reply connect failed : connection reset by peer.

          and if I use knxtool groupswrite ip:localhost 0/0/1 1
          Nothing happening in real

          Some idea on the problem?

  58. Hi Michael
    Now everything is working, i can manage the bus from OpenHAB but just for a few second. I don’t know why but the knxd connection stop itself after 10/15s and if i reboot it’s working again for few seconds (i can send 2/3 commands and after it’s stop). Some ideas ?

    Regards

  59. Hello Michael,
    and Thanks for your work!
    I Use you tutorial and everything work correctly… for 1 min and 30 sec.

    I restart knxd with:
    sudo systemctl restart knxd.service
    and I can work for another 1 minute and 30 seconds then I get the error:

    Job for knxd.service failed. See ‘systemctl status knxd.service’ and ‘journalctl -xn’ for details.

    sudo systemctl status knxd.service
    * knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
    Active: failed (Result: timeout) since lun 2017-08-28 16:14:14 CEST; 3min 26s ago
    Process: 1221 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)

    ago 28 16:14:13 raspberrypi systemd[1]: knxd.service start operation timed out. Terminating.
    ago 28 16:14:14 raspberrypi systemd[1]: Failed to start KNX Daemon.
    ago 28 16:14:14 raspberrypi systemd[1]: Unit knxd.service entered failed state.

    Many thanks if you can help me.

    Bye,
    marco

    1. Hello Michael,
      I have downloaded the last RASPBIAN STRETCH LITE, and executed the steps of your post to use systemd, then executed the script V0.7.7 on a raspberry zero W.
      I have the same problem of my previous post: when I restart the knxd service, it work for 1 min and 30 sec, then it stop.
      I tryed with an ABB USB/S1.1 interface and with an GWA9705 IP Interface, but in both case, I have the timeout of 1 min and 30 sec.
      Can you give me some ideas to try to solve?
      Many Thanks.

        1. Hello Michael,

          When I use the ABB USB/S1.1 interface, I use the option:
          # USB Backend
          KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

          if I manually execute the i ./usr/local/bin/findknxusb i receive:
          device: 1:2:1:0:0 (ABB STOTZ-KONTAKT GmbH:KNX-USB Interface (MDRC)

          When I use the Gewiss GWA9705 IP Interface, I use the option:
          KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:1 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.1.145″

          Thanks,
          Marco

          1. Hi Marco,

            try to start knxd with logging at command line. Change to user knxd

            su knxd -s /bin/bash

            and start knxd with logging/tracing

            knxd -t 1023 –eibaddr=1.1.128 –client-addrs=1.1.129:1 -D -T -R -S -i –listen-local=/tmp/knx -t -1023 -b usb:

            Do you see some hints why knxd terminates?
            Michael

          2. Hi Marco,

            I’ve investigated and there are some changes since 0.14 regarding process start of knxd. The systemd startup forking does not working anymore. I’ve updated the script to Version 0.7.8.

            Please let me know if this works for you.

            Michael

          3. Hello Michael,
            1)
            when I try:
            su knxd -s /bin/bash
            a password for knxd is required: I try with knxd, raspberry, empty, ma no one is correct (whitch is the correct one?)

            2)
            I executed the script V0.7.8, and:
            after the reboot, the service is stopped, but if I execute:
            sudo systemctl restart knxd.service, everything work correctly.

            This is the sudo systemctl status knxd.service immediatly after reboot:

            pi@raspberrypi:~ $ sudo systemctl status knxd.service
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
            Active: failed (Result: signal) since Mon 2017-09-18 21:36:04 UTC; 2min 55s ago
            Process: 313 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=killed, signal=ABRT)
            Main PID: 313 (code=killed, signal=ABRT)

            Sep 18 21:36:03 raspberrypi systemd[1]: Started KNX Daemon.
            Sep 18 21:36:04 raspberrypi knxd[313]: E00000032: [20:router] router: setup router: failed
            Sep 18 21:36:04 raspberrypi knxd[313]: F00000000: [ 4:server] Link down, terminating
            Sep 18 21:36:04 raspberrypi systemd[1]: knxd.service: Main process exited, code=killed, status=6/ABRT
            Sep 18 21:36:04 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 18 21:36:04 raspberrypi systemd[1]: knxd.service: Failed with result ‘signal’.
            pi@raspberrypi:~ $

            Thank
            Marco

          4. Hi Marco,

            “router: setup router: failed” => As describted in the post. Have you set a static IP Address in particulally the route for the multicast address in your network config?


            [Route]
            Destination=224.0.23.12/32

            When you try to run knxd as router the route for the multicast address is essential.

            “Link down” Or your network interface isn’t ready yet. Back to “Have you set a static IP Address”…. 🙂

            Michael

          5. Sossy Michael, but after some minutes of correct working, I get the error:

            pi@raspberrypi:~ $ knxtool off ip:localhost 1/5/201
            Open failed: Connection refused

            And this is the sudo systemctl status knxd.service:

            pi@raspberrypi:~ $ sudo systemctl status knxd.service
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
            Active: failed (Result: exit-code) since Mon 2017-09-18 21:52:52 UTC; 21s ago
            Process: 509 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=1/FAILURE)
            Main PID: 509 (code=exited, status=1/FAILURE)

            Sep 18 21:44:13 raspberrypi systemd[1]: Started KNX Daemon.
            Sep 18 21:52:52 raspberrypi knxd[509]: F00000035: [18:C.usb] Send while buffer not empty
            Sep 18 21:52:52 raspberrypi knxd[509]: F00000000: [15:C.usb] Link down, terminating
            Sep 18 21:52:52 raspberrypi knxd[509]: E00000035: [18:C.usb] SendError 20013f0 status 3
            Sep 18 21:52:52 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=1/FAILURE
            Sep 18 21:52:52 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 18 21:52:52 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-code’.
            pi@raspberrypi:~ $

            Bye,
            Marco

          6. Hi Marco,

            ” [15:C.usb] Link down” seems to be a problem with your USB Interface. You have written you also have a IP Router. Runs knxd stable when you connect to the ipt: backend instead of the USB device?

            Do see you a USB disconnect message in kernel log/messages at the same time knxd terminates? Type command:

            dmesg

            This is only working if knxd is running:
            pi@raspberrypi:~ $ knxtool off ip:localhost 1/5/201
            Open failed: Connection refused

            On the same host you can also connect to the SOCKET
            knxtool vbusmonitor1 local:/tmp/knx

            Michael

          7. Hi Michael,
            with IP interface, I have only problem after reboot.
            After Reboot the knxd is stopped.
            Is I restart with
            sudo systemctl restart knxd.service
            everything work properly (I have tested for 5 or 6 hours without any problems).

            This is the error immediatly after reboot (with KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.1.145″):

            pi@raspberrypi:~ $ sudo systemctl status knxd.service
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
            Active: failed (Result: exit-code) since Tue 2017-09-19 19:42:32 UTC; 2min 30s ago
            Process: 312 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=1/FAILURE)
            Main PID: 312 (code=exited, status=1/FAILURE)

            Sep 19 19:42:31 raspberrypi systemd[1]: Started KNX Daemon.
            Sep 19 19:42:32 raspberrypi knxd[312]: E00000032: [19:router] router: setup router: failed
            Sep 19 19:42:32 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=1/FAILURE
            Sep 19 19:42:32 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 19 19:42:32 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-code’.
            pi@raspberrypi:~ $

            Of couse I have in the /etc/systemd/network/wlan0.network the:
            [Route]
            Destination=224.0.23.12/32

            Bye,
            Marco

          8. Hi Marco,

            knxd terminates because the wlan interface isn’t ready. Please edit /lib/systemd/system/knxd.service and change the Unit section:
            [Unit]
            Description=KNX Daemon
            Requires=network-online.target
            After=network.target

            Then reload daemon config

            sudo systemctl daemon-reload

            Michael

          9. Hi Michael,
            I add the
            Requires=network-online.target
            in the file /lib/systemd/system/knxd.service, and reloaded the demon,
            but after reboot I alway get the error:

            pi@raspberrypi:~ $ sudo systemctl status knxd.service
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
            Active: failed (Result: exit-code) since Wed 2017-09-20 13:13:25 UTC; 49s ago
            Process: 311 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=1/FAILURE)
            Main PID: 311 (code=exited, status=1/FAILURE)

            Sep 20 13:13:24 raspberrypi systemd[1]: Started KNX Daemon.
            Sep 20 13:13:25 raspberrypi knxd[311]: E00000032: [19:router] router: setup router: failed
            Sep 20 13:13:25 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=1/FAILURE
            Sep 20 13:13:25 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 20 13:13:25 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-code’.
            pi@raspberrypi:~ $

            The system work correctly if I start the knxd manually with
            sudo systemctl start knxd.service

            Bye,
            Marco

          10. Hi Marco,

            ok, it seems wlan0 is still not ready. Make the following changes:

            Enable the systemd network wait online service
            systemctl enable systemd-networkd-wait-online.service

            Then edit the file /lib/systemd/system/knxd.service
            Insert the ExecStartPre right before ExecStart line, replace wlan0 with your interface name. Something like this:

            [Unit]
            Description=KNX Daemon
            Requires=network-online.target
            After=network.target

            [Service]
            EnvironmentFile=/etc/default/knxd
            ExecStartPre=/lib/systemd/systemd-networkd-wait-online --interface=wlan0 --timeout=60
            ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS
            Type=simple
            PIDFile=/run/knxd/knxd.pid
            User=knxd
            Group=knxd

            [Install]
            WantedBy=multi-user.target

            and reload config
            systemctl daemon-reload
            Michael

          11. Hi Michael,
            many tanks for you exemplary support.
            Now everything work!

            Instead of
            ExecStartPre=/lib/systemd/systemd-networkd-wait-online –interface=wlan0 –timeout=60
            I used
            ExecStartPre=/bin/sleep 10
            because the systemd-networkd-wait-online give me some errors…

            Thanks a lot.
            Bye
            Marco

  60. Hello Michael,

    thanks a lot for that great script.

    I tried to run your script (Version 0.7.6 19.02.2017) on a Raspberry 3 running Raspbian Stretch with Desktop (Release date: 2017-09-07, Kernel version: 4.9) and it terminated with following error:

    Paket libsystemd-daemon-dev ist nicht verfügbar, wird aber von einem anderen Paket
    referenziert. Das kann heißen, dass das Paket fehlt, dass es abgelöst
    wurde oder nur aus einer anderen Quelle verfügbar ist.
    Doch die folgenden Pakete ersetzen es:
    libsystemd-dev

    E: Für Paket »libsystemd-daemon-dev« existiert kein Installationskandidat.
    E: Paket libsystemd-daemon0 kann nicht gefunden werden.

    What am I doing wrong?

    Thanks in advance,
    Andre

  61. Hi Michael,

    thanks for your extremely quick first feedback!

    A year ago I used your ‘old’ script for EIBD on my RPI B+ and this installation works absolute fine up to now.
    Now I have to upgrade to RPI 3 and spent hours to get KNXD running but without success – hope you will find what’s wrong.

    Thanks for your efforts,
    Andre

    1. Hi Andre,

      I’ve already updated the script with the adjustments for Stretch in July, but forgotten to upload 🙁

      Version is 0.7.7 now.

      Let me know if it works.

      Michael

  62. Hi Michael,

    Many Thanks for your effort.
    I really don’t want to bother you. But I’m struggling with the set up for my USB knxd for days.

    Using:
    KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:1:4:1:0:0″
    I’m always getting:

    pi@raspberrypi:/usr/local/bin $ sudo systemctl status knxd.service
    ● knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
    Active: failed (Result: exit-code) since Di 2017-09-19 08:43:17 CEST; 7s ago
    Process: 5035 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=2)

    Sep 19 08:43:17 raspberrypi knxd[5035]: Too many arguments for usb!
    Sep 19 08:43:17 raspberrypi knxd[5035]: E00000055: [ 1:main] There is no KNX addr= in section ‘main’.
    Sep 19 08:43:17 raspberrypi knxd[5035]: F00000000: [ 1:main] Error setting up the KNX router.
    Sep 19 08:43:17 raspberrypi systemd[1]: knxd.service: control process exited, code=exited status=2
    Sep 19 08:43:17 raspberrypi systemd[1]: Failed to start KNX Daemon.
    Sep 19 08:43:17 raspberrypi systemd[1]: Unit knxd.service entered failed state.

    I tried different combinations for KNXD options. But I don’t understand what “Too many arguments for usb” is about.

    Any help will be appreciated.

    Best regards
    Dirk

    1. Hi Dirk,

      which version of knxd have you running? Check with

      knxd –version

      Newer Versions, imo >0.12, does not need a device address as argument of usb:

      Simply define

      KNXD_OPTIONS=”–eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:″

      and knxd is looking for a appropriated device.

      Michael

      1. Thanks Michael,

        I’m using
        pi@raspberrypi:/usr/local/bin $ knxd –version
        knxd 0.14.18:ef3c496
        Usage: knxd configfile [main_section]

        But when I leave the usb address empty I’m getting a timed out error:
        pi@raspberrypi:/usr/local/bin $ sudo systemctl status knxd.service
        ● knxd.service – KNX Daemon
        Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
        Active: failed (Result: timeout) since Di 2017-09-19 09:35:17 CEST; 10s ago
        Process: 5394 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)

        Sep 19 09:35:17 raspberrypi systemd[1]: knxd.service start operation timed out. Terminating.
        Sep 19 09:35:17 raspberrypi systemd[1]: Failed to start KNX Daemon.
        Sep 19 09:35:17 raspberrypi systemd[1]: Unit knxd.service entered failed state.

        But findknxusb is working fine:
        pi@raspberrypi:/usr/local/bin $ findknxusb
        Possible addresses for KNX USB devices:
        device: 1:4:1:0:0 (Gira Giersiepen GmbH & Co. KG:KNX-USB Data Interface)

        Dirk

        1. Hi Dirk,

          “knxd.service start operation timed out. Terminating.” Due to a change in process start since Version 0.14 the systemd type in /lib/systemd/system/knxd.service has to altered:

          from
          Type=forking

          to
          Type=simple

          then reload config

          systemctl daemon-reload
          systemctl start knxd

          Also your option line in /etc/default/knxd must have –client-addrs parameter:
          KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″

          Michael

  63. Hi,
    So i tried your Script again, this time like you recommended the knxd instead of the eibd, and this time I managed to kill my Network connection somehow. I was initially connected to my Raspberry Pi using VNC before. After a lot of mesing around I managed to get a Static I.P. set up and VNC running.
    SO since I was worried about losing this connection I decided to follow all your steps that came after the Network Setup, and decided to do the network setup at the end, once i have everything installed. Everything worked out fine it seems, only when I did do the Network setup, something seemed to go wrong.
    I created a file exactly like you said, only using my I.P. Settings::

    [Match]
    # You can also use wildcards. Maybe you want enable dhcp
    # an all eth* NICs
    Name=eth0
    [Network]
    #DHCP=v4
    # static IP
    # 192.168.100.2 netmask 255.255.255.0
    Address=192.168.0.222/24
    Gateway=192.168.0.1
    DNS=192.168.0.1
    # Route for Multicast Address EIB/KNX
    [Route]
    Destination=224.0.23.12/32

    Then I followed the steps::

    1root@raspberry:~# mv /etc/network/interfaces /etc/network/interfaces.save
    2root@raspberry:~# systemctl enable systemd-networkd.service
    3root@raspberry:~# systemctl enable systemd-resolved.service
    4root@raspberry:~# systemctl start systemd-resolved.service
    5root@raspberry:~# systemctl disable dhcpcd.service

    Set an link from the system wide resolve.conf to systemd
    1root@raspberry:~# mv /etc/resolv.conf /etc/resolv.conf.save
    2root@raspberry:~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

    Reboot to get the config active
    1root@raspberry:~# reboot

    Now I cant connect over VNC anymore, so I hooked up a Monitor and Keyboard/Mouse.
    At the top of the screen, when I MouseOver the Network symbol it says::
    “dhcpcd lost” which it should say since we want a static I.P. but I have no Internet Connection at all. When I right-click and click “Wireless&Wired Network Settings” nothing happens at all. When I left-click on the Network Symbol it says::
    “No wireless interfaces found”
    I assume he is trying to connect over wireless even though I dont have Wireless, but I cant get into the Settings anymore to make any changes either, and since I have very little knowledge regarding Raspberry Pi I wouldnt know what to edit or do to fix the problem.
    Any ideas on what went wrong or how to fix the problem?
    Thanks for your help and time!

    1. Hi Holo,

      you should use a terminal 🙂 to determine your IP Address. Open a terminal

      ifconfig

      shows your IP Address. Then test the connection from your PC

      ping IPAddressDeterminedFromRaspberry

      Whats the IP Address of your PC?

      Michael

      1. Thanks for th help!
        I used the terminal and the command “ifconfig” and I got::
        lo: flags =73 mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10
        loop txqueuelen 1 (Local Loopback)
        RX packets 13 bytes 772 (772.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 13 bytes 772 (772.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

        Thats why the Ethernet connection isnt working i presume, if my I.P adress is:: 127.0.0.1
        and subnet: 255.0.0.0
        then im in the wrong address area, but in the File I had created I have::
        [Match]
        name=eth0
        [Network]
        #DHCP=v4
        # static IP
        # 192.168.100.2 netmask 255.255.255.0
        Address=192.168.0.222/24
        Gateway=192.168.0.1
        DNS=192.168.0.1
        # Route for Multicast Address EIB/KNX
        [Route]
        Destination=224.0.23.12/32

        With this IP it should work fine

        On my Laptop I got:: 192.168.0.162
        Setting up VNC shouldn’t be a problem, once the Network Connection on the Pi is working again properly.

        1. Hi Holo,

          your IP Address isn’t set properly. 127.0.0.1 is the loopback address which is available on all systems.

          Is the network interface recognized by the kernel:

          dmesg|grep eth

          Is the networking.service started?

          sudo systemctl status networking.service

          Try to bring up the interface manually
          sudo ifconfig eth0 up
          sudo ifconfig eth0 192.168.0.222 netmask 255.255.255.0

          and check from your PC if it is available
          ping 192.168.0.222

          Michael

          1. Hi,
            So i am moving along slowly, but surely. Well I clearly had F*!$ed something up with my Network settings and kept getting errors. I just did a complete clean swipe of everything and started from step 1: Installing Raspbian fresh and updating everything.
            I completed all your steps now, and in my task bar it shows me that I am not connected to the Internet, but I clearly am, and I managed to Ping my I.P. successfully from my Laptop. So I don’t really care what it shows me since I clearly have a connection, and a fixed I.P. or I wouldnt be writing you now.
            I commented out the TPUART line and commented in the USB line. and I can find my USB Device using “findknxusb”
            I just haven’t figured out how to connect to it or send anything over it yet via USB. I didn’t figure out how to activate the busmonitor, since the command “knxtool busmonitor1” expects “local:” or “ip:” and I dont know what to write. If you could maybe help me along that would be great! I’m already happy to have gotten this far finally, since it seems like everything is working fine, other than me being to dumb to use it properly 🙂
            Thanks a lot for your help so far.

          2. Hi Holo,

            I do not use a Desktop Environment, imo the task bar in any GUI needs the NetworkManager running in background, but we have configured the network manually. So do not trust the GUI in this case 🙂 ping is always your friend to check network connectivity 🙂

            To connect via knxtool you can use the socket

            knxtool vbusmonitor1 local:/tmp/knx

            or the localhost (127.0.0.1)

            knxtool vbusmonitor1 ip:localhost

            Michael

          3. Hi,
            I tried that now, but when I run ” knxtool vbusmonitor1 local:/tmp/knx”, then I get :”Open failed: No such file or directory”. When I run “knxtool vbusmonitor1 ip:localhost”/”knxtool vbusmonitor1 ip:127.0.0.1” then I get : “Open failed: Connection refused”
            When using “busmonitor1” instead of “vbusmonitor1” i get the same result.
            I tried running “sudo systemctl start knxd” to make sure its running but I dont get feedback.
            when I run “findknxusb”, I get : “device: 1:7:1:0:0 (Siemens:N 148/12 KNX Interface)”.
            Dont have a I.P. Interface, only a USB Interface.
            At one part you wrote:
            After installing you have to decide which interfaces you want to use(Default TPUARTS at /dev/ttyAMA0). With this configuration knxd must come up after a reboot because knxd could check if a TPUART module is present.
            When I run “ps ax|grep knxd” I get: “3001 pts/0 S+ 0:00 grep knxd”

            I am using a Pi 2 Model B v1.1 is that a problem?
            Feeling kind of lost now.

          4. Hi Holo

            ”Open failed: No such file or directory”. When I run “knxtool vbusmonitor1 ip:localhost”/”knxtool vbusmonitor1 ip:127.0.0.1” then I get : “Open failed: Connection refused” => Your knxd isn’t running.

            Check systemd and its journal about the knxd state:

            sudo systemctl status knxd.service
            sudo journalctl -xu knxd.service

            What’s the content of your config file:

            cat /etc/default/knxd

            Michael

          5. When I input “sudo systemctl status knxd.service” I got::
            knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
            Active: failed (Result: signal) since Fri 2017-09-22 11:12:10 CEST: 2h 18min ago
            Process: 2839 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=killed, signal=SEGV)
            Main PID: 2839 (code=killed, signal=SEGV)

            Sep 22 11:12:10 raspberrypi system[1]: Started KNX Daemon.
            Sep 22 11:12:10 raspberrypi system[1]: knxd.service: Main process exited, code=killed, status=11/SEGV
            Sep 22 11:12:10 raspberrypi system[1]: knxd.service: Unit entered failed state.
            Sep 22 11:12:10 raspberrypi system[1]: knxd.service: Failed with result ‘signal’.

            when I Input “cat /etc/default/knxd” I got::
            # Command line parameters for knxd, TPUART Backend
            # Serial device Raspberry
            # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
            # Serial device PC
            # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
            # Tunnel Backend
            # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
            # USB Backend
            # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

          6. Hi Holo,

            you have nothing configured 🙂 If you have a tpuart module conneted remove the leading # character from the line

            KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″

            Michael

          7. Hi Michael,
            Sorry that was a typing mistake I made, I meant to use the USB device, now I took out the “#” from the USB line but now now I am getting this.
            This is what I get from: “sudo systemctl status knxd.service”
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
            Active: failed (Result: signal) since Mon 2017-09-25 07:41:43 CEST; 3min 9s ago
            Process: 6259 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=k
            Main PID: 6259 (code=killed, signal=SEGV)

            Sep 25 07:41:43 raspberrypi systemd[1]: Started KNX Daemon.
            Sep 25 07:41:43 raspberrypi knxd[6259]: libusb: error [_get_usbfs_fd] libusb couldn’t ope
            Sep 25 07:41:43 raspberrypi knxd[6259]: libusb: error [_get_usbfs_fd] libusb requires wri
            Sep 25 07:41:43 raspberrypi knxd[6259]: E00000032: [15:C.usb] C.usb: setup C.usb: failed
            Sep 25 07:41:43 raspberrypi systemd[1]: knxd.service: Main process exited, code=killed, s
            Sep 25 07:41:43 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 25 07:41:43 raspberrypi systemd[1]: knxd.service: Failed with result ‘signal’.

            This is what i get from: “sudo journalctl -xu knxd.service”
            — Logs begin at Thu 2016-11-03 18:16:43 CET, end at Mon 2017-09-25 07:46:33 CEST. —
            Sep 21 14:45:30 raspberrypi systemd[1]: Started KNX Daemon.
            — Subject: Unit knxd.service has finished start-up
            — Defined-By: systemd


            — Unit knxd.service has finished starting up.

            — The start-up result is done.
            Sep 21 14:45:30 raspberrypi knxd[366]: libusb: error [_get_usbfs_fd] libusb couldn’t open
            Sep 21 14:45:30 raspberrypi systemd[1]: knxd.service: Main process exited, code=killed, s
            Sep 21 14:45:30 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 21 14:45:30 raspberrypi systemd[1]: knxd.service: Failed with result ‘signal’.
            Sep 21 14:56:52 raspberrypi systemd[1]: Started KNX Daemon.
            — Subject: Unit knxd.service has finished start-up
            — Defined-By: systemd


            — Unit knxd.service has finished starting up.

            — The start-up result is done.
            Sep 21 14:56:52 raspberrypi knxd[1055]: libusb: error [_get_usbfs_fd] libusb couldn’t ope
            Sep 21 14:56:52 raspberrypi knxd[1055]: libusb: error [_get_usbfs_fd] libusb requires wri
            Sep 21 14:56:52 raspberrypi knxd[1055]: E00000032: [15:C.usb] C.usb: setup C.usb: failed
            Sep 21 14:56:52 raspberrypi systemd[1]: knxd.service: Main process exited, code=killed, s
            Sep 21 14:56:52 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 21 14:56:52 raspberrypi systemd[1]: knxd.service: Failed with result ‘signal’.
            Sep 22 11:12:10 raspberrypi systemd[1]: Started KNX Daemon.
            lines 1-28

            And this is what i have set up because I only have a USB Interface: “cat /etc/default/knxd”
            # Command line parameters for knxd. TPUART Backend
            # Serial device Raspberry
            # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
            # Serial device PC
            # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
            # Tunnel Backend
            # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
            # USB Backend
            KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

            Thanks for trying to help me out!! I really appreciate it.

          8. Hi Holo,

            can you execute findknxusb as user knxd please :

            # Make root
            sudo su
            # switch to user knxd
            su knxd -s /bin/bash
            # execute
            findknxusb

            Is a device recognized?

            Which USB Device ID has the device:

            lsusb
            lsusb -n

            Michael

          9. HI,
            No it doesn’t find the USB device when I do that.
            root@raspberrypi:/home/pi# sudo su
            root@raspberrypi:/home/pi# su knxd -s /bin/bash
            knxd@raspberrypi:/home/pi$ findknxusb
            Possible addresses for KNX USB devices:
            knxd@raspberrypi:/home/pi$

            knxd@raspberrypi:/home/pi$ lsusb
            Bus 001 Device 008: ID 0908:02dd Siemens AG
            Bus 001 Device 006: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
            Bus 001 Device 004: ID 046d:c03d Logitech, Inc. M-BT96a Pilot Optical Mouse
            Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
            Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
            Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
            The Siemens Device is the KNX Interface I am using; Bus 001 Device 008: ID 0908:02dd Siemens AG

          10. HI Holo,

            ok, edit /etc/udev/rules.d/90-knxusb-devices.rules add the following 2 lines at the end of file

            # Siemens 148/12 KNX Interface
            SUBSYSTEM==”usb”, ATTR{idVendor}==”0908″, ATTR{idProduct}==”02dd”, ACTION==”add”, GROUP=”knxd”, MODE=”0664″

            restart linux and try to start knxd again.

            Michael

          11. HI,
            I added the code to the file but still nothing 🙁 Added the code and restarted the Pi.
            then ran:
            pi@raspberrypi:~ $ sudo su
            root@raspberrypi:/home/pi# sudo systemctl start knxd
            root@raspberrypi:/home/pi# sudo systemctl status knxd.service
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: ena
            Active: failed (Result: exit-code) since Mon 2017-09-25 13:08:28 CEST; 52s ag
            Process: 1450 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTION
            Main PID: 1450 (code=exited, status=1/FAILURE)

            Sep 25 13:08:11 raspberrypi systemd[1]: Started KNX Daemon.
            Sep 25 13:08:18 raspberrypi knxd[1450]: E00000000: [23:C.usb] EMI_common: send w
            Sep 25 13:08:28 raspberrypi knxd[1450]: E00000055: [15:C.usb] Driver timed out t
            Sep 25 13:08:28 raspberrypi systemd[1]: knxd.service: Main process exited, code=
            Sep 25 13:08:28 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 25 13:08:28 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-c
            It seems to me that the KNXD isn’t starting or running properly still, but I got further regarding the Interface.
            Ok, well i have been doing a lot of research now and I have the feeling the problem could be coming from the USB Interface too. In the ETS 4 the Siemens USB Interface doesnt work either, only in ETS 5 and my older interface from ABB, works with ETS 4 and not with ETS 5. So now I hooked up my older USB Interface and tried the steps from before:
            # Make root
            sudo su
            # switch to user knxd
            su knxd -s /bin/bash
            # execute
            findknxusb
            And I get
            knxd@raspberrypi:/home/pi$ findknxusb
            Possible addresses for KNX USB devices:
            device: 1:7:1:0:0 (ABB STOTZ-KONTAKT GmbH:KNX-USB Interface (MDRC))
            when I run:
            root@raspberrypi:/home/pi# lsusb
            Bus 001 Device 006: ID 147b:5120
            Bus 001 Device 005: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
            Bus 001 Device 004: ID 046d:c03d Logitech, Inc. M-BT96a Pilot Optical Mouse
            Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
            Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
            Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

            So it seems that he recognises the ABB STOTZ interface, so I will continue using the ABB Interface for this. But I still cant get the knxd to run properly, I keep getting

            root@raspberrypi:/home/pi# sudo systemctl start knxd

            root@raspberrypi:/home/pi# sudo systemctl status knxd.service
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: ena
            Active: failed (Result: exit-code) since Mon 2017-09-25 13:39:10 CEST; 5min a
            Process: 675 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS
            Main PID: 675 (code=exited, status=1/FAILURE)

            Sep 25 13:38:45 raspberrypi systemd[1]: Started KNX Daemon.
            Sep 25 13:39:10 raspberrypi knxd[675]: F00000035: [18:C.usb] Send while buffer n
            Sep 25 13:39:10 raspberrypi knxd[675]: F00000000: [15:C.usb] Link down, terminat
            Sep 25 13:39:10 raspberrypi knxd[675]: E00000035: [18:C.usb] SendError 181dcc8 s
            Sep 25 13:39:10 raspberrypi systemd[1]: knxd.service: Main process exited, code=
            Sep 25 13:39:10 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 25 13:39:10 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-c
            lines 1-13/13 (END)…skipping…
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
            Active: failed (Result: exit-code) since Mon 2017-09-25 13:39:10 CEST; 5min ago
            Process: 675 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exi
            Main PID: 675 (code=exited, status=1/FAILURE)

            Sep 25 13:38:45 raspberrypi systemd[1]: Started KNX Daemon.
            Sep 25 13:39:10 raspberrypi knxd[675]: F00000035: [18:C.usb] Send while buffer not empty
            Sep 25 13:39:10 raspberrypi knxd[675]: F00000000: [15:C.usb] Link down, terminating
            Sep 25 13:39:10 raspberrypi knxd[675]: E00000035: [18:C.usb] SendError 181dcc8 status 3
            Sep 25 13:39:10 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, st
            Sep 25 13:39:10 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
            Sep 25 13:39:10 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-code’.
            root@raspberrypi:/home/pi# knxtool vbusmonitor1 ip:localhost
            Open failed: Connection refused
            root@raspberrypi:/home/pi# knxtool vbusmonitor1 local:/tmp/knx
            Open failed: No such file or directory

          12. Hi Holo,

            this seems to be a bug in knxd:
            Sep 25 13:39:10 raspberrypi knxd[675]: F00000035: [18:C.usb] Send while buffer n
            Sep 25 13:39:10 raspberrypi knxd[675]: F00000000: [15:C.usb] Link down, terminat
            Sep 25 13:39:10 raspberrypi knxd[675]: E00000035: [18:C.usb] SendError 181dcc8 s

            Are you at the latest version:

            knxd –version

            Michael

          13. HI,
            Not sure if its the newest version. 0.14.18?
            root@raspberrypi:/home/pi# knxd –version
            knxd 0.14.18:ef3c496
            Usage: knxd configfile [main_section]
            Please consult /usr/share/doc/knxd/inifile.rst

          14. Hi Michael!
            Got some more info for you 🙂 I am happy to say that this morning I thought I would give it another shot. So my results were the following:
            root@raspberrypi:/home/pi# sudo systemctl status knxd.service
            ● knxd.service – KNX Daemon
            Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
            Active: active (running) since Tue 2017-09-26 07:41:34 CEST; 2s ago
            Main PID: 2213 (knxd)
            CGroup: /system.slice/knxd.service
            └─2213 /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:

            Sep 26 07:41:34 raspberrypi systemd[1]: Started KNX Daemon.
            root@raspberrypi:/home/pi# knxtool vbusmonitor1 local:/tmp/knx
            Open failed: No such file or directory
            root@raspberrypi:/home/pi# sudo systemctl start knxd
            root@raspberrypi:/home/pi# knxtool vbusmonitor1 local:/tmp/knx
            LPDU: BC FF 02 22 05 E1 00 80 F8 :L_Data low from 15.15.2 to 4/2/5 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF 02 22 06 E1 00 80 FB :L_Data low from 15.15.2 to 4/2/6 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF 02 22 09 E1 00 80 F4 :L_Data low from 15.15.2 to 4/2/9 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF FF ED 00 E1 00 80 CF :L_Data low from 15.15.255 to 29/5/0 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF 02 22 05 E1 00 80 F8 :L_Data low from 15.15.2 to 4/2/5 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF 02 22 06 E1 00 80 FB :L_Data low from 15.15.2 to 4/2/6 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF 02 22 09 E1 00 80 F4 :L_Data low from 15.15.2 to 4/2/9 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF FF ED 00 E1 00 81 CE :L_Data low from 15.15.255 to 29/5/0 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 01
            LPDU: BC FF 02 22 09 E1 00 80 F4 :L_Data low from 15.15.2 to 4/2/9 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF 02 22 05 E1 00 80 F8 :L_Data low from 15.15.2 to 4/2/5 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF 02 22 06 E1 00 80 FB :L_Data low from 15.15.2 to 4/2/6 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            LPDU: BC FF FF ED 00 E1 00 80 CF :L_Data low from 15.15.255 to 29/5/0 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            Read failed: Connection reset by peer

            It might seem weird because it is. But it turns out that knxd actually manages to run now for a very short time. It varies but in general it stays Active for about 2- 10 seconds. So if I am fast enough and Start knxd manually and then the busmonitor, I actually get telegrams over my ABB USB Interface for a little while before the knxd gets terminated for some reason. Do you have any ideas what could cause the knxd to crash/ stop? The message was : “Read failed: Connection reset by peer”. Does this have to do with the knxd version?
            Really happy to have gotten at least this far 🙂

          15. Hi Holo,

            The message was : “Read failed: Connection reset by peer” => This happens when knxd terminates. Then the connection resets. This is not the root cause.

            knxd runs in generally. Version 0.14.18:ef3c496 is ok too. Its the current stable release.

            This seems to be a bug in knxd. I’m not deep in programming to debug such an issue. I

            The behaviour that knxd terminates in reproduceable. I’m I right? I think you have to open an issue at the knxd project page https://github.com/knxd/knxd/issues. They need some logs/logfiles as input. First run knxd in foreground with tracing enabled:

            sudo su
            systemctl stop knxd.service
            # Switch to user knxd
            su knxd -s /bin/bash
            # Start in Foreground (without -d option) with logging
            knxd -t 1023 --eibaddr=1.1.128 --client-addrs=1.1.129:8 -D -T -R -S -i --listen-local=/tmp/knx -t 1023 -b usb:

            And look for errors at the console right before knxd (linux console prompt cames back) terminates. Then open an issue at https://github.com/knxd/knxd/issues. You can also ask for support or experiences for the Siemens N148 Interface.

            Michael

          16. Hi Michael,
            Thanks a lot for your help. Looks like the connection times out at one point, and terminates the connection. The Driver times out trying to Send for some reason.
            “E00000055: [15:C.usb] Driver timed out trying to send (C.usb)”
            I will see what I can do, or who could possibly help me from here.
            Thanks again for all the Support!!

          17. Hi Holo,

            you’re welcome 🙂 . Please open an issue at the project page to improve knxd. Hope the guys can fix it.

            If you need further support when the developer needs additional details for feel free to ask 🙂

            Michael

  64. Hi Michael,

    First of all thank you for the great script. The script runs perfect but I have a problem with the detect of my Pigator (busware). knxd service does not start. I use the default config with the serial port configuration of the raspi.

    pi@raspberrypi:~ $ sudo systemctl status knxd.service
    ● knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Sun 2017-09-24 20:43:38 UTC; 6min ago
    Process: 456 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=2)
    Main PID: 456 (code=exited, status=2)

    Sep 24 20:43:38 raspberrypi systemd[1]: Started KNX Daemon.
    Sep 24 20:43:38 raspberrypi knxd[456]: I don’t know of options for tpuart
    Sep 24 20:43:38 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
    Sep 24 20:43:38 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
    Sep 24 20:43:38 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-code’.

    pi@raspberrypi:~ $ sudo journalctl -xu knxd.service
    — Logs begin at Thu 2016-11-03 17:16:42 UTC, end at Sun 2017-09-24 20:50:16 UTC. —
    Sep 24 20:43:38 raspberrypi systemd[1]: Started KNX Daemon.
    — Subject: Unit knxd.service has finished start-up
    — Defined-By: systemd

    — Unit knxd.service has finished starting up.

    — The start-up result is done.
    Sep 24 20:43:38 raspberrypi knxd[456]: I don’t know of options for tpuart
    Sep 24 20:43:38 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
    Sep 24 20:43:38 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
    Sep 24 20:43:38 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-code’.
    pi@raspberrypi:~ $

  65. Hi Michael,

    Thank you for the fast response. That was also my first idea. I didn’t touch this file because the standard configuration should fit in my case.

    # Command line parameters for knxd. TPUART Backend
    # Serial device Raspberry
    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
    # Serial device PC
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
    # Tunnel Backend
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
    # USB Backend
    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

    1. Hi alc,

      can you try to start knxd at command line:

      sudo su
      systemctl stop knxd.service
      # Switch to user knxd
      su knxd -s /bin/bash
      # Start in Foreground (without -d option) with logging
      knxd --eibaddr=1.1.128 --client-addrs=1.1.129:8 -D -T -R -S -i --listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0

      Michael

      1. Hi Michael,

        Today I started from scratch but I have still problems.
        The status of the knxd service is now:

        root@raspberrypi:/home/pi# sudo systemctl status knxd.service
        ● knxd.service – KNX Daemon
        Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: ena
        Active: failed (Result: exit-code) since Wed 2017-09-27 18:46:54 UTC; 2min 15
        Process: 457 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS
        Main PID: 457 (code=exited, status=1/FAILURE)

        Sep 27 18:46:53 raspberrypi systemd[1]: Started KNX Daemon.
        Sep 27 18:46:54 raspberrypi knxd[457]: E00000023: [18:C.tpuarts] Communication e
        Sep 27 18:46:54 raspberrypi systemd[1]: knxd.service: Main process exited, code=
        Sep 27 18:46:54 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
        Sep 27 18:46:54 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-c

        I also tried to start knxd at command line:
        knxd@raspberrypi:/home/pi$ knxd –eibaddr=1.1.128 –client-addrs=1.1.129:8 -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0
        E00000022: [18:C.tpuarts] Opening /dev/ttyAMA0 failed: Permission denied
        F00000000: [15:C.tpuarts] Link down, terminating

  66. after many months of struggling with this I finally got it to work. Setup:

    Rapsberry Pi 3 with Weinzierl kBerry 838 KNX module, running openHabian Pi

    The setup was actually quite simple:

    Install openHabian

    Run the config file and install knxd:
    sudo openhabian-config
    Option 20 → 27

    Edit the knxd config file: vi /etc/default/knxd and set options:
    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ft12cemi:/dev/ttyAMA0″

    Disable bluetooth:
    vi /boot/config.txt
    Add to the end of the file:
    dtoverlay=pi3-disable-bt

    disconnect the BT modem from the UART:
    sudo systemctl disable hciuart
    (not sure if this is necessary)

    Reboot

    1. Update: everything is working with openhab as it should, I am able to control the various devices in my home.

      Programming with ETS5 however is not working. I have two discovered interfaces (multicast address and IP of RPi) and I am able to connect to both of them. Connecting to the multicast address I am not seeing any activity on the bus when reading devices. With a direct connection to the IP with IP tunneling i can see packets on the bus, but I am unable to read/write any devices. The individual address keeps rotating between 1.1.129 to 1.1.136 and i am unable to read any device info. I read somewhere on the various forums the ETS5 is not compatible with ft12cemi, can you confirm?

  67. Hi Michael,

    Now knxd runs at my pi. Now i have only one problem an this is at the startup of my pi that knxd service fails when I restart the service everthing works perfekt any idea to fis this issue ?

    at startup:
    pi@raspberrypi:~ $ sudo journalctl -xu knxd.service
    — Logs begin at Thu 2016-11-03 17:16:42 UTC, end at Sun 2017-10-22 11:36:13 UTC. —
    Oct 22 11:28:26 raspberrypi systemd[1]: Started KNX Daemon.
    — Subject: Unit knxd.service has finished start-up
    — Defined-By: systemd

    — Unit knxd.service has finished starting up.

    — The start-up result is done.
    Oct 22 11:28:26 raspberrypi knxd[458]: E00000032: [20:router] router: setup router: failed
    Oct 22 11:28:26 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=1/FAILURE
    Oct 22 11:28:26 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
    Oct 22 11:28:26 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-code’.

    after service restart:
    pi@raspberrypi:~ $ sudo journalctl -xu knxd.service
    — Logs begin at Thu 2016-11-03 17:16:42 UTC, end at Sun 2017-10-22 11:36:55 UTC. —
    Oct 22 11:28:26 raspberrypi systemd[1]: Started KNX Daemon.
    — Subject: Unit knxd.service has finished start-up
    — Defined-By: systemd

    — Unit knxd.service has finished starting up.

    — The start-up result is done.
    Oct 22 11:28:26 raspberrypi knxd[458]: E00000032: [20:router] router: setup router: failed
    Oct 22 11:28:26 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=1/FAILURE
    Oct 22 11:28:26 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
    Oct 22 11:28:26 raspberrypi systemd[1]: knxd.service: Failed with result ‘exit-code’.
    Oct 22 11:36:51 raspberrypi systemd[1]: Started KNX Daemon.
    — Subject: Unit knxd.service has finished start-up
    — Defined-By: systemd

    — Unit knxd.service has finished starting up.

    — The start-up result is done.

    1. Hi Alc,

      which version of the script did you use? In the latest version I have added a additional dependency in /lib/systemd/system/knxd.service

      [Install]
      WantedBy=multi-user.target network-online.target

      so knxd will wait for start until network is completely up.

      Michael

  68. Hi,
    i just made a new installation of the last openhabianpi image including knxd install. When i try to start it, the following error occurs, any idea?

    knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
    Active: failed (Result: exit-code) since Wed 2017-11-01 12:02:49 CET; 12s ago
    Process: 17340 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=1/FAILURE)
    Main PID: 17340 (code=exited, status=1/FAILURE)

    Nov 01 12:02:46 openHABianPi systemd[1]: Started KNX Daemon.
    Nov 01 12:02:49 openHABianPi knxd[17340]: F00000000: [15:C.tpuarts] Link down, terminating
    Nov 01 12:02:49 openHABianPi systemd[1]: knxd.service: main process exited, code=exited, status=1/FAILURE
    Nov 01 12:02:49 openHABianPi systemd[1]: Unit knxd.service entered failed state.

  69. Hi Micheal,

    In the description you write

    “When your operating system is up, login as user pi and set a static IP Address to ensure the gateway is always reachable at the same IP Address.”

    Is this necessary for the KNX deamon to work or just for convenience of the user?

    You can alway’s find and connect to the RPi by it’s name (f.i. knxserver.local)

    Waiting for the download of jessie and then I give your script a try!!

    Regards,

    Willem

  70. Hello again Micheal,

    After I get the knx installed in my raspberry pi 3 and changed the interface in the /etc/default/knxd file, when i tried to watch the bus, the next message show up
    Open failed: Connection refused.

    Can you please help me trying to figure out to do this right.

    Thanks a lot

    root@raspberrypi:~# ls -l /usr/local/bin
    total 12912
    -rwxr-xr-x 1 root staff 23532 Nov 20 16:58 findknxusb
    -rwxr-xr-x 1 root staff 13108352 Nov 20 16:58 knxd
    -rwxr-xr-x 1 root staff 84696 Nov 20 16:58 knxtool

    root@raspberrypi:~# ls -l /etc/systemd/system/multi-user.target.wants/knxd.service
    lrwxrwxrwx 1 root root 32 Nov 20 16:58 /etc/systemd/system/multi-user.target.wants/knxd.service -> /lib/systemd/system/knxd.service

    root@raspberrypi:~# ps ax|grep knxd
    1119 pts/0 S+ 0:00 grep knxd

    root@raspberrypi:~# findknxusb
    Possible addresses for KNX USB devices:
    device: 1:4:1:0:0 (Merten GmbH & Co. KG:KNX-USB Data Interface)

    root@raspberrypi:~# knxtool vbusmonitor1 ip:localhost
    Open failed: Connection refused

      1. Hello Michael,

        this is the content of /etc/default/knxd

        # Command line parameters for knxd. TPUART Backend
        # Serial device Raspberry
        # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
        # Serial device PC
        # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
        # Tunnel Backend
        # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
        # USB Backend
        KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

        Diogo

          1. I think that this is working now at least when write the command busmonitor1 the error doesn’t show up, I can’t confirm it now because the the project that i’m working on is in my University.

            You can expect a donation if this work 😀

  71. Hi Michael,

    if you thinks that the following questions are off-topic, please feel free to ignore this post.

    I have installed knxd on my Raspian in RP3 using KNX-USB Interface “ABB STOTZ-KONTAKT GmbH” it does not work sending bindings. Good sending telegrams with “knxtool groupswrite ip:localhost 4/0/1 1”

    I work knxd well sending telegrams with “knxtool groupswrite ip:localhost 4/0/1 1”

    > pi@raspberrypi:~ $ ps ax|grep knxd
    > 1319 ? Ssl 0:00 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 –client-addrs=1.1.129:16 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:
    > 1341 pts/0 S+ 0:00 grep –color=auto knxd
    >pi@raspberrypi:~ $ knxtool vbusmonitor1 ip:localhost
    >LPDU: BC 11 82 20 01 E1 00 81 91 :L_Data low from 1.1.130 to 4/0/1 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 01

    Connect a BUS KNX OK but not work he telegrams sent from openhab2.
    They are sent correctly but not received by the USB gateway.
    > 2017-11-27 12:37:06.294 [INFO ] [nx.internal.connection.KNXConnection] – Established connection to KNX bus on 224.0.23.12:3671 in mode ROUTER.

    I think something must have in the routing.

    I have tried all the options of the messages above and it does not work.

    My IP data: /etc/systemd/network/eth0.network

    [Match]
    # You can also use wildcards. Maybe you want enable dhcp
    # an all eth* NICs
    Name=eth0
    [Network]
    #DHCP=v4
    # static IP
    # 192.168.1.250 netmask 255.255.255.0
    Address=192.168.1.250/24
    Gateway=192.168.1.10
    DNS=80.58.61.254 8.8.8.8
    # Route for Multicast Address EIB/KNX
    [Route]
    Destination=224.0.23.12/32

    >pi@raspberrypi:~ $ ifconfig
    > eth0: flags=4163 mtu 1500
    > inet 192.168.1.250 netmask 255.255.255.0 broadcast 192.168.1.255
    > inet6 fe80::ba27:ebff:feb5:bfd7 prefixlen 64 scopeid 0x20
    > ether b8:27:eb:b5:bf:d7 txqueuelen 1000 (Ethernet)
    > RX packets 18635 bytes 2159944 (2.0 MiB)
    > RX errors 0 dropped 2 overruns 0 frame 0
    > TX packets 1263 bytes 183220 (178.9 KiB)
    > TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    pi@raspberrypi:~ $ dmesg|grep eth
    [ 1.954250] smsc95xx 1-1.1:1.0 eth0: register ‘smsc95xx’ at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:b5:bf:d7
    [ 4.913742] smsc95xx 1-1.1:1.0 eth0: hardware isn’t capable of remote wakeup
    [ 4.914258] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [ 6.501103] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    [ 6.504633] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
    > pi@raspberrypi:~ $ route
    > Kernel IP routing table
    > Destination Gateway Genmask Flags Metric Ref Use Iface
    > default 192.168.1.10 0.0.0.0 UG 0 0 0 eth0
    > 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    > 224.0.23.12 0.0.0.0 255.255.255.255 UH 0 0 0 eth0

    MORE CONFIGURATION INFORMATION:

    > lsusb -v
    >
    > Bus 001 Device 006: ID 147b:5120
    > Device Descriptor:
    > bLength 18
    > bDescriptorType 1
    > bcdUSB 1.01
    > bDeviceClass 0 (Defined at Interface level)
    > bDeviceSubClass 0
    > bDeviceProtocol 0
    > bMaxPacketSize0 8
    > idVendor 0x147b
    > idProduct 0x5120
    > bcdDevice 1.03
    > iManufacturer 1 ABB STOTZ-KONTAKT GmbH
    > iProduct 2 KNX-USB Interface (MDRC)
    > iSerial 0
    > bNumConfigurations 1
    >
    > pi@raspberrypi:~ $ sudo systemctl status knxd.service
    > ● knxd.service – KNX Daemon
    > Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled
    > Active: active (running) since Mon 2017-11-27 12:35:07 CET; 13min ago
    > Main PID: 1432 (knxd)
    > CGroup: /system.slice/knxd.service
    > └─1432 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 –clie
    >
    > nov 27 12:35:07 raspberrypi systemd[1]: Started KNX Daemon.
    > pi@raspberrypi:~ $ journalctl -xu knxd.service
    > — Logs begin at Thu 2016-11-03 18:16:42 CET, end at Mon 2017-11-27 12:48:51 CET. —
    > nov 27 00:17:05 raspberrypi systemd[1]: Started KNX Daemon.
    > — Subject: Unit knxd.service has finished start-up
    > — Defined-By: systemd
    > — Support: …..
    > —
    > — Unit knxd.service has finished starting up.
    > —
    > — The start-up result is done.
    > nov 27 00:17:05 raspberrypi systemd[1]: knxd.service: Main process exited, code=kill
    > nov 27 00:17:05 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
    > nov 27 00:17:05 raspberrypi systemd[1]: knxd.service: Failed with result ‘signal’.
    > nov 27 12:26:11 raspberrypi systemd[1]: Started KNX Daemon.
    > — Subject: Unit knxd.service has finished start-up

    “KNX.CFG”
    > openhab> config:list “(service.pid=org.openhab.knx)”
    > —————————————————————-
    > Pid: org.openhab.knx
    > Properties:
    > busaddr = 1.1.128
    > ignorelocalevents = true
    > ip = 224.0.23.12
    > localIp = 192.168.1.250
    > port = 3671
    > service.pid = org.openhab.knx
    > timeout = 100000
    > type = ROUTER

    “knxd”
    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:16 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

    root@raspberrypi:/home/pi# netstat -pln|grep knxd
    tcp 0 0 0.0.0.0:6720 0.0.0.0:* LISTEN 1928/knxd
    udp 0 0 0.0.0.0:3671 0.0.0.0:* 1928/knxd
    unix 2 [ ACC ] STREAM LISTENING 35950 1928/knxd /tmp/knx

    TESTING
    ———-Monitor sending telegrams with “knxtool groupswrite ip:localhost 4/0/1 1”—————

    “On the bus knx listen”

    root@raspberrypi:/home/pi# knxtool groupsocketlisten ip:localhost
    Write from 1.1.134 to 4/0/15: 01
    Write from 1.1.121 to 4/0/15: 01
    *.log

    ==> /var/log/openhab2/events.log /var/log/openhab2/openhab.log ignore!
    2017-11-28 11:19:12.978 [TRACE] [.binding.knx.internal.bus.KNXBinding] – Received update (item=’knx_Vent2′, state=’ON’)
    2017-11-28 11:19:12.979 [TRACE] [g.knx.internal.dpt.KNXCoreTypeMapper] – toTypeClass looking for dptId = 1.001
    2017-11-28 11:19:12.981 [TRACE] [.binding.knx.internal.bus.KNXBinding] – found 1 compatible datapoints for item knx_Vent2 (org.openhab.core.library.types.OnOffType)
    2017-11-28 11:19:12.983 [INFO ] [tuwien.auto.calimero ] – calimero.link.224.0.23.12:3671: send message to 4/0/15, wait for confirmation
    2017-11-28 11:19:12.983 [DEBUG] [.binding.knx.internal.bus.KNXBinding] – Wrote value ‘ON’ to datapoint ‘command DP 4/0/15 knx_Vent2, DPT main 0 id 1.001, low priority’
    2017-11-28 11:19:12.986 [DEBUG] [tuwien.auto.calimero ] – calimero.link.224.0.23.12:3671: cEMI L-Data.ind from 1.1.128 to 4/0/15, low priority hop count 6 tpdu 00 81
    2017-11-28 11:19:12.987 [DEBUG] [tuwien.auto.calimero ] – KNXnet/IP Routing 224.0.23.12:3671: add to multicast loopback frame buffer: L-Data.ind from 1.1.128 to 4/0/15, low priority hop count 6 tpdu 00 81
    2017-11-28 11:19:12.989 [DEBUG] [tuwien.auto.calimero ] – KNXnet/IP Routing 224.0.23.12:3671: sending cEMI frame seq 0, non-blocking, attempt 1 (channel 0) 06 10 05 30 00 11 29 00 bc e0 11 80 20 0f 01 00 81
    2017-11-28 11:19:12.991 [DEBUG] [tuwien.auto.calimero ] – calimero.link.224.0.23.12:3671: send to 4/0/15 succeeded
    2017-11-28 11:19:12.993 [DEBUG] [tuwien.auto.calimero ] – process 224.0.23.12:3671: group write to 4/0/15 succeeded
    2017-11-28 11:19:12.994 [DEBUG] [tuwien.auto.calimero ] – KNXnet/IP Routing 224.0.23.12:3671: discard multicast loopback cEMI frame: L-Data.ind from 1.1.128 to 4/0/15, low priority hop count 6 tpdu 00 81

    —————–Monitor sent from openhab2. (NOT WORK)——————————————-

    “On the bus knx it don’t hear any message”

    root@raspberrypi:/home/pi# knxtool groupsocketlisten ip:localhost`


    *.log

    ==> /var/log/openhab2/events.log /var/log/openhab2/openhab.log Switch knx_Vent1 “Vent 1″ (LIGHT) { knx=”1.001:4/0/1” }
    >Switch knx_Vent2 “Vent 2″ (OTROS_USOS) { knx=”4/0/15” }

    OTHER OPTIONS: Use another busaddr for OH2/KNX (1.1.140)
    option 1:
    ip=224.0.23.12
    port=3671
    busaddr=1.1.140
    ignorelocalevents=true
    type=ROUTER
    localIp=192.168.1.250
    autoReconnectPeriod=30

    option 2: switch to TUNNEL mode
    ip=127.0.0.1
    port=3671
    busaddr=1.1.140
    ignorelocalevents=true
    type=TUNNEL
    localIp=192.168.1.250
    autoReconnectPeriod=30

    Thank you very much in advance and I feel the text so long.
    What is the problem?
    I think something must have in the routing.
    Jualom

      1. Yes Michael,
        Neither does openhab work in tunnel mode with KNX-USB Interface.
        Openhab works for me with a KNX-TCP/IP interface.

        Thank you anyway.
        Can it be the knx-usb interface?
        Although it works for me by sending telegrams from “knxtools”.

    1. Hi Bat,

      but this is only possible if enough RAM is available. After the build process the knxd build directory has a size of about 135MB. When you run it on an Raspberry 1 and have running a Desktop Environment too you may run out of memory:-(

      Michael

  72. Hi Michael,
    my knxd just does not want to start 🙁

    I tried to start it manually with:
    sudo systemctl start knxd.service

    but it isn’t running: ps ax|grep knxd
    572 pts/0 S+ 0:00 grep –color=auto knxd

    my /etc/default/knxd is set to
    # Command line parameters for knxd. TPUART Backend
    # Serial device Raspberry
    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
    # Serial device PC
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
    # Tunnel Backend
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
    # USB Backend
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

    knxtool vbusmonitor1 ip:localhost also just outpus
    Open failed: Connection refused

    What can I do to get it to start and work?

    I can anyways find my USB KNX Interface with findknxusb:
    Possible addresses for KNX USB devices:
    device: 1:4:1:0:0 (Berker GmbH & Co. KG:KNX-USB Data Interface)

    Louis

  73. Hi Michael,
    i think my problem is similiar to ohter questions. Unfortunately is my english not as well as it should be to unterstand everything 🙁 I hope you can help me.

    I´ve all commands i found in former comments tested and pasted the results below.

    pi@raspi:~ $ ps ax|grep knxd

    2637 pts/1 S+ 0:00 grep –color=auto knxd

    pi@raspi:~ $ knxtool vbusmonitor1 ip:localhost

    Open failed: Connection refused

    pi@raspi:~ $ sudo systemctl status knxd.service

    * knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
    Active: inactive (dead) since Fri 2018-01-05 12:43:03 CET; 3h 27min ago
    Process: 451 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)
    Main PID: 451 (code=exited, status=0/SUCCESS)

    Jan 05 12:43:03 raspi systemd[1]: Started KNX Daemon.

    pi@raspi:~ $ sudo journalctl -xu knxd.service

    — Logs begin at Thu 2016-11-03 18:16:42 CET, end at Fri 2018-01-05 16:11:52 CET. —
    Jan 05 12:43:03 raspi systemd[1]: Started KNX Daemon.
    — Subject: Unit knxd.service has finished start-up
    — Defined-By: systemd


    — Unit knxd.service has finished starting up.

    — The start-up result is done.

    pi@raspi:~ $ sudo vi /etc/default/knxd

    # Command line parameters for knxd. TPUART Backend
    # Serial device Raspberry
    #KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
    # Serial device PC
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
    # Tunnel Backend
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
    # USB Backend
    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

    Thank you very much!

    Christian

  74. Hi Michael,
    2 Years it works with FHEM and KNX and then the SD Card Crashed. Without Backup… 😉 And I forget everything…

    for 3 day´s I´m trying to setup my KNX Hardware:
    Raspberry 3
    Busch-Jaeger Elektro GmbH:KNX-USB Interface

    But the result: Active: inactive (dead)

    This are my Settings:
    *******
    pi@raspberrypi:~ $ sudo systemctl status knxd.service
    ● knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
    Active: inactive (dead) since Fri 2018-01-05 17:34:34 CET; 1h 27min ago
    Process: 635 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)
    Main PID: 635 (code=exited, status=0/SUCCESS)
    *******
    pi@raspberrypi:~ $ findknxusb
    Possible addresses for KNX USB devices:
    device: 1:7:1:0:0 (Busch-Jaeger Elektro GmbH:KNX-USB Interface (Flush mounted))
    *******
    pi@raspberrypi:~ $ cat /etc/systemd/network/eth0.network
    [Match]
    # You can also use wildcards. Maybe you want enable dhcp
    # an all eth* NICs
    Name=eth0
    [Network]
    #DHCP=v4
    # static IP
    # 192.168.10.50 netmask 255.255.255.0
    Address=192.168.10.50/24
    Gateway=192.168.10.1
    DNS=192.168.10.1
    # Route for Multicast Address EIB/KNX
    [Route]
    Destination=224.0.23.12/32
    *********
    pi@raspberrypi:~ $ lsusb
    Bus 001 Device 007: ID 04d9:a088 Holtek Semiconductor, Inc.
    Bus 001 Device 006: ID 058f:6254 Alcor Micro Corp. USB Hub
    Bus 001 Device 005: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
    Bus 001 Device 008: ID 145c:1330
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    **********
    pi@raspberrypi:~ $ cat /etc/default/knxd
    # Command line parameters for knxd. TPUART Backend
    # Serial device Raspberry
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
    # Serial device PC
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
    # Tunnel Backend
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
    # USB Backend
    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”
    *********
    pi@raspberrypi:~ $ ps ax|grep knxd
    958 pts/0 S+ 0:00 grep –color=auto knxd
    ********
    pi@raspberrypi:~ $ knxtool vbusmonitor1 ip:localhost
    Open failed: Connection refused
    ********

    Ich weiß nicht mehr weiter…

  75. Scheint ein aktuelles Problem zu sein. Hier genau das gleiche Fehlerbild, wie bei den 3 Beitragenden (Luois, Christian und Tobias) vor mir.
    Neu aufgesetzter (raspian) raspberry mit Busware USB – Interface.
    Nachdem er zuvor 3 Jahre klaglos lief mit eibd.

    pi@raspberrypi:~ $ ps ax|grep knxd
    449 pts/0 S+ 0:00 grep –color=auto knxd

    pi@raspberrypi:~ $ knxtool vbusmonitor1 ip:localhost
    Open failed: Connection refused

    pi@raspberrypi:~ $ cat /etc/systemd/network/eth0.network
    [Match]
    # You can also use wildcards. Maybe you want enable dhcp
    # an all eth* NICs
    Name=eth0
    [Network]
    #DHCP=v4
    # static IP
    # 192.168.178.57 netmask 255.255.255.0
    Address=192.168.178.57/24
    Gateway=192.168.178.1
    DNS=192.168.178.1
    # Route for Multicast Address EIB/KNX
    [Route]
    Destination=224.0.23.12/32

    pi@raspberrypi:~ $ sudo systemctl status knxd.service
    * knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
    Active: inactive (dead) since Fri 2018-01-12 20:04:20 UTC; 5min ago
    Process: 298 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)
    Main PID: 298 (code=exited, status=0/SUCCESS)

    Jan 12 20:04:19 raspberrypi systemd[1]: Started KNX Daemon.

    pi@raspberrypi:~ $ cat /etc/default/knxd
    # Command line parameters for knxd. TPUART Backend
    # Serial device Raspberry
    KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
    # Serial device PC
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
    # Tunnel Backend
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
    # USB Backend
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

    pi@raspberrypi:~ $ knxtool vbusmonitor1 ip:localhost
    Open failed: Connection refused

    1. Hi Frank,

      ich kenne jetzt das Busware USB Interface nicht im Detail. So wie ich das auf die schnelle sehe spricht man es per TPUART an. /dev/ttyAMA0 ist in der Regel die serielle Schnittstelle des Raspberry.

      Zieh doch mal den USB Adapter ab und starte als root dmesg, steck den Adapter an und poste mal die Ausgabe:

      dmesg -w

      Michael

  76. Dear Michael,

    first of all I must send a big THANK YOU to you for all the hard work that’s certainly in all these lines and scripts.
    I decided for KNX when we built our house 6 years ago and of course in the beginning I went for all the commercial solutions for controlling the KNX via smartphone etc.
    But deep inside of me there is someone who wants to understand the details behind the products out of stock. And one must realise that behind these products mainly there is no rocket science but expert know how in certain fields (like profound LINUX know how that for me still is kind of Bohemian villages as we use to say :-). Thanks guys like you this know how is via blogs like this open to the public and certainly I will donate to you once I got my project finished. Thank you soo much …

    So, what’s to my problem… I started to set up my Raspberry PI 3 as described in your blog. I followed all the instructions but in the end I am not able to connect to my KNX. I think it’s quite the same errors that occured by the bloggers just before this one.
    I configured the interface for USB connection since I have a BERKER USB interface installed. So I followed all the steps and configured the

    /etc/default/knxd

    respectively.

    When calling

    ps ax|grep knxd

    I am getting the following result:

    2582 pts/0 S+ 0:00 grep knxd

    which is different to the expected one in your descrition.

    When checking the bus connection with:

    knxtool vbusmonitor1 ip:localhost

    I am getting the following result:

    Open failed: Connection refused

    So unfortunately I doesn’t work.

    I would be very pleased if you could help.

    The /etc/default/knxd is configured as follows:

    # Command line parameters for knxd. TPUART Backend
    # Serial device Raspberry
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyAMA0″
    # Serial device PC
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuarts:/dev/ttyS0″
    # Tunnel Backend
    # KNXD_OPTIONS=”–eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b ipt:192.168.56.1″
    # USB Backend
    KNXD_OPTIONS=”–eibaddr=0.0.100 –client-addrs=0.0.101:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

    I would be very pleased if you could help.

    Thank you so much in advance.

    Best

    Mathias

  77. Hi Micha,

    the device can be found:

    pi@raspberrypi:~ $ sudo su
    root@raspberrypi:/home/pi# su knxd -s /bin/bash
    knxd@raspberrypi:/home/pi$ findknxusb
    Possible addresses for KNX USB devices:
    device: 1:4:1:0:0 (Berker GmbH & Co. KG:KNX-USB Data Interface)
    knxd@raspberrypi:/home/pi$

    So obviously the problem is something else.

    Best
    Mathias

    1. Hi Mathias,

      try to start knxd at command line with verbose logging:

      Change to root and then to user knxd

      sudo su
      su knxd -s /bin/bash

      and start knxd with logging/tracing in foreground

      knxd -t 1023 --eibaddr=0.0.100 --client-addrs=0.0.101:8 -D -T -R -S -i --listen-local=/tmp/knx -t -1023 -b usb:

      and wait for error messages or knxd exits.
      Michael

      1. Hi Micha,

        unfortunately nothing happens when entering this.

        pi@raspberrypi:~ $ sudo su
        root@raspberrypi:/home/pi# cd
        root@raspberrypi:~# su knxd -s /bin/bash
        knxd@raspberrypi:/root$ knxd -t 1023 –eibaddr=0.0.100 –client-addrs=0.0.101:8 -D -T -R -S -i –listen-local=/tmp/knx -t -1023 -b usb:

        I have to manually stop the process with STRG+C.

        So I don’t receive any error mesages or exits.

        Regards

        Mathias

        1. Hi Mathias,

          the commit
          commit 356be34210c687874f4f64d42c1106582bb7dfb8
          Author: Matthias Urlichs
          Date: Wed Jan 3 13:17:34 2018 +0100

          * Fix handling of stdin/out/err and forking

          changed something importend in knxd handles output to console. However, debug/trace seams no longer printed to console. Please write the debug/trace output to a file:

          knxd -t 1023 --eibaddr=0.0.100 --client-addrs=0.0.101:8 --daemon=/tmp/knxd_trace.txt -D -T -R -S -i --listen-local=/tmp/knx -t 1023 -b usb:

          Michael

          1. Dear Micha,

            I have the feeling we are getting closer to the solution.

            When I enter the command you just sent in your message earlier it accepts the command without freezing. When I then enter

            knxtool vbusmonitor1 ip:localhost

            I am getting the bus traffic -> YEAH so first big step for me 🙂
            I dont know if that makes sense since I thoght the command is for writing a log file but anyway I have noticed that thiis is the case.

            If I enter

            knxtool groupswrite ip:localhost 1/1/70 1

            to send an “on” bit to that address

            it says

            Send request

            but unfortunately nothing happens.

            If I try it again, the same occurs. Trying this once more it results in

            Connection refused.

            If now trying

            knxtool vbusmonitor1 ip:localhost

            it also says Connection refsed.

            If I then enter your command line again:

            knxd -t 1023 –eibaddr=0.0.100 –client-addrs=0.0.101:8 –daemon=/tmp/knxd_trace.txt -D -T -R -S -i –listen-local=/tmp/knx -t 1023 -b usb:

            I am getting the bus traffic when I enter the vbusmonito command again.

            So I am a bit confused now. Does this make sense to you?

            If not, would it be possible to send me a private message to my email adress so that I could give you login details to login remotely and check what’s wrong?

            This would be great but pls only if possible.

            Thanks a lot

            Mathias

          2. Hi Mathias,

            “Connection refused” means that the knxd process has exited and is no longer listening to the network. You can check if the process is running by list all process (ps ax) and filter the list by grep:

            ps ax|grep knxd

            The output must shown 2 lines the whole knxd command line and the grep process. If not knxd does not runs.

            When knxd exits you can find the reasen why in the log file /tmp/knxd_trace.txt. We try first starting knxd again and when it exits look into the logfile and post the last lines with the error messages.

            Michael

          3. Hi Micha,

            It’s finally working now.
            Many thanks for your kind assistance.
            Regards
            Mathias

        2. Hi Mathias,

          i´ve tested Michaels last post. Unfortunately it doesn´t work.

          — Logs begin at Wed 2018-01-17 17:50:04 CET, end at Wed 2018-01-17 18:48:16 CET. —
          Jan 17 17:50:14 openHABianPi systemd[1]: knxd.service: Ignoring invalid environment assignment ‘knxd -t 1023 –eibaddr=0.0.100 –cl
          Jan 17 17:50:14 openHABianPi systemd[1]: Started KNX Daemon.
          Jan 17 17:50:14 openHABianPi systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
          Jan 17 17:50:14 openHABianPi systemd[1]: knxd.service: Unit entered failed state.
          Jan 17 17:50:14 openHABianPi systemd[1]: knxd.service: Failed with result ‘exit-code’.

          But another question. Why do you use 0.0.100 instead of 1.1.128?

          Christian

          1. Hi Christian,

            “status=2/INVALIDARGUMENT”

            May be you running in an copy & paste issue? When you copy the command line from the browser to the terminal it can occur that a wrong "-" (Unicode) Character is used which is not the minus knxd at command line expects. Also "--" is often merged to a single "-". I think a wordpress issue.

            Please try to enter the command line by keyboard.

            Michael

          2. Hi Michael,

            so far i now know my problem caused of the missing knx socket.

            openhabian@openHABianPi:~ $ systemctl status knxd.socket
            Unit knxd.socket could not be found.

            Do you have an idea what went wrong while the installation?

            Christian

          3. Hi Christian,

            if you use my script the systemd knx.socket is not necessary because the script builds knxd without systemd support, so the socket is created by knxd itself not by systemd.

            Michael

  78. With this settings and an Bush Jäger 6123 it runs on an Raspberry:

    KNXD_OPTS=”-e 1.1.1 -E 1.1.1:40 -u /tmp/knx -D -T -R -S -b usb:1:4:1:0″

    I get an green activ and this Result:
    pi@raspberrypi:~ $ systemctl status knxd.service
    ● knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
    Active: active (running) since Fri 2018-01-19 08:19:59 CET; 20s ago
    Main PID: 588 (knxd)
    CGroup: /system.slice/knxd.service
    └─588 /usr/bin/knxd -e 1.1.1 -E 1.1.1:40 -u /tmp/knx -D -T -R -S -b usb:1:4:1:0

    Jan 19 08:19:59 raspberrypi systemd[1]: Starting KNX Daemon…
    Jan 19 08:19:59 raspberrypi systemd[1]: Started KNX Daemon.

    It look´s god but I did not recive any Messages from me Powernet-Bus.
    Only manual trigert Messages arrife in Fhem but dont have any reaction on my Bus

    knxtool vbusmonitor1 ip:localhost
    and
    grep knxd
    Only show an empty cursor and no error message.
    What is wrong except my bad English?

  79. hallo ich verstehs einfach nicht! nach reboot geht gar nicht ps ax|grep knxd zeigt eine Zeile. wenn ich dann knxd -t 1023 –eibaddr=0.0.100 –client-addrs=0.0.101:8 –daemon=/tmp/knxd_trace.txt -D -T -R -S -i –listen-local=/tmp/knx -t 1023 -b usb: eingebe läuft alles perfekt!! Wie zum teu… was muss ich da jetzt in die /etc/default/knxd eintragen?????? KNX schnittstelle ist ein ABB KNX USB Interface. Beim Manuellen starten kann ich auch per groupwrite senden und es funktioniert auch. Was mach ich da falsch?

  80. with manual start like knxd -t 1023 –eibaddr=1.1.2 –client-addrs=1.1.3:8 –daemon=/tmp/knxd_trace.txt -D -T -R -S -i –listen-local=/tmp/knx -t 1023 -b usb: all work perfect but no change of the /etc/default/knxd bring it to work after reboot ps ax|grep knxd shows only one line what do i wrong?

    1. Hi Christian,

      your /etc/default/knxd simply have to contains this one line

      KNXD_OPTIONS="-t 1023 --eibaddr=1.1.2 --client-addrs=1.1.3:8 --daemon=/tmp/knxd_trace.txt -D -T -R -S -i --listen-local=/tmp/knx -t 1023 -b usb:"

      There can be multiple reasons when knxd does not start after reboot:
      -Have you set a static IP Address?
      -Have you got an WLAN Interface?
      -Whats happend when you start knxd manually
      systemd start knxd
      -What does journalctl says
      journalctl -xu knxd.service
      -What are the last lines of your debug logfile /tmp/knxd_trace.txt

      Michael

  81. Status say:Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
    Active: inactive (dead) since Mon 2018-01-22 12:04:08 CET; 3min 47s ago
    Process: 610 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)
    Main PID: 610 (code=exited, status=0/SUCCESS)

    Journal say: — Logs begin at Mon 2018-01-22 12:02:17 CET, end at Mon 2018-01-22 12:04:08 CET. —
    Jän 22 12:02:19 fhem-server systemd[1]: Starting KNX Daemon…
    — Subject: Unit knxd.service has begun with start-up
    — Defined-By: systemd

    — Unit knxd.service has begun starting up.
    Jän 22 12:02:19 fhem-server systemd[1]: Started KNX Daemon.
    — Subject: Unit knxd.service has finished start-up
    — Defined-By: systemd

    — Unit knxd.service has finished starting up.

    — The start-up result is done.
    Jän 22 12:04:08 fhem-server systemd[1]: Starting KNX Daemon…
    — Subject: Unit knxd.service has begun with start-up
    — Defined-By: systemd

    — Unit knxd.service has begun starting up.
    Jän 22 12:04:08 fhem-server systemd[1]: Started KNX Daemon.
    — Subject: Unit knxd.service has finished start-up
    — Defined-By: systemd

    — Unit knxd.service has finished starting up.

    — The start-up result is done.
    whats wrong?

  82. Hi Michael,

    I am facing the same issue as Christian.
    My version is: knxd 0.14.23

    I found the following:
    After reboot I see the status of knxd:

    ● knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
    Active: inactive (dead) since Tue 2018-01-23 10:38:31 UTC; 1s ago
    Process: 1718 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)
    Main PID: 1718 (code=exited, status=0/SUCCESS)

    To start it via the service it helps to do either:

    systemctl daemon-reload

    or

    systemctl umask knxd

    and

    systemctl start knxd

    after that the status shows:

    ● knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled)
    Active: active (running) since Tue 2018-01-23 10:39:40 UTC; 2s ago
    Main PID: 1740 (knxd)
    CGroup: /system.slice/knxd.service
    └─1740 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128…

    Jan 23 10:39:40 raspberrypi systemd[1]: Started KNX Daemon.

    When I stop it again, I always have to umask or daemon-reload before it is correctly started via “systemctl start knxd”

    Maybe Christian can confirm this behaviour in his setup?
    Hope this gives some hint where to look at 🙂 google search didn’t help so far.

    Thanks and cheers,
    Matthias

    1. Hi Matthias,

      same issue as Christian? knxd does not start at system boot?

      I think the knxd team changed with commit 356be34210c687874f4f64d42c1106582bb7dfb8 the process start behaviour again.

      When using the -d switch (daemon mode) the Servicetype in /lib/systemd/system/knxd.service should switched back from Type=simple to Type=forking.

      But with the current version knxd cannot create a pid file in /run/knxd …. investigating….

      Michael

      Michael

      1. Hi Michael,

        knxd is started after reboot:

        1. with -d and Type=forking
        2. without -d and Type=simple

        in both cases it writes the pid to /run/knxd/knxd.pid

        You refer with current version of knxd to 0.14.23?

        Cheers,
        Matthias

  83. Hi Michael, Matthias and Christian,

    took me some hours to read through the whole post and try out everything I read and that seem to be related to my problem. Wish I had started at the bottom. Removing -d worked for me too. Thank you for that!
    Now that I have a running knxd I can go to the next step and try to connect openhab with knxd.

    1. I did some testing and hav another problem. Without -d knxd start manual or after reboot. It keeps runing when I don’t do anything (just vbusmonitor runing to see its alive).
      When I send groupswrite commands it crashes after 2-3 commands.

      And another thing (that is kind of off-topic for this place here): While knxd runs I can see my switches that I defined in Openhab2 change when I send groupswrite or if I press a physical knx button. But if I use the switch in Openhab nothing happens.

      Best Regards

      Marco

      1. Hi Marco,

        my current setup is running with -d parameter and type=forking.
        no issues after multiple groupwrites, knxd runs stable.

        my raspi is only running knxd, my openhab2 is running at my synology storage, I had also issues switching from openhab2 switches until I changed to the following knx.cfg

        ip=224.0.23.12
        busaddr=1.0.0
        ignorelocalevents=true
        type=ROUTER
        port=3671
        localIp=

        the final solution was to set busaddr to 1.0.0 in my case, running with another address e.g. 1.1.130 didn’t switch anything, I only saw that the knx binding was connected to the knxd and logged all messages on the bus in openhab.log after switching on the log for org.openhab.binding.knx

        Cheers,
        Matthias

        1. Hi Matthias

          Thanks for your advise. I was really hoping it resolves the remaining points. Unfortunately it did not work for me.
          I changed type to forking in knxd.service and add the -d in the etc/default/knxd. After reboot I get the following on status:
          knxd.service – KNX Daemon
          Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
          Active: failed (Result: timeout) since Thu 2018-01-25 00:10:22 CET; 1min 42s ago
          Process: 508 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)

          Jan 25 00:08:44 openHABianPi systemd[1]: Starting KNX Daemon…
          Jan 25 00:08:45 openHABianPi systemd[1]: knxd.service: PID file /run/knxd/knxd.pid not readable (yet?) after start: No such file or directory
          Jan 25 00:10:22 openHABianPi systemd[1]: knxd.service: Start operation timed out. Terminating.
          Jan 25 00:10:22 openHABianPi systemd[1]: Failed to start KNX Daemon.
          Jan 25 00:10:22 openHABianPi systemd[1]: knxd.service: Unit entered failed state.
          Jan 25 00:10:22 openHABianPi systemd[1]: knxd.service: Failed with result ‘timeout’.

          Regarding openhab I tried the 1.0.0 in the knx.conf (default is 0.0.0). I also tried 1.0.250. That is configured in my Gira Homeserver (that’s where the USB KNX adapter comes from – I want to switch to openhab to integrate other systems like ZWAVE). Did not help either.

          One more thing I need to mention: I run knxd and openhab on a RPI3 that is installed with openhabian image. That comes with a setup script for knxd too. As well as setup for static IP etc. If you guys think this might be part of the problem I could make a backup of my SD card try to install as directed by Michael (do I have to uninstall knxd first and how?)

          Marco

          1. Hi Marco,

            /run/knxd/knxd.pid not readable (yet?) after start: No such file or directory => Does the folder /run/knxd exists?

            Michael

          2. Hi Michael

            Yes the folder exists. Had to change from standard user openhabian to root to see it.

            [22:02:05] root@openHABianPi:/run# ls -al /run/knxd
            insgesamt 0
            drwxr–r– 2 knxd knxd 40 Jan 25 00:08 .
            drwxr-xr-x 27 root root 800 Jan 25 00:11 ..

            Maybe something wrong with permissions?

          3. Hi Marco,

            can you configure to place the pid file directly to /run:

            … -p /run/knxd.pid …

            Michael

          4. Hi,
            changing to /run/knxd.pid instead of /run/knxd/knxd.pid did not help. I also tried to change user and group in knxd.service to root. Still not working.

            I did reinstall knxd and realized that openhabian is using your script for installation 🙂 I used the offered fix with the longer timeout. That took care of the permanent crashing of knxd that I experienced before. It is stable now without -d and type=simple.

            Openhab2 is still not switching anything. It listens and sees changes but that’s it. With wireshark I can see networktraffic from 192.168.0.10 to 224.0.23.12 port 3671>3671. The pakets in wireshark look quiet similar wether sent by groupswrite or openhab but only groupswrite actually switches the light.

            I have tried using 1.0.0 as openhab-binding bus-address. No result. I tried 1.0.0. as –eibaddr in knxd. I tried different combinations of the 2 including using 1.0.0. for both (probably not a clever idea – but still same behaviour). Also tried eibaddr=1.0.0 client-addr=1.0.1:8 and giving openhab 1.0.1 (to be in the range of client addreses defiened).
            I’m out of ideas for the moment what to text next. I think I must be close as I can switch with groupswrite and openhab is sending commands to the correct IP and port.

            Marco

          5. Hi Michael

            The packets do not show on the busmonitor. I would have been surprised if they did (assuming the busmonitor shows activity on the bus in which case the light should have switched).
            However I tried other stuff and got it working. The major change is that I use tunnel mode instead of router. I tried this before and it did not work so it must be a combination of other settings and tunnel mode.

            These are my settings in case someone else with a similar problem reads this and might want to give it a try:

            knxd and Openhab2 both run on 192.168.0.10

            knx.cng (openhab)
            ip:192.168.0.10
            busaddr=0.0.2
            ignorelocalevents=true
            type=tunnel
            port=3671
            localIp=192.168.0.10

            Knxd options:
            KNXD_OPTIONS=”–eibaddr=0.0.1 –client-addrs=0.0.2:8 -D -T -R -S -i –listen-local=/tmp/knx -b usb:”

            knxd.service:
            ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS
            Type=simple
            PIDFile=/run/knxd.pid
            User=knxd
            Group=knxd

            Thanks again for all your support!

            Best Regards

            Marco

  84. Dear Michael,
    I’ve just started to set up OpenHabian on a Raspberry Pi 3. So far it all worked out perfectly. Then I installed the KNXD package where in the documentation it says it uses your script, so that in the end I assume that the result should be the same.
    After having tested and reinstalled everything for several times I am failing with getting the KNXD service running.

    When typing:

    sudo systemctl status knxd.service

    I am getting the following result:

    ● knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
    Active: failed (Result: resources) since Sat 2018-02-10 13:39:22 CET; 5min ago
    Process: 1323 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)

    Feb 10 13:39:22 openHABianPi systemd[1]: Starting KNX Daemon…
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: PID file /run/knxd/knxd.pid not readable (yet?) after start: No such file or directory
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Daemon never wrote its PID file. Failing.
    Feb 10 13:39:22 openHABianPi systemd[1]: Failed to start KNX Daemon.
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Unit entered failed state.
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Failed with result ‘resources’.
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Start request repeated too quickly.
    Feb 10 13:39:22 openHABianPi systemd[1]: Failed to start KNX Daemon.
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Failed with result ‘resources’.

    I have also tested the -d issue explained before but also this won’t bring it working.

    When starting the knxd service manually it says:

    Excess arguments.

    The journalctl says:

    — Unit knxd.service has begun starting up.
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: PID file /run/knxd/knxd.pid not readable (yet?) after start: No such file or directory
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Daemon never wrote its PID file. Failing.
    Feb 10 13:39:22 openHABianPi systemd[1]: Failed to start KNX Daemon.
    — Subject: Unit knxd.service has failed
    — Defined-By: systemd
    — Support: https:xxxxxxxxxxxxxxxxxxxxxx

    — Unit knxd.service has failed.

    — The result is failed.
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Unit entered failed state.
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Failed with result ‘resources’.
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Start request repeated too quickly.
    Feb 10 13:39:22 openHABianPi systemd[1]: Failed to start KNX Daemon.
    — Subject: Unit knxd.service has failed
    — Defined-By: systemd
    — Support: https:/xxxxxxxxxxxxxxxxxx

    — Unit knxd.service has failed.

    — The result is failed.
    Feb 10 13:39:22 openHABianPi systemd[1]: knxd.service: Failed with result ‘resources’.

    I am really at the end now ? Can you help?

    Thanks
    Mathias

    (I’ve x ed the links in the post. Otherwise it won’t work.)

  85. Dear Michael,

    once more I want to ask for your advice. I’ve installed knxd several times with a clean openhabian image and also a clean Raspian image. I followed exactly every step of your instructions above and it’s always the same result. Once finished and configured as USB in knxd options and after reboot the knxd service will not start.

    When typing

    ps ax|grep knxd

    I am getting

    ‘4705 pts/0 S+ 0:00 grep –color=auto knxd’

    and not

    416 ? Ss 0:00 /usr/local/bin/knxd -p /run/knxd/knxd.pid –eibaddr=1.1.128 -d -D -T -R -S -i –listen-local=/tmp/knx tpuarts:/dev/ttyAMA0

    as you described above.

    So obviously the knxd service is not running.

    As mentioned I tried it several times exactly as described and it is every time the same.

    Can you help?

    Thanks in advance

    Mathias

    1. Hi Mathias,

      what does the log said

      journalctl -xu knxd.service

      does knxd starts when you start it at command line

      systemctl start knxd.service
      journalctl -xu knxd.service

      Michael

        1. Hi Øystein

          may be the interface isn’t up when knxd starts. Add the following line to the [Service] Section in /lib/systemd/system/knxd.service

          ExecStartPre=/lib/systemd/systemd-networkd-wait-online –timeout=60 –interface=wlan0

          Michael

          1. Hi Again Michael.

            Thanks for the reply. 🙂

            I used sudo nano, and entered the line as you described.
            Still no action after reboot.
            But then I could not start the program by the use of *systemctl start knxd.service* . It timed out.
            I noted the line out, and rebooted again with result :
            **
            pi@raspberrypi:~ $ sudo su
            root@raspberrypi:/home/pi# systemctl start knxd.service
            root@raspberrypi:/home/pi# ps ax|grep knxd
            789 ? 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:
            797 pts/0 S+ 0:00 grep knxd
            root@raspberrypi:/home/pi# knxtool vbusmonitor1 ip:localhost
            LPDU: BC 11 09 10 00 E1 00 81 2B :L_Data low from 1.1.9 to 2/0/0 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 01
            **
            Service section in file :
            *
            [Service]
            EnvironmentFile=/etc/default/knxd
            # Wait for all interfaces, systemd-networkd-wait-online.service must be enabled
            #ExecStartPre=/lib/systemd/systemd-networkd-wait-online –timeout=60
            # Wait for a specific interface
            #ExecStartPre=/lib/systemd/systemd-networkd-wait-online –timeout=60 –interface=eth0
            ExecStartPre=/lib/systemd/systemd-networkd-wait-online –timeout=60 –interface=wlan0
            ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS
            Type=forking
            PIDFile=/run/knxd/knxd.pid
            User=knxd
            Group=knxd
            #TimeoutStartSec=60
            **

            I have set the static IP by the use of a different method then in the tutorial. Can this be a issue ?

            /Øystein

          2. Hi.

            Thanks for great tutorial.

            I have stumbled into an issue.

            when trying to write something on the bus. I only stop the process.
            **
            root@raspberrypi:/# knxtool vbusmonitor1 ip:localhost
            LPDU: BC 11 10 10 05 E3 00 80 0C 55 6D :L_Data low from 1.1.16 to 2/0/5 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0C 55
            LPDU: BC 11 10 10 06 E3 00 80 0C 3D 06 :L_Data low from 1.1.16 to 2/0/6 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0C 3D
            LPDU: BC 11 10 10 04 E3 00 80 0D 69 51 :L_Data low from 1.1.16 to 2/0/4 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0D 69
            LPDU: BC 11 10 10 04 E3 00 80 0D 64 5C :L_Data low from 1.1.16 to 2/0/4 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0D 64
            LPDU: BC 11 10 10 05 E3 00 80 0C 56 6E :L_Data low from 1.1.16 to 2/0/5 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0C 56
            LPDU: BC 11 10 10 06 E3 00 80 0C 3D 06 :L_Data low from 1.1.16 to 2/0/6 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0C 3D
            LPDU: BC 11 10 10 05 E3 00 80 0C 5B 63 :L_Data low from 1.1.16 to 2/0/5 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0C 5B
            LPDU: BC 11 10 10 06 E3 00 80 0C 3D 06 :L_Data low from 1.1.16 to 2/0/6 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0C 3D
            LPDU: BC 11 10 10 04 E3 00 80 0D 5B 63 :L_Data low from 1.1.16 to 2/0/4 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0D 5B
            LPDU: BC 11 09 10 00 E1 00 80 2A :L_Data low from 1.1.9 to 2/0/0 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
            ^C
            root@raspberrypi:/# ps ax|grep knxd
            3301 ? 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:
            3472 pts/0 S+ 0:00 grep knxd
            root@raspberrypi:/# knxtool groupswrite ip:localhost 2/0/0 0
            Send request
            root@raspberrypi:/# knxtool groupswrite ip:localhost 2/0/0 1
            Open failed: Connection refused
            root@raspberrypi:/# ps ax|grep knxd
            3484 pts/0 S+ 0:00 grep knxd
            root@raspberrypi:/#
            **

            Then I have to manually start the process again.

          3. Hi Øystein,

            have you tried to run knxd in foreground in another terminal with trace enabled to see whats happend when knxd exits?

            Michael

  86. Dear Michael,
    I’m sorry if my question is a little off topic.

    I want to command a home automation system through the knx server using the raspberry pi3 to launch a scenario for exemple. Is this achievable using the knxd ?
    here the diagram : https://ibb.co/cTBO8H

    Also if yes do you know how I can do the same with other protocols ?

    Thanks in advance
    Yassine

    1. Hi Yassine,

      IMHO yes, establish a tunnel connection from your knxd to your IP Interface.

      What do you mean with “other protocols”?

      Michael

  87. Hi Michael,

    We have tested your application on a raspberry pi 3 and hager usb interface, We start the application with “sudo systemctl start knxd” we hit ctrl-C and “run knxtool vbusmonitor1 ip:localhost” we see telegrams for approx 1-2 minutes and then it stops see log below. We see that it is in “Active: activating (start) and after the time it goes to timeout.

    Is it timeout to the usb interface?

    We have used static IP

    Best regards

    knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
    Active: failed (Result: timeout) since Fri 2018-03-02 16:08:53 UTC; 22s ago
    Process: 21287 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCCESS)

    Mar 02 16:07:23 raspberrypi systemd[1]: Starting KNX Daemon…
    Mar 02 16:07:23 raspberrypi systemd[1]: knxd.service: PID file /run/knxd/knxd.pid not readable (yet?) after start: No such file or directory
    Mar 02 16:08:53 raspberrypi systemd[1]: knxd.service: Start operation timed out. Terminating.
    Mar 02 16:08:53 raspberrypi systemd[1]: Failed to start KNX Daemon.
    Mar 02 16:08:53 raspberrypi systemd[1]: knxd.service: Unit entered failed state.
    Mar 02 16:08:53 raspberrypi systemd[1]: knxd.service: Failed with result ‘timeout’.

  88. Hi Michael,

    I hit Strg-C to get a promt so we can type the command vbusmonitor just to see if we get communication to knx.

    If we don’t hit Strg-C after about two minutes we get the same timeout and it refers to the log i send You (knxd.sevice). The log complains about the “pid file not readable” shall it use a pid file in our case?

    Best regards

    Jim

    1. Hi Jim,

      this seems to be a bug in knxd. When systemd is not used the command line options are parsed incorrectly. In special the pidfile.

      I’ll provide a fix and create a pull request to the knxd project.

      Michael

    2. Hi Jim,

      I create a pull request https://github.com/knxd/knxd/pull/326.

      Temporarly you can try to compile knxd from my fork which contains the fix. Edit install_knxd_systemd.sh.

      At line 153 replace
      git clone https://github.com/knxd/knxd knxd
      with
      git clone https://github.com/Race666/knxd.git

      and at line 158 replace

      git checkout stable
      with
      git checkout merge

      Save your /etc/default/knxd and start the script again. Let me know if it works as expected.

      Michael

      1. I dont know if it is significant but i rm -rf knxdbuild first, changed the end of line at 153 to “…Race666/knxd knxd” and then it ran.

          1. Hi bohtho, hi Jim

            SORRY

            yes you’re right. Remove the build directory

            rm -r knxdbuild

            This should work:

            At line 153 replace
            git clone https://github.com/knxd/knxd knxd
            with
            git clone https://github.com/Race666/knxd knxd

            and at line 158 replace

            git checkout stable
            with
            git checkout merge

            Please also check if patch is applied at your working directory. Open file knxd/src/server.knxd.cpp and check line 336. There must be
            std::string PidFile=main->value("pidfile","");

            Michael

          2. Doing what you say in the comment “Michael March 6, 2018 at 7:35 PM”, changed script with forked repository, confirmed, I still get the pid not readable, and knxd.service: Daemon never wrote its PID file. Failing.

          3. Hi bohtho,

            tried it from scratch (debian 9.3 only system tools, install script 0.7.14 with change of fork from race666/knxd) and pid is created.

            Have you tried to start knxd at command line. Maybe there is another error before the pid file is created?

            root@debdev:~/knxdbuild/knxd# knxd -V
            knxd 0.14.24-3:e0d31fe-emipatch
            root@debdev:~/knxdbuild/knxd# su knxd -s /bin/bash
            knxd@debdev:/root$ knxd -p /run/knxd/knxd.pid --eibaddr=1.1.128 --client-addrs=1.1.129:8 -D -T -R -S -i --listen-local=/tmp/knx -b dummy:
            PIDFILE /run/knxd/knxd.pid

            To see if command line is correct parsed I add in my script a line which patches knxd.cpp to print out the pid file name

            sed -i '/main->value("background",false);/a printf("PIDFILE: %s\\n",pidfile);\nprintf("LOGFILE %s\\n",logfile);\n' src/server/knxd.cpp

            add the line after “git checkout merge”

            On a second console, check if folder /run/knxd and the pid file exists

            ls -s /run/knxd

            Michael

  89. Hi Michael,

    We have tried to replace line 153 and 158, line 158 isn’t liked by the system.

    We run with no change att line 158 byt at 153 but we get the same error.

    Best regards

    Jim

  90. I think I finally got knxd up on my USB!

    But messages are still unreadable. Any idea what unparseable EMI data means ? Its a TAPKO USB HID cEMI KNX-RF stick.

    knxd -t 1023 –eibaddr=0.5.140 –client-addrs=0.5.1:20 -D -T -R -S -i –listen-local=/tmp/knx -t -1023 -b usb:
    Layer 4 [ 1:main 0.000] initialized
    Layer 4 [ 1:main 0.000] setting up
    Layer 3 [ 4:server/Server 0.000] registerLink: 4:server
    Layer 3 [ 9:A.tcp/inet 0.000] registerLink: 9:A.tcp
    Layer 3 [12:B.unix/local 0.000] registerLink: 12:B.unix
    Layer 1 [18:C.usb/usbL 0.001] Detect
    Layer 1 [18:C.usb/usbL 0.001] Using 2:2:1:0:0 (2:129)
    Layer 1 [18:C.usb/usbL 0.002] Detect
    Layer 1 [18:C.usb/usbL 0.002] Using 2:2:1:0:0 (2:129)
    Layer 3 [15:C.usb/Conn 0.002] registerLink: 15:C.usb
    Layer 4 [ 1:main 0.002] setup OK
    Layer 4 [ 1:main 0.002] trigger going up
    Layer 3 [15:C.usb/Conn 0.002] Start: cfg:C.usb
    Layer 5 [15:C.usb/Conn 0.002] down => >up
    Layer 5 [15:C.usb/Conn 0.002] Starting
    Layer 1 [18:C.usb/usbL 0.002] Open
    Layer 1 [18:C.usb/usbL 0.011] Claimed
    Layer 1 [18:C.usb/usbL 0.011] Opened
    Layer 0 [16:C.usb/USBdr 0.012] starting send_Local
    Layer 0 [18:C.usb/usbL 0.012] SendUSB(064): 01 13 09 00 08 00 01 0F 01 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Layer 0 [18:C.usb/usbL 0.012] StartSend 55a768ec79a0
    Layer 4 [15:C.usb/Conn 0.012] >up
    Layer 3 [12:B.unix/local 0.012] Start: cfg:B.unix
    Layer 5 [12:B.unix/local 0.012] down => >up
    Layer 8 [12:B.unix/local 0.012] OpenLocalSocket /tmp/knx
    Layer 8 [12:B.unix/local 0.012] LocalSocket opened
    Layer 5 [12:B.unix/local 0.012] >up => up
    Layer 4 [12:B.unix/local 0.012] up
    Layer 5 [12:B.unix/local 0.012] Started
    Layer 4 [12:B.unix/local 0.013] up
    Layer 3 [ 9:A.tcp/inet 0.013] Start: cfg:A.tcp
    Layer 5 [ 9:A.tcp/inet 0.013] down => >up
    Layer 8 [ 9:A.tcp/inet 0.013] OpenInetSocket 6720
    Layer 8 [ 9:A.tcp/inet 0.013] InetSocket opened
    Layer 5 [ 9:A.tcp/inet 0.014] >up => up
    Layer 4 [ 9:A.tcp/inet 0.014] up
    Layer 5 [ 9:A.tcp/inet 0.014] Started
    Layer 4 [ 9:A.tcp/inet 0.014] up
    Layer 3 [ 4:server/Server 0.014] Start: cfg:server
    Layer 5 [ 4:server/Server 0.019] down => >up
    Layer 8 [ 4:server/Server 0.019] Open
    Layer 0 [ 4:server/Server 0.019] Open
    Layer 0 [ 4:server/Server 0.019] Opened
    Layer 8 [20:router/driver 0.019] OpenD
    Layer 8 [20:router/driver 0.019] OpenedD
    Layer 3 [19:router/ConnC 0.019] registerLink: 19:router_19
    Layer 3 [19:router/ConnC 0.019] Start: cfg:router
    Layer 5 [19:router/ConnC 0.019] down => >up
    Layer 5 [19:router/ConnC 0.019] Starting
    Layer 5 [19:router/ConnC 0.019] >up => up
    Layer 4 [19:router/ConnC 0.019] up
    Layer 5 [19:router/ConnC 0.019] Started
    Layer 4 [19:router/ConnC 0.019] up
    Layer 8 [ 4:server/Server 0.019] Opened
    Layer 5 [ 4:server/Server 0.019] >up => up
    Layer 4 [ 4:server/Server 0.019] up
    Layer 5 [ 4:server/Server 0.019] Started
    Layer 4 [ 4:server/Server 0.019] up
    Layer 4 [ 1:main 0.019] going up triggered
    Layer 4 [ 1:main 0.020] check start
    Layer 4 [15:C.usb/Conn 0.020] is >up
    Layer 4 [ 1:main 0.020] check end: want_up 1 some 1>1 all 0>0, going 1 up 4 down 0
    Layer 0 [16:C.usb/USBdr 0.020] send_Local done
    Layer 0 [16:C.usb/USBdr 0.999] starting send_Local
    Layer 0 [18:C.usb/usbL 0.999] SendUSB(064): 01 13 09 00 08 00 01 0F 01 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Layer 0 [18:C.usb/usbL 0.999] StartSend 55a768ec79a0
    Layer 0 [16:C.usb/USBdr 1.030] send_Local done
    Layer 0 [18:C.usb/usbL 1.030] RecvUSB(064): 01 13 0B 00 08 00 03 0F 02 00 00 01 00 04 08 02 00 FD 00 03 FC BC 02 3C E4 05 0E 04 71 07 07 EB 00 A7 01 36 03 00 00 00 03 00 14 0A 63 00 00 00 03 00 03 B8 50 1B 89 00 00 00 03 00 6F 27 00 00
    Layer 2 [16:C.usb/USBdr 1.030] recv_Data(064): 01 13 0B 00 08 00 03 0F 02 00 00 01 00 04 08 02 00 FD 00 03 FC BC 02 3C E4 05 0E 04 71 07 07 EB 00 A7 01 36 03 00 00 00 03 00 14 0A 63 00 00 00 03 00 03 B8 50 1B 89 00 00 00 03 00 6F 27 00 00
    Layer 1 [16:C.usb/USBdr 1.030] Using EMI version 3
    Layer 2 [17:C.usb/Conv 1.030] send_Init 3
    Layer 0 [17:C.usb/Conv 1.030] starting send_Local
    Layer 0 [18:C.usb/usbL 1.030] SendUSB(064): 01 13 0A 00 08 00 02 0F 03 00 00 05 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Layer 0 [18:C.usb/usbL 1.031] StartSend 55a768ec79a0
    Layer 0 [17:C.usb/Conv 1.035] send_Local done
    Layer 2 [22:C.usb/CEMI 1.035] OpenL2
    Layer 5 [15:C.usb/Conn 1.035] >up => up
    Layer 4 [15:C.usb/Conn 1.035] up
    Layer 5 [15:C.usb/Conn 1.035] Started
    Layer 4 [ 1:main 1.035] check start
    Layer 4 [ 1:main 1.035] check end: want_up 1 some 1>1 all 0>1, going 0 up 5 down 0
    Layer 4 [ 1:main 1.035] all drivers up
    Layer 4 [ 1:main 1.035] up
    Layer 0 [18:C.usb/usbL 5.861] RecvUSB(064): 01 13 2F 00 08 00 27 01 03 00 00 29 0A 02 08 03 00 FD 00 0C 5D D4 06 2C E7 05 FF 00 00 13 07 EB 03 EA 01 FF 00 FD C4 00 FD 00 0C 5D D4 00 00 00 03 00 03 B8 50 1B 89 00 00 00 03 00 6F 27 00 00
    Layer 0 [17:C.usb/Conv 5.861] RecvEMI(039): 29 0A 02 08 03 00 FD 00 0C 5D D4 06 2C E7 05 FF 00 00 13 07 EB 03 EA 01 FF 00 FD C4 00 FD 00 0C 5D D4 00 00 00 03 00
    Layer 7 [22:C.usb/CEMI 5.861] Length? invalid (2ce7)
    Layer 2 [22:C.usb/CEMI 5.861] unparseable EMI data(039): 29 0A 02 08 03 00 FD 00 0C 5D D4 06 2C E7 05 FF 00 00 13 07 EB 03 EA 01 FF 00 FD C4 00 FD 00 0C 5D D4 00 00 00 03 00
    Layer 0 [18:C.usb/usbL 41.843] RecvUSB(064): 01 13 24 00 08 00 1C 01 03 00 00 29 0A 02 08 02 00 FD 00 03 FC BC 05 3C E4 05 0B 04 1E 08 07 EB 01 80 01 34 00 19 00 00 FD 00 0C 5D D4 00 00 00 03 00 03 B8 50 1B 89 00 00 00 03 00 6F 27 00 00
    Layer 0 [17:C.usb/Conv 41.843] RecvEMI(028): 29 0A 02 08 02 00 FD 00 03 FC BC 05 3C E4 05 0B 04 1E 08 07 EB 01 80 01 34 00 19 00
    Layer 7 [22:C.usb/CEMI 41.843] Length? invalid (3ce4)
    Layer 2 [22:C.usb/CEMI 41.843] unparseable EMI data(028): 29 0A 02 08 02 00 FD 00 03 FC BC 05 3C E4 05 0B 04 1E 08 07 EB 01 80 01 34 00 19 00
    Layer 0 [18:C.usb/usbL 41.894] RecvUSB(064): 01 13 26 00 08 00 1E 01 03 00 00 29 0A 02 08 02 00 FD 00 03 FC BC 06 3C E4 05 0B 04 1E 0A 07 EB 01 80 01 FF 00 FD FE 00 00 00 0C 5D D4 00 00 00 03 00 03 B8 50 1B 89 00 00 00 03 00 6F 27 00 00
    Layer 0 [17:C.usb/Conv 41.894] RecvEMI(030): 29 0A 02 08 02 00 FD 00 03 FC BC 06 3C E4 05 0B 04 1E 0A 07 EB 01 80 01 FF 00 FD FE 00 00
    Layer 7 [22:C.usb/CEMI 41.894] Length? invalid (3ce4)
    Layer 2 [22:C.usb/CEMI 41.894] unparseable EMI data(030): 29 0A 02 08 02 00 FD 00 03 FC BC 06 3C E4 05 0B 04 1E 0A 07 EB 01 80 01 FF 00 FD FE 00 00
    Layer 0 [18:C.usb/usbL 50.844] RecvUSB(064): 01 13 23 00 08 00 1B 01 03 00 00 29 0A 02 08 02 00 FD 00 03 FC BC 02 3C E4 05 02 04 11 07 07 EB 00 A7 01 34 64 01 FE 00 00 00 0C 5D D4 00 00 00 03 00 03 B8 50 1B 89 00 00 00 03 00 6F 27 00 00
    Layer 0 [17:C.usb/Conv 50.844] RecvEMI(027): 29 0A 02 08 02 00 FD 00 03 FC BC 02 3C E4 05 02 04 11 07 07 EB 00 A7 01 34 64 01
    Layer 7 [22:C.usb/CEMI 50.844] Length? invalid (3ce4)

    1. Hi bohtho,

      I’ve seen you’ve already created a new issue at the knxd project site. My knowledge in cEMI protocol details is very “limited” 🙂

      Michael

  91. Hi Michael

    Now it works perfect. We can monitor and set and reset knx adresses.

    Next step is to get a app working and ETS tunnel via the raspberry.

    A lot of thanks and best regards

    Jim L

  92. Hi Michael,

    Your toturial of knxd has always worked for me, but get it no longer working.
    I have a Rasberry 2 with Rasbian Stretch installed there.
    Here I had Rasbian Jessie and that worked smoothly, only after half a year work was my sd card always corrupt.
    Should something be adapted in the script?
    I would like to see your reaction,

    Thanks.

      1. Hi Michael,

        The knx vbus monitor does not work anymore.
        If I look in my ETS program, then the rasberry is no longer in the found devices and that was previously the case.
        I use the rasberry as an Ip Gateway between a KNX Ip interface and a Gira Home Server.

          1. pi@RPI_KNX-Router:~ $ sudo su
            root@RPI_KNX-Router:/home/pi# ps ax|grep knxd
            548 pts/0 S+ 0:00 grep knxd
            root@RPI_KNX-Router:/home/pi# journalctl -xu knxd.service
            — Logs begin at Thu 2016-11-03 17:16:43 UTC, end at Fri 2018-03-30 10:04:41 UTC
            Mar 30 09:58:44 RPI_KNX-Router systemd[1]: Starting KNX Daemon…
            — Subject: Unit knxd.service has begun start-up
            — Defined-By: systemd
            — Support: …debian.org/support

            — Unit knxd.service has begun starting up.
            Mar 30 09:59:00 RPI_KNX-Router systemd[1]: knxd.service: PID file /run/knxd/knxd
            Mar 30 10:00:30 RPI_KNX-Router systemd[1]: knxd.service: Start operation tim
            Mar 30 10:00:32 RPI_KNX-Router systemd[1]: Failed to start KNX Daemon.
            — Subject: Unit knxd.service has failed
            — Defined-By: systemd
            — Support: …debian.org/support

            — Unit knxd.service has failed.

            — The result is failed.
            Mar 30 10:00:32 RPI_KNX-Router systemd[1]: knxd.service: Unit entered failed start
            Mar 30 10:00:32 RPI_KNX-Router systemd[1]: knxd.service: Failed with result ‘time out
            lines 1-19/19 (END)…skipping…
            — Logs begin at Thu 2016-11-03 17:16:43 UTC, end at Fri 2018-03-30 10:04:41 UTC. —
            Mar 30 09:58:44 RPI_KNX-Router systemd[1]: Starting KNX Daemon…
            — Subject: Unit knxd.service has begun start-up
            — Defined-By: systemd
            — Support: …debian.org/support

            — Unit knxd.service has begun starting up.
            Mar 30 09:59:00 RPI_KNX-Router systemd[1]: knxd.service: PID file /run/knxd/knxd.pid not readable (yet?) after start: No such file or directory
            Mar 30 10:00:30 RPI_KNX-Router systemd[1]: knxd.service: Start operation timed out. Terminating.
            Mar 30 10:00:32 RPI_KNX-Router systemd[1]: Failed to start KNX Daemon.
            — Subject: Unit knxd.service has failed
            — Defined-By: systemd
            — Support: …debian.org/support

            — Unit knxd.service has failed.

            — The result is failed.
            Mar 30 10:00:32 RPI_KNX-Router systemd[1]: knxd.service: Unit entered failed state.
            Mar 30 10:00:32 RPI_KNX-Router systemd[1]: knxd.service: Failed with result ‘timeout’.
            ~

          2. Hi Niels,

            when did you run the script? Whats the version of knxd?

            knxd --version

            “Mar 30 09:59:00 RPI_KNX-Router systemd[1]: knxd.service: PID file /run/knxd/knxd.pid not readable (yet?) after start: ”

            This issue is resolved with commit applied at 20.03.2018.

            I’ve have also switch to master branch (v0.7.15). Please delete the knxdbuild directory and rerun the script.

            Michael

  93. Hi Michael,

    Thank you for your good help.
    The script I used was the v0.7.14 in combination with Raspbian Stretch Lite
    The knxd script now starts up well, but it still does not work well in combination with the Gira Homeserver
    while I have not changed anything on the Gira Homeserver.
    For example, I can read the temparature of the thermostat of the living room in the Gira app,
    but can no longer operate lighting with the Homeserver.
    If I use knxd vbus monitor I can read the bus activity.
    What could this have to do with it?

    thanks,

    Niels

  94. I Michael,
    i have installed knxd on raspberry3 with raspbian stretch, but the service in not runnig:

    knxd.service – KNX Daemon
    Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Sun 2018-04-08 12:18:18 CEST; 2min 20s ago
    Process: 385 ExecStart=/usr/local/bin/knxd -p /run/knxd/knxd.pid $KNXD_OPTIONS (code=exited, status=0/SUCC
    Main PID: 413 (code=exited, status=1/FAILURE)

    Apr 08 12:18:17 raspy3-knx systemd[1]: Starting KNX Daemon…
    Apr 08 12:18:18 raspy3-knx systemd[1]: knxd.service: PID file /run/knxd/knxd.pid not readable (yet?) after s
    Apr 08 12:18:18 raspy3-knx systemd[1]: Started KNX Daemon.
    Apr 08 12:18:18 raspy3-knx systemd[1]: knxd.service: Main process exited, code=exited, status=1/FAILURE
    Apr 08 12:18:18 raspy3-knx systemd[1]: knxd.service: Unit entered failed state.
    Apr 08 12:18:18 raspy3-knx systemd[1]: knxd.service: Failed with result ‘exit-code’.
    the pid file not exist in /run/knxd.
    the knxd version is “knxd 0.14.24-3:42b06c4” but into file that i have download with nano is write “# Version 0.7.15 30.03.2018”
    Stefano

    1. Hi Stefano,

      try to start knxd in foreground with traces enabled:
      Switch to user knxd

      sudo su knxd -s /bin/bash
      

      Then get your knxd options from /etc/default/knxd (for example –eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b tpuart:/dev/ttyAMA0) , remove the -d switch, add the trace switches and start it

      knxd -t 1023 --eibaddr=1.1.128 --client-addrs=1.1.129:8 -D -T -R -S -i --listen-local=/tmp/knx -t 1023 -b tpuart:/dev/ttyAMA0
      

      Any failures?

      Michael

  95. Hi Michael,
    i have try to install knxd on raspbian jessie clean.
    With usb, the daemon is active and only first attempt, the konnex send the packet and switch the light, with the second attempt, the light not switched and the daemon (with “systemctl status knxd” is failed.
    if i restart knxd, first attempt is ok , the second attempt not switch the light.
    the command for switch the light is “groupswrite ip:127.0.0.1 2/0/2 1” , is correct? .
    the knxd version is “knxd 0.14.24-3:42b06c4-emipatch”, but i have download the 7.15 version.
    Thanks
    Stefano

    1. Hi Stefano,

      I think this is an known issue with knxd and USB devices. Have you tried what I have written in my previous comment:

      try to start knxd in foreground with traces enabled to see whats happend.
      Killall knxd processes and switch to user knxd

      sudo killall knxd
      sudo su knxd -s /bin/bash
      

      Then get your knxd options from /etc/default/knxd (for example usb –eibaddr=1.1.128 –client-addrs=1.1.129:8 -d -D -T -R -S -i –listen-local=/tmp/knx -b usb:) , remove the -d switch, add the trace switches -t 1023 and start it

      knxd -t 1023 --eibaddr=1.1.128 --client-addrs=1.1.129:8 -D -T -R -S -i --listen-local=/tmp/knx -t 1023 -b usb:
      

      Whats the error message before knxd exits? “Driver timed out trying to send” ?

      At the weekend I tried the calimero KNXnet server and I wrote a script to install it from scratch. It works fine for me with a TPUART Module, USB Devices are also supported. May be you want to try it. I try to support you to gets it running.

      Michael

      1. Hi Michael,
        i get the same result, first attempt is ok, second not ok.
        yes the error message is “Driver timed out trying to send”
        Why the knxd version is 7.14 and not 7.15?
        in Calimero is supported USB and router ip?
        thanks for your time and i try your script.
        i install raspbian jessie or stretch for your calimero script?
        Stefano

      2. Hi Michael,
        i saw a strange thing,
        at start raspbian, the knxd service with ip router is failed, if i press “systemctl start knxd” the service is running and i switch the light many times.
        if i restart raspbian the service is failed ecc…
        Stefano