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

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

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

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..

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

Advertisment to support michlstechblog.info

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.

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

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

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

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.

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)

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

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.

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.

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):

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!

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?

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.

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

Michael December 1, 2016 at 11:51 AM

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.

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.

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

Adrian December 4, 2016 at 7:00 PM

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!

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

Michael

Vince November 27, 2016 at 2:10 AM

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.

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.

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.

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.

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(:

– 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?

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.

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.

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 🙂

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).

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 🙂

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.

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

Thorsten February 14, 2017 at 6:54 PM

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?

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 …

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

marc August 25, 2017 at 7:06 PM

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?

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.

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

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…

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:

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.

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 .

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.

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.

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

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):

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:

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 ? –

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:

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

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 🙂 )

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?

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

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.

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

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.

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.

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.

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

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

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.

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:

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

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 ?

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.

” [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

Marco September 19, 2017 at 9:52 PM

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).

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.

Hi Michael,
Yes, changing the Type from forking to simple was doing it.
Awesome. Thank you so much.

Dirk

Holo September 20, 2017 at 10:09 AM

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::

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!

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.

Michael September 21, 2017 at 4:11 PM

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

Holo September 22, 2017 at 11:47 AM

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.

Michael September 22, 2017 at 12:51 PM

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.

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)

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 🙂

Michael September 26, 2017 at 9:54 AM

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

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

Holo September 27, 2017 at 8:35 AM

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!!

Michael September 27, 2017 at 9:13 AM

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

Michael October 2, 2017 at 7:19 AM

Hi Holo,

Marc has the same problem. Please could you also provide log files and your device to the issue:

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.

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?

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.

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:-(

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

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

Michael January 18, 2018 at 8:12 AM

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.

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.

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?

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 manuallysystemd start knxd
-What does journalctl saysjournalctl -xu knxd.service
-What are the last lines of your debug logfile /tmp/knxd_trace.txt

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.

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.

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

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)

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?)

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

Michael February 5, 2018 at 7:01 AM

Hi Marco,

does the knxd busmonitor show the the packets send by openhab?

Michael

Marco February 13, 2018 at 6:20 PM

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:

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.

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.

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.

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?

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

bohtho March 6, 2018 at 8:47 PM

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.

Michael March 7, 2018 at 8:38 AM

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.

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

Jim L March 6, 2018 at 6:40 PM

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.

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,

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.

I’ve have also switch to master branch (v0.7.15). Please delete the knxdbuild directory and rerun the script.

Michael

Niels April 3, 2018 at 6:35 PM

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?

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

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.

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

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

Hi Michael,
the network interfaces is static and cable, when the desktop is on if i press on the shell ‘sudo systemctl start knxd’, the service on and i see active with ‘systemctl status knxd’.
in the weekend i try the calimero and i report to you.
Stefano

Michael April 13, 2018 at 11:58 AM

Hi Stefano,

ok, in the evening I’ll publish an updated version which configures calimero to use USB.

After hours of struggling, i can’t get running knxd on my raspberry.
I used to have an older raspberry running wheezy (eibd which i installed using your other post michlstechblog.info/blog/raspberry-pi-eibd-with-a-knx-usb-interface), which ran for years, but now my old raspberry gave up and doesn’t boot at all anymore, so had to install all again on a raspberry 2+

No it is not opened by any other proces, at least , lsof does not show any.
Offcourse the bus is connected, the yellow LED on the tpuarts is lighten up (but i understand your question).

Other remarks : the page github.com/knxd/knxd/wiki/Adding-a-busware-pigator-KNX-TPUART-(Raspberry) says to add the TPUART to /etc/udev/rules.d/70-knxd.rules, in your tutorial above, you’re talking about /etc/udev/rules.d/90-knxusb-devices.rules
Currently i have them in both, but what should be the correct one ?

extra question : do you have any idea what they mean with : After a reboot you will have a device /dev/ttyAMA0 which is owned by knxd, it has a new link /dev/ttyKNX1 which can be used for the knxd –layer2:tpuarts:/dev/ttyKNX1

update : just received my busware.de/tiki-index.php?page=POD and after installation and without touching anything, the script of michael did do the job activating the whole interface
Magnificent job michael !

I just got it almost to work on my Raspberry 2 with Züblin USB interface.
To get it work I added the following rule to /etc/udev/rules.d/90-knxusb-devices.rules:
# Züblin KNX USB Interface
SUBSYSTEM==”usb”, ATTR{idVendor}==”28c2″, ATTR{idProduct}==”0007″, ACTION==”add”, GROUP=”knxd”, MODE=”0664″

My problem is, that it fails to start after reboot. But I can start it manually:

open /lib/systemd/system/knxd.service and remove the comment/hash sign at the beginning of the line followed below. Adjust the interface parameter to your network interface (if it is not eth0 🙂 )
ExecStartPre=/lib/systemd/systemd-networkd-wait-online –timeout=60 –interface=eth0

Hi Michael,
thanks for this great installation script! You saved a lot of time, for a lot of people!

One thing, I don’t get resolved, is that I can use vbusmonitor on the machine itself and use the node-js scripts to access the bus (read and write), but from a remote machine, I don’t get any usable connection. trying to Telnet to the TCP Port will give a connection, so I don’t think its a firewall thing.
Using ETS the Router is not found, neither by multicast, nor unicast.
I’m using weinzierl kberry interface one a PI3, adjusted the knxd arguments to “ft12cemi” driver.
Starting KNXD in foreground as described, I see a lot off traffic passing by as well.

