Bash dce knx

From LinuxMCE
Revision as of 14:34, 16 September 2008 by Totallymaxed (Talk | contribs)

Jump to: navigation, search

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.

  1. 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 checkout svn.linuxmce.org/pluto/trunk/src/ <return>
cp /usr/pluto/lib/* pluto/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>

After DCE_PATH is set, and exported, you can build the package with this command, in the DCE-whisperer directory:

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

  1. 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
  1. 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
  1. Setup the floorplans.
  1. Reboot, (regen?) and it should work ;-)