KNX is a worldwide standard for home and building control. In addition to siemens and wago PLC systems, KNX should also be teached in our school. We have to provide the software setup for the students and this brought me to a new challenge. The KNX software is secured by a dongle. Basically this is not a problem (We have other software where the licences are also managed by a dongle), but our other dongles can something that KNX can’t. They have network compatibility and can concurrently manage more than 1 Licence. Sadly KNX doesn’t provide such a solution. They have only dongles that store one license and no network setup for concurrent licences.
How do I get a virtual machine access to a KNX Dongle. I’ve discovered a interessting solution called virtual here. Virtualhere can be used to share USB Devices over the network. It is simple and can be used for Linux, OSX and Windows.
My idea was to setup a RaspberryPI that run a virtualhereserver. A USB 3.0 Hub is connectet to the raspberryPI where I plug in the KNX dongles and share them over the network.
The installation of raspian OS is pretty simple:
- Write Raspbian OS to microSD Card (https://www.raspberrypi.org/downloads/)
- Boot raspian and set a static ip address
- sudo /etc/network/interfaces
- Set hostname
- sudo nano /etc/hostname
- If you want change keyboardlayout to Switzerland in /etc/default/keyboard
- Install latest Raspberry PI Firmware:
- sudo apt-get install rpi-update
- sudo rpi-update
Install virtualhereserver with the following commands:
- ssh to your raspberry pi
sudo chmod +x ./vhusbdarm
sudo mv vhusbdarm /usr/sbin
sudo chmod +x ./vhusbdpin
sudo mv vhusbdpin /etc/init.d
sudo update-rc.d vhusbdpin defaults
The windows client is just a portable exe file:
If you execute it and connect to the raspbery pi it will automatically install the drivers. I’ll preinstall the drivers in the operatingsystem image with a simple script:
If the virtualhere server and client component is running it’s possible to connect the shared usb devices in to the virtual machine. (if the server is in trial mode you can connect only one device, otherwise you have to buy a license)