qnap & homeautomation FHEM & Enocean & cdc_acm

Printers, HDDs, USB/eSATA drives, 3rd-party programs
immiimmiimmiimmi
Starting out
Posts: 26
Joined: Sun Mar 20, 2011 12:58 am

qnap & homeautomation FHEM & Enocean & cdc_acm

Post by immiimmiimmiimmi » Sun Jul 08, 2012 1:03 pm

Dear all,
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

    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
    the Atmel is the important one
  • 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

    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
    the /etc/init.d/Optware.sh will do the rest calling all S?? and K?? in /opt/etc/init.d/
please feel free to update the howto: I forgot for sure some important info
have fun
immi

jas39
New here
Posts: 4
Joined: Mon Jan 25, 2010 3:43 am

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by jas39 » Tue Aug 21, 2012 7:50 am

I've tried and got a generall cdc device working with the attached cdc_acm.ko driver for the 2.6.33 Kernel

Move cdc-acm.ko to /usr/local/modules/cdc-acm.ko

Add to autostart.sh
======================
mount -t ext2 /dev/mtdblock5 /tmp/config
echo "/sbin/insmod /usr/local/modules/usbserial.ko" >> /tmp/config/autorun.sh
echo "/sbin/insmod /usr/local/modules/cdc-acm.ko" >> /tmp/config/autorun.sh
echo "mknod /dev/ttyACM0 c 166 0" >> /tmp/config/autorun.sh
/bin/umount /tmp/config


and it should work...

The device I used was based on Microchip's usb stack
You do not have the required permissions to view the files attached to this post.

Rendfield
Starting out
Posts: 14
Joined: Sun May 13, 2012 7:47 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by Rendfield » Wed May 22, 2013 3:48 am

Hi all,

I'am very interested in homeautomation with FHEM.
At the moment I've got FHEM succesfully running on my Fritzbox 7390 wit an enOcean CUL but I
would like to switch to a more powerfull environment (TS-469) with more RAM.

Does anybody got FHEM runnig on a QNAP Atom environment ?
Will it be possible to adapt your proccess from ARM to Atom ?

Regards,
Ulrich

immiimmiimmiimmi
Starting out
Posts: 26
Joined: Sun Mar 20, 2011 12:58 am

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by immiimmiimmiimmi » Sat May 24, 2014 12:23 am

If you upgrade to 4.1 arm with kernel 3.4.6 , you need to recompile the module for arm
please find it enclosed, tested on qnap119 with enocean tranceiver
immi
You do not have the required permissions to view the files attached to this post.

besitzer
New here
Posts: 2
Joined: Thu Aug 14, 2014 2:07 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by besitzer » Thu Aug 14, 2014 2:11 pm

Hello Ulrich,

I have the same QNAP model. Did you manage to install FHEM on it?
Can you tell me what you did?

Thanks.

Sven

besitzer
New here
Posts: 2
Joined: Thu Aug 14, 2014 2:07 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by besitzer » Thu Aug 14, 2014 2:11 pm

Hello Ulrich,

I have the same QNAP model. Did you manage to install FHEM on it?
Can you tell me what you did?

Thanks.

Sven

tchelovek
Starting out
Posts: 14
Joined: Wed Aug 13, 2014 1:33 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by tchelovek » Fri Aug 15, 2014 11:02 pm

immiimmiimmiimmi wrote:If you upgrade to 4.1 arm with kernel 3.4.6 , you need to recompile the module for arm
Hello immi, I acquired a TS 469 Pro presently, the thing is running ATOM x86_64. I think I could manage to compile the cdc-acm.ko for that platform, if I only knew where to find the proper sources.

I checked ftp://ftp.qnap.com/gpl/ (user:gpl, pass:download), they offer

Code: Select all

         File:GPL_TS-20110526-3.4.x.tar.gz    482541 KB 	26.05.2011 	00:00:00
         File:QNAP_GPL_3.3.x_20101126.tar.gz	443296 KB 	26.11.2010 	00:00:00
         Fi le:QNAP_GPL_3.4.x_20110218.tar.gz	469821 KB 	21.02.2011 	00:00:00
         File:QNAP_GPL_3.5.x_20110928.tar.gz	484479 KB 	29.09.2011 	00:00:00
         File:QNAP_GPL_3.6.x_20120220.tar.gz 	508127 KB 	21.02.2012 	00:00:00
Which one did you use ?

Tchelovek

User avatar
schumaku
Guru
Posts: 43598
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by schumaku » Fri Aug 15, 2014 11:22 pm

Historic versions, newer ones are here -> http://sourceforge.net/projects/qosgpl/

tchelovek
Starting out
Posts: 14
Joined: Wed Aug 13, 2014 1:33 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by tchelovek » Sat Aug 16, 2014 7:27 pm

Thanks, schumaku, that is what I was looking for !
Tchelovek

tchelovek
Starting out
Posts: 14
Joined: Wed Aug 13, 2014 1:33 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by tchelovek » Tue Aug 19, 2014 1:56 am

So, jetzt ist es mir gelungen einen cdc-acm.ko zu kompilieren.

Quelle:
  • GPL_TS-20140513-4.1.0.tar.gz
    linux-3.4.6-x86_64.cfg
mit insmod wird er ohne Kommentar geladen, ausprobieren kann ich ihn leider noch nicht, da mir kein CUL zur Verfügung steht. Ich hänge ihn mal hier an, vielleich hat ja jemand Lust und Zeit das zu übernehmen ?

Tchelovek

tchelovek
Starting out
Posts: 14
Joined: Wed Aug 13, 2014 1:33 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by tchelovek » Tue Aug 19, 2014 2:00 am

Irgendwie muß ich Datei anhängen noch üben :-(

Tchelovek
You do not have the required permissions to view the files attached to this post.

immiimmiimmiimmi
Starting out
Posts: 26
Joined: Sun Mar 20, 2011 12:58 am

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by immiimmiimmiimmi » Thu Sep 04, 2014 4:01 am

sven, Tchelovek , Ulrich
Fhem is working well with my qnap from 2 years.
I am not looking very often here, if you need help, post in fhem forum.
Qnap has not really interested in home automation, and despite I think fhem is the best, nobody is really using it outside germany :(
immi

tchelovek
Starting out
Posts: 14
Joined: Wed Aug 13, 2014 1:33 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by tchelovek » Wed Sep 10, 2014 9:31 pm

tchelovek wrote:ausprobieren kann ich ihn leider noch nicht, da mir kein CUL zur Verfügung steht.
So gerade habe ich einen CUL angesteckt und mit einem HomeMatic Switch gepaart. Siehe http://forum.qnap.com/viewtopic.php?f=24&t=40442

mmicha22
First post
Posts: 1
Joined: Tue Apr 22, 2014 5:41 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by mmicha22 » Wed Sep 24, 2014 2:44 pm

danke für die Version für den Kernel in 4.1.0, sonst würde mein FHEM jetzt stehen und meine Frau....... :lol:

sakuraba
New here
Posts: 3
Joined: Tue Nov 10, 2015 9:35 pm

Re: qnap & homeautomation FHEM & Enocean & cdc_acm

Post by sakuraba » Thu Nov 12, 2015 11:43 pm

Is it possible to have the module cdc-acm for TS253pro X86_64 ?

Thx

Post Reply

Return to “Hardware & Software Compatibility”