Home Automation Thread (X-10, Insteon, ...)

Questions that don't fit in any category below may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Wed Dec 23, 2009 12:20 am

I'm hoping to make this the main Home Automation thread as I've seen a couple of threads of people requesting support for this.

I have a DS209j, and I'll always run the latest firmware.

I've installed Xubuntu 9.04 in a virtual machine on my mac.

Following this page:
http://www.synology.com/us/support/3rd- ... ration.php

There is a document:
http://download.synology.com/download/d ... 0Guide.pdf

Following the document I've downloaded the latest toolchain from Synology as well as the latest GPL source:
http://www.synology.com/us/gpl/index.php



As far as usb to serial hardware goes, I am using this product from Parallax as it give you proper RS232 levels and is very affordable:
http://www.parallax.com/tabid/768/Produ ... fault.aspx

From that page I followed the link to the external FTDI drivers for linux.

I renamed the ftdi_sio header and c file to <filename>.orig and placed these new files in their location in the synology source. From their I followed the document and made the modules.

<skipping some parts>

Now i've got usbserial.ko and ftdi_sio.ko somewhere on my DS209j

MAKE SURE THE usb/serial IS NOT PLUGGED IN YET

First I did

Code: Select all

insmod usbserial.ko

then

Code: Select all

insmod ftdi.ko


NOW PLUG IN THE DEVICE

run the command 'dmesg' and you should see something like this:

Code: Select all

usb 1-2.1: new full speed USB device using ehci_hcd and address 15
usb 1-2.1: configuration #1 chosen from 1 choice
ftdi_sio 1-2.1:1.0: FTDI USB Serial Device converter detected
drivers/usb/serial/ftdi_sio.c: Detected FT232RL
drivers/usb/serial/ftdi_sio.c: Number of endpoints 2

drivers/usb/serial/ftdi_sio.c: Endpoint 1 MaxPacketSize 16384

drivers/usb/serial/ftdi_sio.c: Endpoint 2 MaxPacketSize 16384

drivers/usb/serial/ftdi_sio.c: Setting MaxPacketSize 16384

usb 1-2.1: FTDI USB Serial Device converter now attached to ttyUSB0



now looking in /dev/ you won't see a ttyUSB0 so you need to run this command:

Code: Select all

DiskStation> mknod /dev/ttyUSB0 c 188 0


All that will get the usb/serial converter working for now. If you reboot it will go away. There are files that need to be edited to make sure these settings are persistent over reboot. Not sure of that yet.

The X-10 device I got working for now is known as the Firecracker CM17a, and the HD11A/CM11A 2-way computer interface
Last edited by pomprocker on Wed Dec 23, 2009 10:16 am, edited 2 times in total.
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Wed Dec 23, 2009 12:29 am

Cross-Compiling Bottlerocket, which uses the Firecracker CM17a:
http://www.linuxha.com/bottlerocket/

Following the 3rd-party app integration guide; configure, make, make install. This puts it in your local machines /usr/local/bin. You then have to upload the program 'br' to your Synology in the same directory.

Set your cross-compiling environment variables to point to the toolchain you installed in /usr/local:

Code: Select all

 
root@xubuntu-vm:/usr/local/bottlerocket-0.04c# export CC=/usr/local/powerpc-linux/bin/powerpc-linux-gcc
root@xubuntu-vm:/usr/local/bottlerocket-0.04c# export LD=/usr/local/powerpc-linux/bin/powerpc-linux-ld
root@xubuntu-vm:/usr/local/bottlerocket-0.04c# export RANLIB=/usr/local/powerpc-linux/bin/powerpc-linux-ranlib
root@xubuntu-vm:/usr/local/bottlerocket-0.04c# export CFLAGS="-I/usr/local/powerpc-linux/include"
root@xubuntu-vm:/usr/local/bottlerocket-0.04c# export LDFLAGS="-L/usr/local/powerpc-linux/lib"


Run the configure that came with the code giving it a few extra parameters as specified in the guide:

Code: Select all

