The Telldus Tellstick Duo is a tiny usb device to control rf devices such as lightbulbs, thermo meters and a lot of other stuff. The software to control the device is open source and works fine on Ubuntu/Debian, OS X and Windows. People have also documented how to get it to work with CentOS 6. But if you are like me and want to run the latest CentOS version then it is a little bit more complicated. In this guide I will show you how to compile and get it to run on the latest version of CentOS 7.
1. Begin by plugging in your tellstick duo in your machine, if you tail /var/log/messages you will see the following when you plug it in:
1 2 3 4 5 |
Apr 25 16:13:08 plex kernel: usb 4-1: new full-speed USB device number 2 using uhci_hcd Apr 25 16:13:08 plex kernel: usb 4-1: New USB device found, idVendor=1781, idProduct=0c31 Apr 25 16:13:08 plex kernel: usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Apr 25 16:13:08 plex kernel: usb 4-1: Product: TellStick Duo Apr 25 16:13:08 plex kernel: usb 4-1: Manufacturer: Telldus |
2. The next step is to install some repos and libraries so that we can compile the latest version of the software from telldus. Note, if this guide fails you can try to do “yum groupinstall Development Tools” instead.
1 |
yum install gcc gcc-c++ autoconf automake cmake |
3. Install the epel repo
1 2 |
wget http://mirror.nsc.liu.se/fedora-epel/7/x86_64/e/epel-release-7-5.noarch.rpm yum localinstall epel-release-7-5.noarch.rpm |
4. Install all of the libftdi, libusb and libconfuse libraries
1 2 3 |
yum install libftdi* yum install libusb* yum install libconfuse* |
5. Download and unpack the telldus software. At the time of writing the latest package is 2.1.2
NOTE ! depending on your version of Tellstick Duo, version 2.1.2 of the software may not work. If you run in to issues such as error messages saying “TellStick not found” when you run tdtool. try 2.1.1 instead.
If you then run into issues when compiling 2.1.1 with make, you may need to edit the file “telldus-core-2.1.1/common/Socket_unix.cpp”. Make sure you include unistd.h so that it looks like this in the top of the file:
1 2 3 4 5 6 7 8 9 10 11 |
#include "Socket.h" #include "Mutex.h" #include "Strings.h" #include <stdio.h> #include <sys/socket.h> #include <sys/un.h> #include <math.h> #include <unistd.h> #define BUFSIZE 512 |
END OF NOTE
1 2 3 4 |
wget http://download.telldus.se/TellStick/Software/telldus-core/telldus-core-2.1.2.tar.gz gunzip telldus-core-2.1.2.tar.gz tar xvf telldus-core-2.1.2.tar cd telldus-core-2.1.2 |
6. Now when you are supposed to run “cmake .” it will fail:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
[root@plex telldus-core-2.1.2]# cmake . -- The C compiler identification is GNU 4.8.3 -- The CXX compiler identification is GNU 4.8.3 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1") -- checking for one of the modules 'libftdi' -- Found Doxygen: /usr/bin/doxygen (found version "1.8.5") CMake Error: File /usr/src/telldus-core-2.1.2/Doxyfile.in does not exist. CMake Error at CMakeLists.txt:64 (CONFIGURE_FILE): configure_file Problem configuring file CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: FTDI_LIBRARY linked by target "telldusd" in directory /usr/src/telldus-core-2.1.2/service -- Configuring incomplete, errors occurred! See also "/usr/src/telldus-core-2.1.2/CMakeFiles/CMakeOutput.log". See also "/usr/src/telldus-core-2.1.2/CMakeFiles/CMakeError.log". |
This is because of two things. It cannot find the Doxyfile.in and the FTDI_LIBRARY is not found, this can be fixed. First download the Doxyfile.in:
1 |
wget http://developer.telldus.com/export/95f93cd6d316a910c5d4d2d518f772e43b7caa20/telldus-core/Doxyfile.in |
Run the following cmake command to point to the library:
1 |
cmake -DFTDI_LIBRARY=/usr/lib64/libftdi1.so |
This is how it looks like:
1 2 3 4 5 |
[root@plex telldus-core-2.1.2]# cmake -DFTDI_LIBRARY=/usr/lib64/libftdi1.so -- checking for one of the modules 'libftdi' -- Configuring done -- Generating done -- Build files have been written to: /usr/src/telldus-core-2.1.2 |
7. Almost done. Time to make it. Run this command:
1 |
make |
All should be good and you can move on to installing it.
8. Install it:
1 |
make install |
9. Fix some symlinks and run ldconfig:
1 2 |
ln -s /usr/local/lib64/libtelldus-core.so.2 /lib64/libtelldus-core.so.2 ldconfig |
10. Done! Start the daemon with this command
1 |
/usr/local/sbin/telldusd |
Note. You have to restart the daemon each time you change the tellstick.conf file. You can use kill or whatever you like to do this.
11. Configure your devices in the file /etc/tellstick.conf . This is what it looks like by default:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@plex telldus-core-2.1.2]# cat /etc/tellstick.conf user = "nobody" group = "plugdev" ignoreControllerConfirmation = "false" device { id = 1 name = "Example device" protocol = "arctech" model = "codeswitch" parameters { house = "A" unit = "1" } } |
12. Once you have set up your devices according to the documentation you can control them using “tdtool”
1 2 3 |
[root@plex telldus-core-2.1.2]# tdtool --list Number of devices: 1 1 Example device OFF |
Other notes
For me as I have an old version of the Tellstick Duo I have to use version 2.1.1 of the software. I get error messages such as:
1 2 |
[root@plex telldus-core-2.1.1]# tdtool --off 1 Turning off device 1, Livingroom - An error occurred while communicating with TellStick |
You can fix this by doing what is documented here:
http://developer.telldus.com/wiki/Dont%20wait%20for%20confirmation