raspberry-enocean

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
raspberry-enocean [2015/03/26 15:54]
Stéphane Lavirotte
raspberry-enocean [2015/03/27 15:56] (current)
Stéphane Lavirotte [Headline]
Line 8: Line 8:
  
 First of all you have to connect the EnOcean Pi to the Raspberry. Do this before powering up the Raspberry Pi. First of all you have to connect the EnOcean Pi to the Raspberry. Do this before powering up the Raspberry Pi.
-The serial port of the GPIO must be disable (it's normally used for console debugging in standard configuration). ​Tio achieve this, you have to do the following commands:+The serial port of the GPIO must be disable (it's normally used for console debugging in standard configuration). ​To achieve this, you have to do the following commands:
  
 <​code>​ <​code>​
Line 22: Line 22:
  
 ===== Install the Fhem.de building automation server for testing purposes ===== ===== Install the Fhem.de building automation server for testing purposes =====
 +
 +Fhem is a building automation server . We will use it to verify that everything is well configured.
 +
 +==== Install Fhem for testing purposes ====
  
 As an example, to be able to test if your environment is well configured, you can install Fhem. Do the following to achieve this. As an example, to be able to test if your environment is well configured, you can install Fhem. Do the following to achieve this.
Line 37: Line 41:
 </​code>​ </​code>​
  
 +==== Headline ====
 +
 +=== Install Dolphin View Advance to test on Windows ===
 +
 +To be able to test your hardware and discover it under Windows, you will need to install Dolphin View (or Dolphin View Advanced). You can download this software after registration on [[https://​www.enocean.com/​fr/​download/​|EnOcean Development Tools]].
 +
 +{{:​public_namespace:​dolphin_view.jpg?​400|}}
 +
 +=== Configure Fhem to test on Raspberry Pi ===
 +
 +Go to ''​Edit files''​ and select ''​fhem.cfg''​
 +Add the following lines if then OceanPi is not automatically recognized:
 +<​code>​
 +define TCM_ESP3_0 TCM ESP3 /​dev/​ttyAMA0@57600
 +</​code>​
 +
 +The go to ''​Everything''​ and select ''​TCL_ESP3_0''​. Send the following command:
 +<​code>​
 +set TCP_ESP3_0 teach 600
 +</​code>​
 +
 +Then take all your EnOcean devices and click on them: click on switches to send an event and click on the learn button to send a datagram to discover the equipment. Then you can go the ''​EnOcean''​ and you can find all the equipment recognized by Fhem.
 +
 +So now you know that everything is functional without programming anything.
 +
 +<note warning>​Be careful: you must stop and/or uninstall the Fhem server before trying to communicate with another program to listen to events, else you will notice some problems like not receiving all events (some of them may be cacthed by Fhem).</​note>​
 +
 +===== Compile EnOcean Link Library =====
 +
 +To be able to develop your own program with EnOcean protocol, you will have to get and compile the library.
 +
 +  - Download [[https://​www.enocean.com/​it/​enocean-software/​enocean-link/​|EnOcean Link]].
 +  - Instruction to [[https://​www.enocean.com/​fileadmin/​redaktion/​support/​enocean-link/​compile.html#​raspberry|compile the library for Raspberry Pi]].
 +    * Modify ''​Sandbox.cpp''​ to specify ''#​define SER_PORT "/​dev/​ttyAMA0"''​ instead of /​dev/​ttyUSB0 if you use EnOcean Pi (/​dev/​ttyUSB0 is used for EnOcean USB300 key)
 +    * To compile the library on the Raspberry Pi (not using cross-compilation)
 +<​code>​
 +sudo apt-get install autoconf automake autotools-dev m4 libtool
 +cd EOLink
 +chmod +x configure
 +./configure CPPFLAGS="​-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s"​
 +make
 +</​code>​
 +    * Libraries are compiled in the ''​.libs/''​ directory.
 +
 +To test the library you have multiple programs in ''​Tutorial''​ directory. With the current version tested, there is a problem with missing and depcomp files, so I replaced them.
 +<​code>​
 +cd ../Tutorial
 +chmod +x Tutorial.sh
 +mv depcomp depcom.sav
 +mv missing missing.sav
 +ln -s ../​EOLink/​depcomp .
 +ln -s ../​EOLink/​missing .
 +./​Tutorial.sh
 +cd Tutorials
 +./Tutorial1
 +</​code>​
 +
 +===== Configure to TeachIn sensors =====
 +
 +When you try the Tutorial1 program, you will only recognize the switches. This is due to the fact the you will only recognize this type of sensor. Teaching is defined using ''​myGateway.TeachInModule->​SetRPS(0x02,​0x01);''​. So you only are listening to RPS modules categorized with 0x02 function and of type 0x01. This is the categorized profiles of the different equipments. ​
 +Here is the list of defined [[https://​www.google.fr/​url?​sa=t&​rct=j&​q=&​esrc=s&​source=web&​cd=1&​cad=rja&​uact=8&​ved=0CCUQFjAA&​url=https%3A%2F%2Fwww.enocean.com%2Ffileadmin%2Fredaktion%2Fenocean_alliance%2Fpdf%2FEnOcean_Equipment_Profiles_EEP_V2.6.2_public.pdf&​ei=FmgVVc22A42saffLgMgD&​usg=AFQjCNGABhOdpm_vLy4krYXBxMX5gV6rQA&​sig2=pHiyKIxjs17L5uLf2xyw_g&​bvm=bv.89381419,​d.d2s|EnOcean Equipment Profiles EEP 2.6]]
 +
 +So to be able to detect different kind of sensors, you will have to add them to the TeachInModule like this:
 +<​code>​
 +        myGateway.TeachInModule->​SetRPS(0x02,​0x01);​
 +        myGateway.TeachInModule->​Set1BS(0x00,​0x01);​
 +        myGateway.TeachInModule->​Set4BS(0x02,​0x20);​
 +</​code>​
 + 
 +This code will allow you to detect the following type of devices:
 +  * RPS Telegram: F6-02-01: Light and Blink Control - Application Style 01
 +  * 1BS Telegram: D5-00-01: Single Input Contact
 +  * 4BS Telegram: A5-02-20: 10 bit Temperature Sensor Range -10°C to +41.2°C
 + 
  
  • raspberry-enocean.1427381651.txt.gz
  • Last modified: 2015/03/26 15:54
  • by Stéphane Lavirotte