root@xubuntu-vm:/usr/local/bottlerocket-0.04c# ./configure \
> --host=powerpc-unknown-linux \
> --target=powerpc-unknown-linux \
> --build=i686-pc-linux \
> --prefix=/usr/local
creating cache ./config.cache
checking for gcc... /usr/local/powerpc-linux/bin/powerpc-linux-gcc
checking whether the C compiler (/usr/local/powerpc-linux/bin/powerpc-linux-gcc -I/usr/local/powerpc-linux/include -L/usr/local/powerpc-linux/lib) works... yes
checking whether the C compiler (/usr/local/powerpc-linux/bin/powerpc-linux-gcc -I/usr/local/powerpc-linux/include -L/usr/local/powerpc-linux/lib) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking whether /usr/local/powerpc-linux/bin/powerpc-linux-gcc accepts -g... yes
checking how to run the C preprocessor... /usr/local/powerpc-linux/bin/powerpc-linux-gcc -E
checking for a BSD compatible install... /usr/bin/install -c
checking for features.h... yes
checking for errno.h... yes
checking for sys/termios.h... yes
checking for termios.h... yes
guessing x10 port
using /dev/ttyS0 for x10 port
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h


Run make:

Code: Select all

root@xubuntu-vm:/usr/local/bottlerocket-0.04c# make
/usr/local/powerpc-linux/bin/powerpc-linux-gcc -I/usr/local/powerpc-linux/include -I. -Wall  -O2 -DX10_PORTNAME=\"/dev/ttyS0\" -DHAVE_CONFIG_H -c ./br_cmd.c
/usr/local/powerpc-linux/bin/powerpc-linux-gcc -I/usr/local/powerpc-linux/include -I. -Wall  -O2 -DX10_PORTNAME=\"/dev/ttyS0\" -DHAVE_CONFIG_H -c ./br.c
/usr/local/powerpc-linux/bin/powerpc-linux-gcc -I/usr/local/powerpc-linux/include -I. -Wall  -O2 -DX10_PORTNAME=\"/dev/ttyS0\" -DHAVE_CONFIG_H -o br br.o br_cmd.o


Run 'make install' which installs it in /usr/local/bin on your local machine:

Code: Select all

root@xubuntu-vm:/usr/local/bottlerocket-0.04c# make install
/usr/bin/install -c -d -m 755 /usr/local/bin
/usr/bin/install -c -m 555 br /usr/local/bin


Now copy the file /usr/local/bin/br to your synology in the same directory.


Once that is running, you issue commands as such:

Code: Select all

DiskStation> cd /usr/local/bin/
DiskStation> ./br
BottleRocket version 0.04c

Usage: ./br [<options>][<housecode>(<list>) <native command> ...]

  Options:
  -v, --verbose         add v's to increase verbosity
  -x, --port=PORT      set port to use
  -c, --house=[A-P]      use alternate house code (default "A")
  -n, --on=LIST         turn on devices in LIST
  -f, --off=LIST      turn off devices in LIST
  -N, --ON         turn on all devices in housecode
  -F, --OFF         turn off all devices in housecode
  -d, --dim=LEVEL[,LIST]   dim devices in housecode to  relative LEVEL
  -B, --lamps_on      turn all lamps in housecode on
  -D, --lamps_off      turn all lamps in housecode off
  -r, --repeat=NUM      repeat commands NUM times (0 = ~ forever)
  -h, --help         this help

<list>      is a comma separated list of devices (no spaces),
      each ranging from 1 to 16
<dimlevel>   is an integer from -12 to 12 (0 means no change)
<housecode>   is a letter between A and P
<native cmd>   is one of ON, OFF, DIM, BRIGHT, ALL_ON, ALL_OFF,
      LAMPS_ON or LAMPS_OFF

For native commands, <list> should only be specified for ON or OFF.

