Difference between revisions of "Bash dce knx"

From LinuxMCE
Jump to: navigation, search
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[ Category : EIB ]]
+
[[Category: EIB/KNX]]
 +
[[category: Automation]]
 +
{{versioninfo|810Status=Compatible|810UpdatedDate=1st May 2010|810UpdatedBy=totallymaxed|710Status=Compatible|710UpdatedDate=1st May 2010|710UpdatedBy=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 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 ;-)
Line 5: Line 7:
 
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.
 
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;
+
== Install the packages ==
 
Make a directory for bash-dce-knx
 
Make a directory for bash-dce-knx
  
Line 11: Line 13:
 
  mkdir bash-dce-knx <return>
 
  mkdir bash-dce-knx <return>
 
  cd bash-dce-knx <return>
 
  cd bash-dce-knx <return>
 
+
 
  wget http://diapub.com/files/bash-dce-knx.tgz <return>
 
  wget http://diapub.com/files/bash-dce-knx.tgz <return>
 
+
 
  tar -xzvf bash-dce-knx.tgz <return>
 
  tar -xzvf bash-dce-knx.tgz <return>
  
Line 22: Line 24:
 
  mkdir sources <return>
 
  mkdir sources <return>
 
  cd sources <return>
 
  cd sources <return>
 +
 +
svn co http://svn.linuxmce.org/svn/branches/LinuxMCE-0710/src/ <return>
  
svn checkout http://svn.linuxmce.org/pluto/trunk/src/ <return>
+
[[User:Posde|posde]] Someone please verify, that this works with TRUNK. If not, replace trunk with branch/LinuxMCE-0710
  
or try the new community svn here;
+
  cp /usr/pluto/lib/* src/lib <return>
 
+
svn checkout http://svn.charonmedia.org/trunk/src/ <return>
+
 
+
then do;
+
 
+
  cp /usr/pluto/lib/* pluto/src/lib <return>
+
  
 
To compile the DCE whisperer, you have to set, and export, the DCE_PATH
 
To compile the DCE whisperer, you have to set, and export, the DCE_PATH
Line 37: Line 35:
  
 
  export DCE_PATH=/home/bash-dce-knx/pluto/src <return>
 
  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
 
After DCE_PATH is set, and exported, you can build the package with this
 
command, in the DCE-whisperer directory:
 
command, in the DCE-whisperer directory:
  
 +
sudo apt-get install debhelper fakeroot <return>
 
  dpkg-buildpackage -rfakeroot -b -us -uc <return>
 
  dpkg-buildpackage -rfakeroot -b -us -uc <return>
  
Line 57: Line 60:
 
  apt-get install socat <return>
 
  apt-get install socat <return>
  
2. Go into the pluto-admin website, in Interfaces, and add a EIB device
+
== Configure ==
Edit the EIB device template, and make the command line field say KNX.sh
+
#Go into the pluto-admin website, in Interfaces, and add a EIB device  
Set the serial port to the corresponding USB port (last time there was just one serial usb adaptor: that of the SIM-KNX 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 ;-)
 +
 
 +
== SIM-KNX ==
  
3. 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
+
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 [http://www.tapko.de/uploads/tx_neofileshare/SIM-KNX_Documentation.pdf] for technical details of the SIM-KNX.
  
4. 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
+
== IP-KNX Gateway ==
  
5. Setup the floorplans.
+
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 [http://www.usinglinux.org/net/bcusdk-eibd.html] allowing us to read/write to the bus directly using an IP-KNX gateway.
  
6. Reboot, (regen?) and it should work ;-)
 
  
[[User:Totallymaxed|Totallymaxed]] 06:52, 16 September 2008 (PDT)
+
[[User:Totallymaxed|Totallymaxed]] 19:04, 08 April 2009 (GMT)

Latest revision as of 14:04, 29 July 2010

Version Status Date Updated Updated By
710 Compatible 1st May 2010 totallymaxed
810 Compatible 1st May 2010 totallymaxed
1004 Unknown N/A N/A
1204 Unknown N/A N/A
1404 Unknown N/A N/A
Usage Information

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>

Configure

  1. Go into the pluto-admin website, in Interfaces, and add a EIB device
    1. Edit the EIB device template, and make the command line field say KNX.sh
    2. Set the serial port to the corresponding USB port (last time there was just one serial usb adaptor: that of the SIM-KNX device).
  2. 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
  3. 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
  4. Setup the floorplans.
  5. Reboot, (regen?) and it should work ;-)

SIM-KNX

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 [1] for technical details of the SIM-KNX.

IP-KNX Gateway

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 [2] allowing us to read/write to the bus directly using an IP-KNX gateway.


Totallymaxed 19:04, 08 April 2009 (GMT)