Bash dce knx
From LinuxMCE wiki
|Version||Status||Date Updated||Updated By|
|710||Compatible||1st May 2010||totallymaxed|
|810||Compatible||1st May 2010||totallymaxed|
This page describes how to use the bash based DCE-KNX software to communicate with KNX devices attached to EIB Bus that has been interfaced to your Core. Its fully bi-directional and can be easily extended as apart from a small C program it is written totally in bash. The docs here are far from complete but should enable you to add this capability to your Core and interface to the EIB bus. More docs to follow ;-)
This code currently only works with SIM-KNX (Serial Interface Module for KNX) and you will need one of these interfaces attached to the EIB bus you want your Core to communicate with.
Install the packages
Make a directory for bash-dce-knx
cd /home <return> mkdir bash-dce-knx <return> cd bash-dce-knx <return> wget http://diapub.com/files/bash-dce-knx.tgz <return> tar -xzvf bash-dce-knx.tgz <return>
cd into the bash-dce-knx directory;
Now go and get the LinuxMCE sources...from the console type;
mkdir sources <return> cd sources <return> svn co http://svn.linuxmce.org/svn/branches/LinuxMCE-0710/src/ <return>
posde Someone please verify, that this works with TRUNK. If not, replace trunk with branch/LinuxMCE-0710
cp /usr/pluto/lib/* src/lib <return>
To compile the DCE whisperer, you have to set, and export, the DCE_PATH variable first to the location of the pluto/src directory on your system.
export DCE_PATH=/home/bash-dce-knx/pluto/src <return>
if using the charonmedia trunk use;
export DCE_PATH=/home/bash-dce-knx/trunk/src <return>
After DCE_PATH is set, and exported, you can build the package with this command, in the DCE-whisperer directory:
sudo apt-get install debhelper fakeroot <return> dpkg-buildpackage -rfakeroot -b -us -uc <return>
The DCE-whisperer package is used by the sample KNX device to talk to the DCE framework. It still has some problems: it is unable to reply to messages. Their also isn't any bash framework in place, so the KNX.sh script, in the dianemo-knx directory, implements a crude framework for talking to DCE and the serial bus. KNX.sh also makes use of the fdselect program, so it can do something that other programming languages did for ages: test file descriptor status and know exactly which one requires attension. It only implements the "read fd" parameter of the select(2) C function, as the rest are not needed for this application.
Other requirements: socat
apt-get install socat <return>
- Go into the pluto-admin website, in Interfaces, and add a EIB device
- Edit the EIB device template, and make the command line field say KNX.sh
- Set the serial port to the corresponding USB port (last time there was just one serial usb adaptor: that of the SIM-KNX device).
- Go in Lights, add a on/off light. Set its room. Write "$00 $03" (w/o the quotes) in the "Port/Channel number" Device Data
- Go in Climate, add a Generic Thermostat. Set its room. Write "$$ $32" (double dollar sign is correct, w/o the quotes) in the "Port/Channel number" Device Data
- Setup the floorplans.
- Reboot, (regen?) and it should work ;-)
You need to define some group addresses in your SIM-KNX module that map to actual group address on the bus. The "$00 $03" and "$$ $32" are adresses in a SIM-KNX that map to ports on the bus. The SIM-KNX modules come with either 128 or 256 configurable memory locations that you can read/write to. Each memory location in the SIM-KNX reflects a group address on the actual bus. Therefore you need to program the SIM-KNX using a standard KNX-EIB tool like ETS3 or write your own. See  for technical details of the SIM-KNX.
We are looking at creating another version of bash-dce-knx that will talk directly to the KNX-EIB bus and will be implimented with the BCUSDK  allowing us to read/write to the bus directly using an IP-KNX gateway.
Totallymaxed 19:04, 08 April 2009 (GMT)