DiskStation> ./br -x /dev/ttyUSB0 -v M3 OFF
./br:  Turning off appliance M3
DiskStation> ./br -x /dev/ttyUSB0 -v M3 ON
./br:  Turning on appliance M3
DiskStation> ./br -x /dev/ttyUSB0 -v M3 OFF
./br:  Turning off appliance M3
DiskStation> ./br -x /dev/ttyUSB0 -v C1 ON
./br:  Turning on appliance C1
DiskStation> ./br -x /dev/ttyUSB0 -v C1 OFF
./br:  Turning off appliance C1
DiskStation> ./br -x /dev/ttyUSB0 -v C1 ON
./br:  Turning on appliance C1
DiskStation> ./br -x /dev/ttyUSB0 -v C3 ON
./br:  Turning on appliance C3
DiskStation> ./br -x /dev/ttyUSB0 -v C3 OFF
./br:  Turning off appliance C3
DiskStation> ./br -x /dev/ttyUSB0 -v C3 ON
./br:  Turning on appliance C3
DiskStation> ./br -x /dev/ttyUSB0 -v C1 OFF
./br:  Turning off appliance C1
DiskStation> ./br -x /dev/ttyUSB0 -v C3 OFF
./br:  Turning off appliance C3
DiskStation> ./br -x /dev/ttyUSB0 -v C LAMPS_ON
DiskStation> ./br -x /dev/ttyUSB0 -v C LAMPS_OFF
DiskStation> ./br -x /dev/ttyUSB0 -v C1 ON     
./br:  Turning on appliance C1
DiskStation> ./br -x /dev/ttyUSB0 -v -d25 C1   
./br:  For dimming either specify just a dim level or a comma
separated list containing the dim level and the devices to dim.
./br:  Valid dimlevels are numbers between -12 and 12.
DiskStation> ./br -x /dev/ttyUSB0 -v -d6 C1
BottleRocket version 0.04c

Usage: ./br [<options>][<housecode>(<list>) <native command> ...]

  Options:
  -v, --verbose         add v's to increase verbosity
  -x, --port=PORT      set port to use
  -c, --house=[A-P]      use alternate house code (default "A")
  -n, --on=LIST         turn on devices in LIST
  -f, --off=LIST      turn off devices in LIST
  -N, --ON         turn on all devices in housecode
  -F, --OFF         turn off all devices in housecode
  -d, --dim=LEVEL[,LIST]   dim devices in housecode to  relative LEVEL
  -B, --lamps_on      turn all lamps in housecode on
  -D, --lamps_off      turn all lamps in housecode off
  -r, --repeat=NUM      repeat commands NUM times (0 = ~ forever)
  -h, --help         this help

<list>      is a comma separated list of devices (no spaces),
      each ranging from 1 to 16
<dimlevel>   is an integer from -12 to 12 (0 means no change)
<housecode>   is a letter between A and P
<native cmd>   is one of ON, OFF, DIM, BRIGHT, ALL_ON, ALL_OFF,
      LAMPS_ON or LAMPS_OFF

For native commands, <list> should only be specified for ON or OFF.

DiskStation> ./br -x /dev/ttyUSB0 -v -cC -d6,1
./br:  Brightening lamp C1 by 6.
DiskStation> ./br -x /dev/ttyUSB0 -v -cC -d-6,1
./br:  Dimming lamp C1 by 6.
DiskStation> ./br -x /dev/ttyUSB0 -v -cC -d6,3
./br:  Brightening lamp C3 by 6.
DiskStation> ./br -x /dev/ttyUSB0 -v -cC -d-3,3
./br:  Dimming lamp C3 by 3.
DiskStation> ./br -x /dev/ttyUSB0 -v -cC -d-3,3
./br:  Dimming lamp C3 by 3.
DiskStation> ./br -x /dev/ttyUSB0 -v -cC -d-3,2
./br:  Dimming lamp C2 by 3.
DiskStation> ./br -x /dev/ttyUSB0 -v -cC -d3,2
./br:  Brightening lamp C2 by 3.
DiskStation> ./br -x /dev/ttyUSB0 -v C LAMPS_OFF

DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Wed Dec 23, 2009 1:37 am

Cross-Compiling HEYU:
http://www.heyu.org/


Code: Select all

root@xubuntu-vm:/usr/local# cd heyu-2.8.0/

root@xubuntu-vm:/usr/local/heyu-2.8.0$ export CC=/usr/local/powerpc-linux/bin/powerpc-linux-gcc
root@xubuntu-vm:/usr/local/heyu-2.8.0$ export LD=/usr/local/powerpc-linux/bin/powerpc-linux-ld
root@xubuntu-vm:/usr/local/heyu-2.8.0$ export RANLIB=/usr/local/powerpc-linux/bin/powerpc-linux-ranlib
root@xubuntu-vm:/usr/local/heyu-2.8.0$ export CFLAGS="-I/usr/local/powerpc-linux/include"
root@xubuntu-vm:/usr/local/heyu-2.8.0$ export LDFLAGS="-L/usr/local/powerpc-linux/lib"

