Menu

Accessing_the_KNX_bus

jef2000 Damago

Currently (as of 2019) the recommended tool to connect to KNX BUS is by using the knxd daemon. This is a fork of a no longer maintained eibd project. Please note, that some of the below information might be outdated - please consult the current documentation for knxd project.

Toolchain

The whole toolchain is:
knxd <--> linknx <--> knxweb

knxd is used to read the raw KNX/EIB messages from a physical interface and translates them to IP messages.
LinKnx connects to knxd and does all the heavy lifting (homeserver functions - actions based on rules) and exposes XML interface for other tools - visualisation or control via XML api
KnxWeb2 is used to visualize the state of the building and allows interaction with the whole system

Physical connection to the bus

As far as physical connection is concerned there are several ways to connect EIBD to the KNX bus. Here's the list coming from the EIBD homepage;:

  • KNX on USB This is the most popular method to connect to KNX bus today. Requires the physical KNX <--> USB bridge device
  • FT1.2 / BCU 2 - this is a port connecting to KNX's green cable on one side, and exposing serial connection (com) on the other. To use it you have to have a serial port connector on computer. Please note that it is NOT full RS-232 because it uses 0V--3.3V logic instead of -12V -- +12V logic of an original RS-232. For this purpose any FTDI based interface should work. Computers like Raspberry Pi can connect to FT1.2 port directly. For computers like Raspberry PI this is the cheapest option because FT1.2 protocl is exposed by most KNX sensors (for instance wall switches etc).
  • PEI16 / BCU 1 (using the BCU 1 kernel driver or an experimental user mode driver)
  • TPUART (The use of the TPUART kernel driver is supported, but the user mode implementation is simpler to use and lacks no features)
  • EIBnet/IP Routing and Tunneling -if you have some physical KNX/TCP-IP routing device in your switchboard

The choice between the different solutions depends mainly on the device you have, money you are ready to spend and your skills at building some electronics.

EIBnet/IP tunneling

Using a KNX/IP interface like Siemens N148/21, you can esaily connect EIBD to your domotic installation with just an ethernet cable.
Example eibd command:

eibd -d -D -S -T -i ipt:192.168.178.21:3671

KNX on USB

If your device running eibd has USB host ports, it should be possible to connect a KNX/USB interface to it.
Example eibd command:

usbport=$(findknxusb | /bin/sed -e '1 d' -e 's/device //' | /bin/cut -d':' -f1-2)
eibd  -d -D -S -T -i usb:$usbport

FT1.2 / BCU 2

A BCU is a KNX bus coupling unit. It has a KNX bus connector on one side and a 10 pole connector on the other side called PEI interface (with ground, +5V, Rx, Tx, ...). The BCU contains a microcontroller executing the KNX protocol stack and allowing (among others) serial communication on the PEI interface. With the new version of BCU called BCU2, a new protocol (called FT1.2) has been defined on the PEI interface. This new protocol only uses Rx and Tx (no RTS/CTS), and this allow it to be used with serial ports having only Rx and Tx.

Linksys WRT54G/GS/GL

The Linksys WRT54G(S) has no externally accessible RS232 interface. On the electronic board, there is a connector where you can find the Rx and Tx signals of the serial ports, but the electrical levels are 0V / 3V3 (while RS232 is +12V / -12V). With the signals on this connector, it's possible to connect a RS232 interface like the one described at http://www.rwhitby.net/projects/wrt54gs

The role of the hardware I built is to adapt the serial signal between 3V3 of the Linksys router and the 5V signal of the BCU2. I used Optocouplers to ensure galvanic separation of the 2 systems.

Schematic of my hardware can be found here:
http://ouaye.net/linknx/bcu-interface/bcu-uart-interface.png
CON1 is the connector on linksys and CON2 on the PEI interface of BCU2
center

I also heard about a much simpler interface, simply using 2 resistor to achieve 45,3 kOhm needed to set the BCU in FT1.2 mode and connecting Rx of Linksys to Tx of BCU2 through a 1 kOhm resistor and Tx of Linksys to Rx of BCU2.
More details here (In German):
http://knx-user-forum.de/showpost.php?p=17261&postcount=116

Raspberry Pi

Raspberry Pi is the recommended solution if you want to install LinKnx on a small, reliable, cheap physical device. The advantage is built in serial port (enabling direct connection to FT1.2 port), USB port (if you prefer to use KNX-USB gateway) so you can install knxd on the same machine.

Virtual machines

HyperV, VmWare, Proxmox etc. virtual machines can be used to run LinKnx. Please note however that in such case the knx-ip gateway must be installed as physical device, or you have to divert COM port from FT1.2 or divert USB connection to virtual machine if you want to install knxd on the same computer.


Related

Wiki: Main_Page

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.