If you have a Dovado router you can supposedly plug in a Tellstick from the get go.
But for any other router, some work is required. This is another post mostly for my own reference, but hopefully it’ll be useful for you too.
First of, you should install OpenWRT on your router(it obviously needs to be one with a USB port). That way you can build and install whatever software you want. And since Telldus provides a source package that you can compile, that makes it a lot easier.
Check if your router is compatible with OpenWRT here:
Step 1. Install OpenWRT.
(If you don’t want to setup a build environment and cross compile telldus-core yourself, you can download prebuilt packages here. Then you can skip step 2 and 3.)
Step 2. Setup a buildroot for OpenWRT
This can be done on a Linux, Windows or OS X machine.
(Optional) setup pivot overlay(if your router has a flash that’s not big enough for Python, say less than 16mb):
Step 3. Build the Telldus-Core package.
Extract the attached tgz-file into package/utils/ and compile it
To build the package some preparations are needed:
Run “make menuconfig” and:
– under Global build settings, select “Compile with full language support”
– under Libraries, select “argp-standalone”.
Then build telldus-core:
# make package/utils/telldus-core/compile V=99
For more info: http://wiki.openwrt.org/doc/devel/crosscompile
Step 4. Install Telldus-Core on the router.
SCP the ipk(the one you built above, or one I’ve built which can be found here) to the router and install it.
You should then copy the /etc/telldus.conf from your other machine, or build a new one(see the manual or my other post). Set user and group to root in telldus.conf, or you may have to fiddle with permissions of various files.
Then, since OpenWRT uses hotplug2 instead of udev you need to find out the serialnumber etc by yourself.
root@OpenWrt:~# cat /proc/bus/usb/devices
T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=1781 ProdID=0c30 Rev= 6.00
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 90mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
What we’re after here is the Vendor, ProdID and SerialNumber.
So in this case thats “1781”, “0c30” and “A400ghXX”. (The first should be the same for all Tellsticks, the second is 0c30 for Tellstick, 0c31 for Tellstick Duo, and the last one is unique for each Tellstick)
Now run(note that its hex, so prepend with 0x for pid and vid):
root@OpenWrt:~# tdadmin controller connect –pid=0x0c30 –vid=0x1781 –serial=A400ghXX
root@OpenWrt:~# telldusd –nodaemon
telldusd daemon starting up
Connecting to TellStick (1781/C30) with serial A400ghXX
Login with a another SSH session and try running tdtool and make sure it works to turn things on/off.
Then create a startscript for telldusd in initd:
root@OpenWrt:/etc/init.d# cat > telldusd
Also add this to /etc/rc.local:
tdadmin controller connect –pid=0x0c30 –vid=0x1781 –serial=A400ghXX
Step 5. Install python & remotestick-server.
root@OpenWrt:~# opkg update
root@OpenWrt:~# opkg install python
Get remotestick from https://github.com/pakerfeldt/remotestick-server (or the link in the bottom for this post)
Extract it into /root/
You need to modify it slightly to make it find the telldus-core libraries.
In the loadlibrary section in remotestick-server.py change “ret = util.find_library(libraryname)”
to: ret = “/usr/lib/libtelldus-core.so”
Then create a startscript for it:
root@OpenWrt:/etc/init.d# cat > remotestick
service_start /usr/bin/python /root/remotestick-server/remotestick-server.py -h 192.168.1.1 -u stick -s somepwd
service_stop /usr/bin/python /root/remotestick-server/remotestick-server.py -h 192.168.1.1 -u stick -s somepwd
Now add a port forward in your router from the wan to port 8422 on the internal interface.
Voila, you should now be able to add it in your remotestick lite android app and control your home from there.