root@xubuntu-vm:/usr/local/heyu-2.8.0# ./Configure

This script will create a Makefile based by default on
the output of uname(1), or otherwise on the system type
parameter you enter.
 
The Makefile has been created for linux.

Note: If you are upgrading from an earlier version,
run 'heyu stop' before proceeding further.

** Now run 'make' as a normal user **

root@xubuntu-vm:/usr/local/heyu-2.8.0# make
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o date.o date.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o erase.o erase.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o info.o info.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o message.o message.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o relay.o relay.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o monitor.o monitor.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o reset.o reset.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o setclock.o setclock.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o stop.o stop.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o tty.o tty.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o x10.o x10.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o xread.o xread.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o xwrite.o xwrite.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o status.o status.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o cm11a.o cm11a.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o eeprom.o eeprom.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o process.o process.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o sun.o sun.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o cmd.o cmd.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o config.o config.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o x10state.o x10state.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o poll.o poll.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o modules.o modules.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o cm17a.o cm17a.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o xsync.o xsync.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o timing.o timing.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o cm10a.o cm10a.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o tty_aux.o tty_aux.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o relay_aux.o relay_aux.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o x10aux.o x10aux.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o rfxcom.o rfxcom.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o digimax.o digimax.c
gcc -g -O -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ -DHASCM17A -DHASEXT0 -DHASRFXS -DHASRFXM -DHASDMX -DHASORE -DHASKAKU -Wall   -c -o oregon.o oregon.c
gcc -L/usr/local/powerpc-linux/lib -o heyu date.o erase.o info.o message.o relay.o monitor.o reset.o setclock.o stop.o tty.o x10.o xread.o xwrite.o status.o cm11a.o eeprom.o process.o sun.o cmd.o config.o x10state.o poll.o modules.o cm17a.o xsync.o timing.o cm10a.o tty_aux.o relay_aux.o x10aux.o rfxcom.o digimax.o oregon.o -lm -lc
/usr/bin/ld: skipping incompatible /usr/local/powerpc-linux/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/local/powerpc-linux/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/local/powerpc-linux/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/local/powerpc-linux/lib/libc.a when searching for -lc
/usr/bin/ld: skipping incompatible /usr/local/powerpc-linux/lib/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/local/powerpc-linux/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/local/powerpc-linux/lib/libc.a when searching for -lc
/usr/bin/ld: skipping incompatible /usr/local/powerpc-linux/lib/libgcc_s.so when searching for -lgcc_s

** Now become root and run 'make install' **

root@xubuntu-vm:/usr/local/heyu-2.8.0# make install
mkdir -p -m 755 /usr/local/bin
cp heyu /usr/local/bin
chgrp root  /usr/local/bin/heyu
chmod 755 /usr/local/bin/heyu
chown root /usr/local/bin/heyu
./install.sh

I did not find a Heyu configuration file.
Where would you like the sample Heyu configuration file installed?
  1. In directory /home/bdaniels/.heyu/
  2. In subdirectory .heyu/ under a different user home directory
  3. In directory /etc/heyu  (for system-wide access)
  4. No thanks, I'll take care of it myself
Choice [1, 2, 3, 4] ? 1
Creating directory /home/bdaniels/.heyu
The sample configuration file will be installed as /home/bdaniels/.heyu/x10config

