Building image for Beagle Bone Black Cape KNX 1-Wire

3 min read
Building image for Beagle Bone Black Cape KNX 1-Wire

Installation commands and log for building your own image with KNX and 1-wire support.


Write to 2GB micro sd

Look for bbgw IP address in dhcp 

Benutzer: debian
Passwort: temppwd

$ sudo passwd root
$ root

$ useradd ron --home/home/ron -c /bin/bash
$ passwd ron

$ userdel --remove debian


Rename hostname
In /etc/hosts and /etc/hostname „arm“ replce „bbgw“

$ sudeo dpkg-reconfigure locales
$ sudeo reboot

$ dpkg-reconfigure tzdata

Install 1-wire
$ apt-get install owserver owhttpd
$ sudo vi /etc/owfs.conf
Replace lines „FAKE“ with
server: i2c = dev/i2c-2:0
server: i2c = dev/i2c-3:0
server: i2c = dev/i2c-4:0
server: i2c = dev/i2c-5:0

Browser open http://smartgate:2121 click „bus.0“ you should see Temperaturesensor „28.xxxxxxx“

Install knxd 

$ sudo apt-get install git-core build-essential fakeroot debhelper libusb-1.0 libsystemd-dev dh-systemd libev-dev libfmt3-dev 
$ git clone

$ cd knxd
$ dpkg-buildpackage -b -uc

$ cd ..
$ sudo dpkg -i knxd_*.deb knxd-tools_*.deb
Selecting previously unselected package knxd.
(Reading database ... 32886 files and directories currently installed.)
Preparing to unpack knxd_0.14.25-1_armhf.deb ...
Unpacking knxd (0.14.25-1) ...
Selecting previously unselected package knxd-tools.
Preparing to unpack knxd-tools_0.14.25-1_armhf.deb ...
Unpacking knxd-tools (0.14.25-1) ...
Setting up knxd (0.14.25-1) ...
Adding group `knxd' (GID 114) ...
Adding system user `knxd' (UID 109) ...
Adding new user `knxd' (UID 109) with group `knxd' ...
Creating home directory `/var/lib/knxd' ...
Created symlink /etc/systemd/system/ ? /lib/systemd/system/knxd.service.
Created symlink /etc/systemd/system/ ? /lib/systemd/system/knxd.service.
Created symlink /etc/systemd/system/ ? /lib/systemd/system/knxd.socket.
Setting up knxd-tools (0.14.25-1) ...
Processing triggers for systemd (232-25+deb9u4) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...

Set static ip
$ vi /etc/network/interfaces
# The primary network interface
iface eth0 inet static
    post-up route add -net netmask eth0
    pre-down route del -net netmask eth0

$ update-rc.d -f dhcpd remove

/usr/bin/eibd -e 1.1.0 -c -S -D -i -T –tpuarts-disch-reset –tpuarts-ack-all-group -t0123 -u –pid-file=/var/run/ tpuarts:/dev/ttyO2

–daemon=/var/log/eibd.log -D -T -R -S -i -u -t1023 –eibaddr=1.1.128 usb:1:4:1:0:0?

You can create the content of the ini file by running the following command. Change everything after knxd_args to your own settings:
/usr/lib/knxd_args -e1.1.65 -E1.1.66:8 -i -u -b tpuarts:/dev/ttyO2 -D -R -T -S

/usr/lib/knxd_args -e1.1.65 -E1.1.66:8 -i -u -b tpuarts:/dev/ttyO2 -D -R -T -S
server = knxd_tcp
systemd-ignore = true
server = knxd_unix
systemd-ignore = true
device = /dev/ttyO2
driver = tpuart
name = mcast:knxd
addr = 1.1.65
client-addrs = 1.1.66:8
connections = A.tcp,B.unix,C.tpuarts,server
systemd = systemd
debug = debug-server
discover = true
router = router
server = ets_router
tunnel = tunnel

Give permission to knxd
$ sudo usermod -a -G tty knxd
$ sudo usermod -a -G dialout knxd

#KNXD_OPTS="-e 1.1.0 -c -S -D -i -T –tpuarts-disch-reset –tpuarts-ack-all-group -t0123 -u –pid-file=/var/run/ tpuarts:/dev/ttyO2"
#KNXD_OPTS="-e 0.0.0 -c --no-tunnel-client-queuing  tpuarts:/dev/ttyO2 -D -R -T -S"
#KNXD_OPTS="-e 0.0.1 -E 0.0.2:8 -u /tmp/eib -b ip:"

Works with debug
debug = debug-A.tpuarts
device = /dev/ttyO2
driver = tpuart
error-level = 0x9
trace-mask = 0x3ff
name = mcast:knxd
addr = 0.0.1
client-addrs = 0.0.2:8
connections = server,A.tpuarts
systemd = systemd
debug = debug-server
discover = true
router = router
server = ets_router
tunnel = tunnel

$ sudo vi /etc/udev/rules.d/70-knxd.rules
ACTION=="add", SUBSYSTEM=="tty", KERNELS="ttyS2", SYMLINK+="knx1", OWNER="knxd"

$ udevadm control --reload-rules && udevadm trigger

Change the knxd.ini for knxd.conf ile according to your needs. The interface is /dev/ttyKNX1 from now on!
To restart udev: udevadm control --reload-rules && udevadm trigger
See if /dev/ttyKNX1 is available and linking to /dev/ttyAMA0. If not, reboot and/or retry the steps above or just change the entry "ttyKNX1" to "ttyAMA0" accordingly. Actually it doesn't matter too much.

Restart knxd:
$ sudo systemctl stop knxd.socket
$ sudo systemctl stop knxd.service
$ sudo systemctl start knxd.socket
$ sudo systemctl start knxd.service


$ knxd -e 0.0.1 -E 0.0.2:8 -D -T -R -S -f9 -t1023 -b tpuarts:/dev/ttyS2

Update knxd:
$ rm knxd*.deb
$ cd knxd
$ git pull
$ dpkg-buildpackage -b -uc
$ cd ..
$ sudo dpkg -i knxd_*.deb knxd-tools_*.deb

Related Articles

Enable Google Authenticator 2FA for SSH
1 min read
Misc Linux tips and tricks
2 min read

Virtualbox PCI Passthrough Notes

Some notes regarding exposing a PCI card inside a Virtualbox VM Determine PCI ID on host: vbox@vbox:~$ lspci|grep

1 min read

Virtualbox Admin

I run several machines on top of Virtual Box on Debian (headless). Here some notes I made... Install latest version

2 min read

Repair a non booting GRUB installation

Today I had to fix two issues with my computer not booting through grub bootloader. One of the reasons was

1 min read

Installing ARCH Linux

In my quest to find a modern Linux distribution which could run both Gambas2 and Gambas3 I stumbled upon ARCH

1 min read