ok, knxd is running but not accessible from other machines, am I right? Are the devices which should access knxd in the same IP Subnet? Usually multicast works only in the same subnet expect the router is configured to forward IGMP…. but an Unicast connection by specifying the IP Address should work.

I’ve configured the network to use systemd as described by you, following every step. So I’ve had the route to the mcast address. For testing, I’ve removed this static route, but it behaves the same way.

Rolf

Michael July 12, 2018 at 6:25 AM

Hi Rolf,

may be the issue resides on the node-js machine? Have you already startet a tcpdump there? Can you see the multicast packets from knxd there?

Michael

Rolf July 11, 2018 at 5:28 PM

Hi Michael,
one progress is made….
from googeling around and having learned that the TCP Server is more or less useless (I don’t have an Idea what it could be used for…) I’ve thrown out the -i option.
And now, at least the access over Unicast Address is working from remote. I’ve used a node-js script to retrive Bus Data, and can see the packets. I’ll try later with ETS again.
Regards, Rolf

Rolf July 12, 2018 at 12:32 PM

Hi Michael,
when doing a tcpdump on the node-js machine, I can see outgoing Packets towards the group address, but noting inbound.
Last evening my colleague came by with his ETS5 notebook and he could connect with ETS5 over knxd installation to the bus.
For the moment, this is all I need, and I’ve had that much stress with mulicasts and IGMP and PIM in the past, that I think a direct Unicast Tunnel is more my style 🙂
So thanks for guiding me through the analysis. I still have no Idea, why switching off the TCP Server made it working, but now I got a cheap and powerful interface.
Regards, Rolf

Really weird!
I have been using this for 2 years. Maybe 6 months since I used it towards ETS5 last time. Now I am trying to setup HASSIO so I need a connection, and suddenly I find out that ETS5 won’t accept a connection anymore, giving me this message: “The interface cannot be opened, because the connection type is not supported. Please contact the manufacturer of your interface”.
Only thing I know I have done to my router is to now alow “Telnet” on the network. No other changes.

Have you got any ideas whats up? Is there a newer version I should use for this?

Hi
I have installed knxd to your instructions. But it does not start for more then 2 seconds. I guess it has to do something with the hardware drivers becouse I have a USB2Serial adapter from Prolific that is connected via serial cable to a Tapko serial interface.

I don’t understad if i should use uart/usb/ or something else.

I have added in /etc/udev/rules.d/90-knxusb-devices.rules a ,line with
/etc/udev/rules.d/90-knxusb-devices.rules SUBSYSTEM==”usb”, ATTR{idVendor}==”067b”, ATTR{idProduct}==”2303″, ACTION==”add”, SYMLINK+=”usbKNX0″, GROUP=”knxd”, MODE=”0664″

What driver should I uses with a USBtoserial adapter? I can use a terminal program to connect to /dev/ttyUSB0 and if I press the buttons in the house i get the knx message in the terminal window. But if i start knxd i havwe no qlue if i would use tpuart, usb, fb12 or anything else.

I think its impossible that this device deals with knxd. Because it uses a proprietary “serial ASCII Protocol”. knxd only supports tpuart, ft12 and pei16. All of these protocols aren’t ASCII protocols.

Hey Michael,
i have a RPI 3 with a Merten USB adapter in use.
my problem:
i can see the packages on the by typing “knxtool vbusmonitor1 ip:localhost”
Ets 5 tells me when I click on test that my connection is OK, but I’m not able to programm my hardware.
Any ideas?

Hi Michael.
I`m new to the raspberry PI but has used the ETS3 for programming KNX systems for a while.
I?m trying to follow you on this tutorial, but I`m struggeling.

I hav a RPI 3 b with a Merten USB adaptor. (also a Gira if that makes it easyer)

I can not get the sytem up and running.
I have installes the newest “Raspbian Stretch with desktop and recommended software” from raspberrypi.org
I have set a fixed IP on the wlan0 to 100.0.0.160
I have run the script as you have described in this turorial, after the best of my knowlege……
But i can not seem to get the knxd running.

I tested install_knxd_systemd.sh version 0.7.15
I have raspberry pi 2 with raspbian/debian stretch that have new systemd based service system.
I have also Siemens N148/21 interface to knx
I can start knxd manually.
There is 3 problems
– knxd does not start automatically after reboot of raspberry
– knxd does not start automatically if I kill knxd with kill command
– I cannot do programming with ets4

I have solved all of these problems.
Automatic start do work if do not use install_knxd_systemd.sh at all
Instead I follow these guides
github.com/knxd/knxd
smarthomeng.de/user/installation/komplettanleitung_knx.html
wiki.fhem.de/wiki/Knxd

After following these guides
I get totally different looking file
/lib/systemd/system/knd.service
—-
[Unit]
Description=KNX Daemon
After=network.target knxd.socket
Requires=knxd.socket

This website uses cookies to improve your experience and to serv personalized advertising by google adsense. By using this website, you consent to the use of cookies for personalized content and advertising. For more information about cookies, please see our Privacy Policy, but you can opt-out if you wish. AcceptRejectRead More