I will add the TTY port for your CM11 to the config file
Specify /dev/ttyS0, /dev/ttyS1, etc., or the word dummy
To which port is the CM11 attached? /dev/ttyUSB0
I could not find the device you specified. Please try again.
Specify /dev/ttyS0, /dev/ttyS1, etc., or the word dummy
To which port is the CM11 attached? /dev/ttyS0     
Setting uid:gid = 0:0 for /home/bdaniels/.heyu/x10config
Changing TTY permissions to 777
The directory /var/tmp/heyu was created with the permissions 777.
The permissions for the SPOOL directory (/var/tmp/heyu) are OK
The permissions for the LOCK directory (/var/lock) are OK
mkdir -p -m 755 /usr/local/man/man1
cp heyu.1 /usr/local/man/man1
chmod 644 /usr/local/man/man1/heyu.1
mkdir -p -m 755 /usr/local/man/man5
cp x10config.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10config.5
mkdir -p -m 755 /usr/local/man/man5
cp x10sched.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10sched.5
mkdir -p -m 755 /usr/local/man/man5
cp x10scripts.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10scripts.5
mkdir -p -m 755 /usr/local/man/man5
cp x10cm17a.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10cm17a.5
mkdir -p -m 755 /usr/local/man/man5
cp x10aux.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10aux.5
mkdir -p -m 755 /usr/local/man/man5
cp x10rfxsensors.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10rfxsensors.5
mkdir -p -m 755 /usr/local/man/man5
cp x10rfxmeters.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10rfxmeters.5
mkdir -p -m 755 /usr/local/man/man5
cp x10digimax.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10digimax.5
mkdir -p -m 755 /usr/local/man/man5
cp x10oregon.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10oregon.5
mkdir -p -m 755 /usr/local/man/man5
cp x10kaku.5 /usr/local/man/man5
chmod 644 /usr/local/man/man5/x10kaku.5
cat install.sh >install
chmod a+x install


Will probably have to change the device in the config file to /dev/ttyUSB0 after you move it to the Syno.


EDIT: I couldn't get this working, but the ipkg of HEYU works great :wink:
Last edited by pomprocker on Wed Dec 23, 2009 10:18 am, edited 1 time in total.
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Wed Dec 23, 2009 3:59 am

I have an old HD11a which is just a re-branded CM11a, and I verified that it does work through the usb/serial converter I have.

Using ipkg I was able to install HEYU. They also have one called Ppower or Penguin Power, which I assume would also work:


Code: Select all

DiskStation> ipkg list | grep "home automation"
heyu - 2.8.0-1 - X10 home automation control using the CM11A
ppower - 0.1.5-1 - Ppower, short for 'Penguin Power', is a piece of software for controlling x10 home automation equipment connected to the comput



To Do:
I have misterhouse installed, I just need to get it to talk to /dev/ttyUSB0
I own a Powerlinc V2 2414u USB PLC that I need to try and get to work.

EDIT: I sold my 2414U. If I ever get another Powerlinc I would consider the serial 2412S
Last edited by pomprocker on Thu Feb 18, 2010 11:20 pm, edited 1 time in total.
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Wed Dec 23, 2009 10:22 am

domus.Link PHP frontend for HEYU

I wasn't too excited about cgi/perl scripts, but I found what I think is one of the only PHP front ends which runs perfectly on the Syno after slight tweaking of the php.ini file.

domus.Link
http://domus.link.co.pt/

I was even able to create a 3rd-Party applications node for it to run embedded in the web manager.


Code: Select all

DiskStation> pwd
/usr/syno/synoman/webman/3rdparty
DiskStation> ls -laR domusLink/
domusLink/:
drwxr-xr-x    2 root     root         4096 Dec 23 00:53 .
drwxr-xr-x    3 root     root         4096 Dec 23 00:33 ..
-rw-r--r--    1 root     root          198 Dec 23 01:01 application.cfg
lrwxrwxrwx    1 root     root           44 Dec 23 00:53 images -> /volume1/web/domus.Link/theme/default/images

DiskStation> cat application.cfg
text_enu = domus.Link
description_enu = domus.Link - Home Automation Interface
type = embedded
protocol = https
port = 443
path = /domus.Link
icon_16 = images/menu_home_on.png
icon_32 = images/menu_home_on.png

DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Thu Dec 24, 2009 9:33 pm

Misterhouse:
http://misterhouse.sourceforge.net/

I've confirmed that misterhouse does work with /dev/ttyUSB0.

I recommend unzipping Misterhouse in /usr/local

Code: Select all

DiskStation> cd /usr/local
DiskStation> gunzip < /volume1/Downloads/misterhouse-2.105.tar.gz | tar xvf -



Make sure you run the configure which uses h2ph. h2ph is just a perl script, but you have to make sure you download the your systems GPL source from Synology and change one line in the Misterhouse configure script:

Code: Select all

#cd /usr/include
cd /usr/local/powerpc-linux/include


