for those interesested in the open source homeautomation software FHEM.
Please consider that the following information is an integration of http://fhemwiki.de/wiki/ : The other QNAP wiki are outdated (e.g. the kernel modules are not availabe anymore).
I just wrote the steps as I prepared/installed/compiled system; this guide makes no pretension to completeness
---------------------------------------------
Qnap 119 (3.7.1 Build 20120615) + FHEM + enocean gatewat USB-EUL busware /dev/ttyACM0@57600 TCM310
Two problems from my side: I was not used to FHEM, and QNap support for the USB-EUL is terrible.
I solved incrementally. I made some experience on fhem on a standard debian laptop and then I started with Qnap 119+ FHEM + enocean USB-EUL busware /dev/ttyACM0@57600 TCM310
- install ipkg in you qnap
Code: Select all
ipkg install libtool nano gcc make automake ncurses ncursesw wget perl autoconf
- install FHEM in your qnap
- insert the USB-EUL; with lsusb you should see
the Atmel is the important one
Code: Select all
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB Bus 001 Device 003: ID 03eb:204b Atmel Corp. LUFA USB to Serial Adapter Project
- now you need to check the driver of the serial-usb interface to the TCM310: with dmesg you should see
Code: Select all
[ 136.310000] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device [ 136.330000] usbcore: registered new interface driver cdc_acm [ 136.330000] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
- if not, you probably do not have the cdc_acm driver: The Eul from busware relazs on cdc_acm (module/driver). In the standard linux distributions cdc_acm is in the monolithic kernel; qnap in the past supplied cdc_acm as module; now (Linux qnap 2.6.33.2), if you do not have it, you have to compile it yourself (if you have never compiled a kernel stop now!!! it is messy)
Code: Select all
download the kernel from qnap ftp://ftp.qnap.com/gpl/Usename: gpl Password: download 2) chose the config file provided for your specific qnap and your kernel version (and copy that in /GPL_TS/src/linux-2.6.33.2-arm/ as .config) 3) make oldconfig; tell the compiler that cdc-acm has to be compiled as module (comment away cdc-acm =m) 4) make modules (wait wait, wait) and search for ../GPL_TS/src/linux-2.6.33.2-arm/drivers/usb/class/cdc-acm.ko 5) a lot of annoing errors came, which I was not interested in debugging; therefore I decided to compile only the /usb/class/cdc-acm.ko 6) cp ../GPL_TS/src/linux-2.6.33.2-arm/drivers/usb/class/cdc-acm.ko to /lib/modules/others/ 7) insmod ../GPL_TS/src/linux-2.6.33.2-arm/drivers/usb/class/cdc-acm.ko
- now you have to create the /dev node (if you do not have one)
mknod /dev/ttyACM0 c 166 0 - now you can start and test FHEM
- I automated everything at sturtup of the qnap box.
create a /opt/etc/init.d/init_fhem (I recognize my hack is not really elegant)
Code: Select all
#!/bin/sh # by Matthias Bauer and modified by immi case "$1" in start) echo "Starting $0" mknod /dev/ttyACM0 c 166 0 insmod /lib/modules/others/cdc-acm.ko /opt/bin/fhem.pl /opt/etc/fhem.cfg ;; stop) echo "Stopping $0" /opt/bin/fhem.pl 7072 shutdown ;; status) cnt=`ps -ef | grep "fhem.pl" | grep -v grep | wc -l` if [ "$cnt" -eq "0" ] ; then echo "$0 is not running" else echo "$0 is running" fi ;; *) echo "Usage: $0 {start|stop|status}" exit 1 esac exit 0
- create the links for start and stop the /etc/init.d/Optware.sh will do the rest calling all S?? and K?? in /opt/etc/init.d/
Code: Select all
ln -s /opt/etc/init.d/init_fhem /opt/etc/init.d/S30fhem ln -s /opt/etc/init.d/init_fhem /opt/etc/init.d/K10fhem
have fun
immi