Difference between revisions of "Heyu"

From SME Server
Jump to navigationJump to search
Line 142: Line 142:
  
 
===User experience===
 
===User experience===
 +
Users who have implemented this how-to should add their experiences as data points of success for others.
 +
 
* Tested with SME Server 7.3 and X10's CM11a - Works
 
* Tested with SME Server 7.3 and X10's CM11a - Works
 +
** Serial port is via a Lava Link 2 port serial card
  
 
----
 
----
 
[[Category:Howto]]
 
[[Category:Howto]]

Revision as of 18:47, 13 October 2008

Edit-find-replace.png Not reviewed:
This howto or contrib has not been reviewed and might contain code that could harm your installation. For more information on the review process have a look at the Development Review page.


Description

Heyu is a driver and control program for managing Power Line Interface Modules such as those made by X10. This program is only useful if you have such a module connected to your server. Note that while there are alpha level quality drivers for the USB versions (e.g. CM15) the drivers and links below relate to the serial port versions (such as the CM11a).

This How-to describes the installation of heyu only on SME Server. Please refer to Heyu's product and help pages for operation.

Links

Heyu home page

http://heyu.tanj.com

Optional Frontends:

http://heyu.tanj.com/heyu_links.html

Neil Cherry's Home Automation website contains a wealth of information about X10 and newer automation technologies.

http://www.linuxha.com/

Credits

Initiated: Christian - created initial procedure and initiated wiki entry

Obtaining the software

The software is available only in source form from: http://heyu.tanj.com/download/

create and go into a temporary directory to work with the files and download the latest version. For example:

wget http://heyu.tanj.com/download/heyu-2.3.2.tgz

Expand the software:

tar xvzf heyu-2.3.2.tgz

Enter the newly created directory (in this case heyu-2.3.2).

Installation

Heyu needs to be compiled and installed to work thus you will need to temporarily install gcc.

yum install gcc
./Configure
make
make install

You will be asked for the serial port of your PLC module (e.g. my CM11a is on /dev/ttyS5).

When asked, you should choose to put the x10.conf file into /etc/heyu. This will also serve as your "basedir" for state and schedule files used by heyu.

The binary should have the path /usr/local/bin/heyu.

man pages will also be installed.

Now let's clean up. You can remove the temporary directory where you created and compiled the heyu program.

You should also remove gcc:

Warning.png Warning:
Leaving gcc on a production server is considered a security risk, if you do not really need it you should not install it, if you need it you should seriously consider uninstalling gcc when you no longer need it. Removing gcc can be done using the following command:
yum remove gcc


Configuring to start Automatically

Depending on how you plan to use Heyu, you may wish to have it start automatically on reboot. This would be necessary for example if you wish it to run scheduled timers.

Tell heyu to start the heyu engine automatically on a start command by editing /etc/heyu/x10.conf and adding the line:

START_ENGINE AUTO

Let's make sure it starts if and when we reboot.

db configuration set heyu service status enabled 
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S99heyu 

You will also need to create a start up script /etc/init.d/heyu:

#! /bin/sh

# Start script for Heyu (X10) communication process

HEYU_BIN=/usr/local/bin/heyu

# Source function library
. /etc/rc.d/init.d/functions

    RETVAL=0

    prog=heyu

    case "$1" in
        start)
            echo -n $"Starting $prog: "
            daemon $HEYU_BIN start
            touch /var/lock/subsys/heyu
            echo
            exit 0
            ;;
        stop)
            echo -n $"Shutting down $prog: "
            killproc $HEYU_BIN
            rm -f /var/lock/subsys/heyu
            echo
            ;;
        reload)
        echo -n $"Reloading $prog daemon configuration: "
            $HEYU_BIN restart
            RETVAL=$?
            echo
            ;;
        restart)
            $0 stop
            $0 start
            ;;
        status)
            status $prog
            ;;
        *)
            echo $"Usage: $0 {start|stop|reload|restart|status}"
            RETVAL=1
    esac

    exit $RETVAL

Initial Configuration

Don't forget to edit the /etc/heyu/x10.conf file to update things like your longitude and latitude and other useful settings.

Note that any changes made to x10.conf need to be re-read by heyu. The simplest way is to issue the following command from the command line:

heyu restart

Initial Launch

If you created the script to start Heyu automatically then you should Start Heyu via:

/etc/rc.d/rc7.d/S99heyu start

This should be all you need. if you wish to monitor commands going through the X10 interface then in an open terminal window issue the command:

heyu monitor

Documentation

Heyu is very well documented and includes man pages. Start with:

man heyu

Note also the other utilities available in the "SEE ALSO" section of the man page.

Additional Software

There are a number of front end programs which utilize Heyu including those to configure and monitor such as at:

http://heyu.tanj.com/heyu_links.html

And also some that allow things like x10 commands to trigger scripts in your server or integrate with perl scripts. Keep in mind that X10 signals are not secure so any commands you have triggered from an x10 signal may be accessible by others.

http://www.linuxha.com/athome/index.html#Software


User experience

Users who have implemented this how-to should add their experiences as data points of success for others.

  • Tested with SME Server 7.3 and X10's CM11a - Works
    • Serial port is via a Lava Link 2 port serial card