When you run the script it will remove all Windows files and will use the C header files to produce Perl header files ending in .ph

Follow this:
http://misterhouse.sourceforge.net/inst ... structions

and this:
http://misterhouse.sourceforge.net/inst ... structions

In /usr/local/mh/bin create a file called mh.private.ini and add these basic entries:

Code: Select all

sound_program=
latitude=12.345678
longitude=-123.456789
time_zone=-8
city=YourCity
zone=SomeMajorCityNearYou
state=YourStateAbbreviation
zip_code= 12345
dbi_user=mhuser
dbi_password=temp1234
voice_text=
cm11_port=/dev/ttyUSB0
tk=0


Now when you start Misterhouse do something like this to run it in the background and have its output go to some logfile:

Code: Select all

DiskStation> cd /usr/local/mh/bin
DiskStation> ./mhl & > /var/log/mh.out


Now you should be able to go to http://192.168.x.x:8080 and access Misterhouse.

Please read the docs from here...


I've heard people being successful in adding USB Audio adapters to their Synology. I will try this later and add voice support.
Last edited by pomprocker on Mon Mar 29, 2010 2:00 am, edited 1 time in total.
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Tue Dec 29, 2009 9:41 pm

Text-To-Speech

big achievement today...

I was able to successfully cross compile a text-to-speech engine called Flite which is very lightweight to run on my DS209j. This means you can use HEYU or Misterhouse to output speech upon an event.


http://www.speech.cs.cmu.edu/flite/

Here is my config file generated from running configure:

Code: Select all

root@xubuntu-vm:/usr/local/flite-1.3-release# cat config/config
# -*- makefile -*-
#
# This file is automatically generated by configure.
# Do not hand edit.

TARGET_OS    = linux-gnu
TARGET_CPU   = powerpc
HOST_OS    = linux-gnu
HOST_CPU   = powerpc

CC       = /usr/local/powerpc-linux/bin/powerpc-linux-gcc
CFLAGS   = -I/usr/local/powerpc-linux/include -Wall
CPPFLAGS =
DEFS     = -DWORDS_BIGENDIAN=1
#DEFS     = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DWORDS_BIGENDIAN=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1   # we don't use these anywhere
SHFLAGS  =

AR       = /usr/local/powerpc-linux/bin/powerpc-linux-ar
RANLIB   = /usr/local/powerpc-linux/bin/powerpc-linux-ranlib
INSTALL  = /usr/bin/install -c

M68KCC   =

AUDIODRIVER = oss
AUDIODEFS   = -DCST_AUDIO_LINUX
AUDIOLIBS   =

LEXDEFS =
VOXDEFS =

OTHERLIBS =

MMAPTYPE    = posix
STDIOTYPE   = stdio

FL_LANG  = usenglish
FL_VOX   = cmu_us_kal16
FL_LEX   = cmulex

prefix        = /usr/local
exec_prefix   = ${prefix}
EXEEXT         =
INSTALLBINDIR = ${exec_prefix}/bin
INSTALLLIBDIR = ${exec_prefix}/lib
INSTALLINCDIR = ${prefix}/include/flite
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
lau_cph
Trainee
Trainee
Posts: 14
Joined: Thu Nov 22, 2007 12:53 am

Re: Home Automation Thread (X-10, Insteon, ...)

Postby lau_cph » Sun Jan 24, 2010 3:49 pm

Hi all tweakers and modders...
The past 3 years I've been following the development in this direction... Finally I see something happening.
I would like to express my appreciation for the work you guys do here. I'm not a programmer my self, but I am capable of following guides.
Would it be possible to make complete selfinstallable packages like the mailserver, with this work?
I think Mister house is the best application out there to manage the automation on a synology server, but what does your experience tell you?

Thomas
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Sun Jan 24, 2010 6:30 pm

I would have to learn to create easy to install packages...

I've tried misterhouse, and it seems like mostly bloatware...although mh has an insteon daemon which I would be interested in. I would have to get a different powerlinc controller though because I have the newer usb plc which i'm not using at the time but mh only supports the older serial PLM ones.

Right now, I am using a CM11a and CM17a for communications with Heyu I got from the optware ipkg feed. I cross compiled two drivers/lkm's to make it work on my machine. I using the Heyu PHP frontend called domus.Link, which needs some more development also.

