How to install the CM15A X10 controller on Ubuntu 8.04 LTS

This entry was posted by on Wednesday, 5 October, 2011

To access the CM15A X10 controller under Linux (Fedora or Ubuntu) I use the mochad, Multiple Online Controllers for Home Automation Daemon.
“mochad” is a Linux TCP gateway daemon for the X10 CM15A RF (radio frequency) and PL (power line) controller and the CM19A RF controller.

To get it up and running under Ubuntu 8.04 LTS “Hardy” follow these steps.

1 ) Download libusb-1.0 (because Hardy does not ship with it):
Goto libusb-1.0 website, scroll to the Download section and get the latest version if the source files.
If the latest version does not work, you might download this version that works fine under hardy.

2 ) Unpack, untar, compile and install libusb-1.0:
bzip2 -d libusb-1.0.8.tar.bz2
tar -xvf libusb-1.0.8.tar
cd libusb-1.0.8
./configure
make
sudo make install

Replace the libuse-1.0.8 part with whatever version you downloaded.

3 ) Download mochad:
Visit the mochad homepage and download the latest version or get this version that works on Hardy.

4 ) Untar, compile and install mochad:
tar -zxvf mochad-0.1.12.tar.gz
cd mochad-0.1.12
./configure
make
sudo make install

Replace the mochad-0.1.12 with whatever version you download.

5 ) Plug in the CM15A device via the USB port to the box

6 ) Check that the system can see it:
lsusb
Should return a line like this:
Bus 002 Device 065: ID 0bc7:0001 X10 Wireless Technology, Inc.

The Bus and Device might be different in your case.

7 ) Launch the mochad daemon:
sudo /usr/local/bin/mochad

It should return to the prompt with no errors.

8 ) Use it!
To use the mochad daemon you can talk to it on port 1099 (by default) on the localhost using netcat (nc) like this example:
To turn on module A1
nc -c "echo pl a1 on" localhost 1099
To turn off module A1
nc -c "echo pl a1 off" localhost 1099

And that’s it. Check out the mochad homepage for further details.


ShareThis

4 Responses to “How to install the CM15A X10 controller on Ubuntu 8.04 LTS”

  1. amt779

    Hello
    I’ve tried your manual, but I’ve trouble in setting up control over X10 CM15A module via libusb.
    I use Ubuntu 10.04 with 2.6.32-38-generic kernel.
    I’ve checked that the module is visible for OS
    $ lsusb
    Bus 004 Device 003: ID 0bc7:0001 X10 Wireless Technology, Inc. ActiveHome (ACPI-compliant)

    But when I send simple command (to turn A1 module ON) I receive error message
    $ pl a1 on
    Error: Can’t open input file, a1.

    What files do I need to configure to manage this problem?

  2. Paulo

    Hi amt779,

    If you look at step 7 you will see that you need to have mochad running. On step 8 you send the string “pl a1 on” to nc via the echo command. On your message, you are running the string as a command. 😉

    Regards!

  3. amt779

    Thnx. I’ve tried to do exactly as said in your guide, but didn’t work for me.
    $ nc -c “echo pl a1 on” localhost 1099
    nc: invalid option — ‘c’
    usage: nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port]
    [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol]
    [-x proxy_address[:port]] [hostname] [port[s]]

    the correct command line appeared to be
    $ echo “pl a1 on” | nc localhost 1099

    I guess that this misdirection is cuz of different versions of packets used in your guide & in my os.

  4. Paulo

    Hi!

    Yes, you are correct. The version of nc on 10.04 does not include the -c option.

    I’m glad you got it going. Well done! 😉


Leave a Reply