Preamble: Web-based control of X10 Home Automation (CM15A) on Ubuntu Linux

When I moved into my new place back in October last year, I couldn’t figure out how to turn the lights off and on in the house as many of the switches in the house either didn’t work or turned on the wrong lights.

I found out later that my landlord had an X10 Home Automation setup in the house. This allows him to turn the lights on and off from a remote control. He also mentioned that he read of a way to automate the lights and access it via a website using the CM15A module that he had connected to a computer. I just happened to have a Windows-based Apache server with MySQL and PHP, and after a little research and implementation, I managed to serve a website that could control the lights in my house with a web browser.

Over time I was getting more and more disappointed with the speed of my server. I had Windows Media Center running on it and a number of other programs for media streaming and file serving. As servers go, this isn’t the best of setups, and because the hardware on the system wasn’t to the fastest either, it made accessing the computer unbearable. So I did some research and decided to migrate the system over to the Server Edition of Ubuntu.

Now that Ubuntu is installed, my system has never been faster at serving files and streaming media. The only problem is that the lights in my house aren’t accessible and I couldn’t control them from the web-interface I had implemented on the Windows setup. The drivers for the home automation in Windows aren’t compatible with Linux. So I decided to do some more research and install ones made for Linux. Unfortunately my search came up short, with a lot of discussion around people trying to build drivers for Linux to access the CM15A module, but no hard evidence of a stable driver built by the X10 company.

So that’s where this article comes in: I have composed a step-by-step guide to getting the X10 CM15A USB module to work under Ubuntu, and which further allows the iPhone Home Controller web-based interface to connect the module.

I will give fair warning, the setup I have only addresses how to turn off/on/dim the switch modules. The current driver-attempts for Linux do not access video cam modules, door lock modules or other home automation modules outside of the scope of the simple switch modules (that I know of).

Click here for my article that outlines the steps involved to getting this to work.

  • Adam

    Thank you for writing the guide for the CM15A! I can now send signals from the computer to the CM15A, but I was wondering if you ever figured out how to receive signals from it? I have a wireless remote that works with the CM15A, and I’d like the CM15A to forward those commands on to my computer. Can I use the demo code for that or would I actually need to know something about programming to make that happen?

    Thanks again!

    • Hey Adam,
      Well first off, you’re definitely going to need to know something about programming to make that happen.
      The USB drivers provided were custom-made by someone who knows quite a bit more about a Posix environment that uses the universal serial bus (USB) architecture, the CMA15A and it’s hardware frequency codes and USB translations, as well as all the programming to handle the output of the signals from the computer to the CM15A. I know for a fact that there is some way that either the CM15A can poll the devices to see which ones are on/off/dimmed, or that in itself it has a memory of what device codes states were sent out to the modules.

      As for that feature, it was not developed in the USB library and controller libraries used within my setup.

  • paucon

    Tremendous guide on the CM15a USB module, thank you. Do you still have a copy of the ipchar.bz2 file or time to explain the changes made to the WAMP/XXAMP iPhone Home Controller for operation on LAMP? The site link is not finding the file. Many thanks

    http://www.somethinginteractive.com/wordpress/wp-content/uploads/2009/05/iphctar.bz2

    • This link has been updated! I have been reorganizing my website while I continue to work on my new portfolio layout!

  • paucon

    Thanks again Mike, I was able to access the tarball and see where I’d gone wrong in my own modifications to the iPHC scripts. Everything appears to be working fine now and I look forward catching up with your blog from time to time. Cheers

  • Andrew

    NB: under Ubuntu 10.04 there is no need to compile the usb libraries. What you do need to do is download and install the package

    sudo apt-get install lib-usb-1.0-0-dev

    which provides all of the necessary headers. Then the demo program will compile directly.

  • Jose

    Mike,

    Very good guide.

    The iPhone Home Controller link does not work, how I can get a
    copy the file to try?

    JAS

    • admin

      I’ve updated the link now. Sorry I upgraded my wordpress installation to multisite and lost the linkage.
      Should be all good now!