For text to speech, I'm using a $2.80 usb audio adapter from JMTek, and I cross compiled CMU Flite.

For voice control, I am working on getting the bugs out of the cvoicecontrol source and making it work with my Syno.

Definitely setup ipkg, there are some good packages on there like heyu, and mpg123.
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
redhouse
I'm New!
I'm New!
Posts: 3
Joined: Thu Feb 18, 2010 11:19 am

Re: Home Automation Thread (X-10, Insteon, ...)

Postby redhouse » Thu Feb 18, 2010 11:33 am

Hi Pomprocker,

excellent post. I have been running Heyu and BlueLava for many years on a Cobalt Qube2 with a serial attached CM11A. Two months ago I purchased a DS209 and have just been looking for the exact same functionality in your post: heyu + domus.Link + iPhone. One of the things which struck me in the beginning was that the clock in the CM11A is very inaccurate. I solved this by letting the Qube do an NTP update regularly and once a day, through a cron.daily job, do a heyusetclock to the CM11A. Anyway, i'm following your activities with interest and are now looking to find me a USB/Serial converter which works with the DS209. Keep up the good work.

Regards,

Redhouse
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Thu Feb 18, 2010 11:04 pm

I can vouch for any converter using the FTDI chipset. If it has anything else like Prolific, Keyspan then no guarantees.
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Thu Feb 18, 2010 11:07 pm

Here is a video I made for the Syno contest:

http://www.youtube.com/watch?v=gvlYtoKd7Ns


I was able to successfully cross-compile and run Julius Voice Recognition Engine on my Synology DS209.
http://julius.sourceforge.jp/en_index.php
http://voxforge.org/home/downloads#QuickStart%20Anchor

I am working on trying to compile Festival w/ MBROLA engine in place of Flite for better TTS voices. I am also looking at Cepstral and AT&T Natural Voices.
http://www.cstr.ed.ac.uk/projects/festival/
http://tcts.fpms.ac.be/synthesis/mbrola.html
http://cepstral.com/
http://www.voiceforge.com/demo/
http://www2.research.att.com/~ttsweb/tts/demo.php


Another good program to look at would be DomotiGa + Gambas for linux HA.
http://www.domotiga.nl/
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Mon Mar 29, 2010 12:31 am

FYI, I've upgraded from a DS209j which uses the PPC architecture to a DS209 which uses the ARM architecture. So for any cross-compiling I post from here on out is based on the DS209.
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics
User avatar
rodef
Seasoned
Seasoned
Posts: 598
Joined: Mon Jan 14, 2008 9:19 pm

Re: Home Automation Thread (X-10, Insteon, ...)

Postby rodef » Mon Mar 29, 2010 7:21 am

pomprocker wrote:Here is a video I made for the Syno contest:

http://www.youtube.com/watch?v=gvlYtoKd7Ns

I can't view the video - it says it's 'private'. :(
Model: DS508; F/W: DSM 4.0-2228; HDD: 5 x Seagate 1TB ST31000340NS (JBOD; Basic); Link Aggregation: Enabled (Gigabit)
Model: DS212; F/W: DSM 4.1-2636; HDD: 1 x Seagate 3TB ST3000DM001; 1 x Hitachi 3TB S723030ALA640 (RAID 0)
Camera: IQinVision IQeye 702; Other: Squeezebox Boom and Classic (SSODS 4.9.1 / SBS 7.5.2-31632)
User avatar
pomprocker
Knowledgeable
Knowledgeable
Posts: 389
Joined: Tue Jun 02, 2009 5:28 pm
Location: Mission Viejo, CA

Re: Home Automation Thread (X-10, Insteon, ...)

Postby pomprocker » Tue Mar 30, 2010 7:02 pm

rodef wrote:
pomprocker wrote:Here is a video I made for the Syno contest:

http://www.youtube.com/watch?v=gvlYtoKd7Ns

I can't view the video - it says it's 'private'. :(



Sorry...fixed it...try again..
DS209
DSM4.2

http://pomprocker.blogspot.com
Nerd Stuff - Programming, Electronics, Mechanics

Return to “General Mods”

Who is online

Users browsing this forum: No registered users and 3 guests