Getting your X10 CM19A Module Working in Linux

December 27th, 2007 by Andrew Wells

A short time ago, I wrote on how to get your X10 CM17A Firecracker module working in Linux. Since then, I have migrated to a new home server, and I am left with no serial ports. That means that I have to get a USB module working. I already have the CM19A here at home, so I went on a task to find a driver to work for this one. I did succeed, so read on to find out how you can get it working yourself.

I will show you how to do this using Ubuntu 7.10 using the Generic desktop kernel. This tutorial can probably be adapted to other Linux/Unix distros. I tried it with the Ubuntu server kernel, but had no success. If you can get it, please post how you did it.

Setting it Up

  1. Plug in your USB CM19a Module. Then fire up a terminal and type:

    dmesg

    The last several lines should look like this:

    [ 4037.694734] usb 1-2.2: new low speed USB device using uhci_hcd and address 6
    [ 4037.834968] usb 1-2.2: configuration #1 chosen from 1 choice
    [ 4038.121493] input: X10 Wireless Technology Inc USB Transceiver as /class/input/input7
    [ 4038.123803] usbcore: registered new interface driver ati_remote
    [ 4038.124444] /build/buildd/linux-source-2.6.22-2.6.22/drivers/input/misc/ati_remote.c: Registered USB driver ATI/X10 RF USB Remote Control v. 2.2.1
    [ 4038.128544] /build/buildd/linux-source-2.6.22-2.6.22/drivers/input/misc/ati_remote.c: Weird data, len=1 ff 00 00 00 00 00 …
    [ 4038.212107] lirc_dev: IR Remote Control driver registered, at major 61
    [ 4038.235359]
    [ 4038.235365] lirc_atiusb: USB remote driver for LIRC $Revision: 1.61 $
    [ 4038.235379] lirc_atiusb: Paul Miller <pmiller9@users.sourceforge.net>
    [ 4038.276958] usbcore: registered new interface driver lirc_atiusb

    The important thing to note is that it is using the “lirc_atiusb” driver. This doesn’t work with this device. We need to find a better one.

  2. Download X10MMS and extract it.
  3. Go back to your terminal, and cd into that extracted directory.
  4. As per the instructions in the software’s readme file, run the following commands:

    sudo make
    sudo make install
    sudo modprobe x10-cm19a

    We’re not done yet. If you were to plug in your device, and run dmesg again, you would notice that it’s still running that pesky lirc_atiusb driver, so let’s blacklist it.

  5. Type in a terminal:

    sudo gedit /etc/modprobe.d/blacklist

  6. Then add to the end of the file:

    # causes the custom cm19a driver to fail
    blacklist lirc_atiusb

  7. Type in a terminal:

    sudo rmmod lirc_atiusb

  8. One last thing…this step allows all users to access the device. Some may say this is a security risk, but I don’t want to be root to use it.Type in the following command to open the udev rules file:

    sudo gedit /etc/udev/rules.d/40-permissions.rules

  9. Add the following to the end of the file:

    KERNEL==”cm19a0″, MODE=”0666″

  10. One last commad to run:

    sudo chmod 0666 /dev/cm19a0

  11. You’re done, yay! Now it’s time to test it out. Remember, this driver only provides an interface to the module. You will have to write your own software / scripts / cron jobs to make it useful.The interface works by sending strings to it. To turn on A1, we send +A1 to it. To turn off C4, we send -C5 to it. In practice, type in the following command to turn on A1:

    echo +A1 > /dev/cm19a0

    Hopefully, your transeiver module will turn on.

Troubleshooting

If your test commands are not working, make sure that the driver is being loaded properly. Disconnect the module, wait a few seconds, and reconnect the device. Then type this in a terminal:

dmesg

The last several lines should look like this:

[ 7110.487961] usb 1-2.2: new low speed USB device using uhci_hcd and address 12
[ 7110.629155] usb 1-2.2: configuration #1 chosen from 1 choice
[ 7110.632117] x10-cm19a: Probing x10-cm19a…
[ 7110.632136] x10-cm19a: Found input endpoint: 81, and output endpoint: 2
[ 7110.637872] x10-cm19a: freeing buffer in callback (0xd78eb0c0/0×178eb0c0)
[ 7111.197615] x10-cm19a: freeing buffer in callback (0xd78eb0c0/0×178eb0c0)
[ 7111.197863] x10-cm19a: X10 CM19A USB RF Transceiver connected.
[ 7111.197870] x10-cm19a: X10 CM19A USB RF Transceiver initialized to listen for remote controls.
[ 7111.205631] x10-cm19a: freeing buffer in callback (0xd78eb0c0/0×178eb0c0)

If they don’t, make sure you followed all the steps. If you didn’t understand one of them, please post a question.

More Information

A couple of tips were taken from Dan at Zenlike.ca -> Another homebrew Linux X10 Dawn simulator

The software driver mentioned in this entry can be found here -> X10MMS

Leave a Reply