Getting your X10 CM19A Module Working in Linux
December 27th, 2007 by Andrew WellsA 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
- 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_atiusbThe 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.
- Download X10MMS and extract it.
- Go back to your terminal, and cd into that extracted directory.
- As per the instructions in the software’s readme file, run the following commands:
sudo make
sudo make install
sudo modprobe x10-cm19aWe’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.
- Type in a terminal:
sudo gedit /etc/modprobe.d/blacklist
- Then add to the end of the file:
# causes the custom cm19a driver to fail
blacklist lirc_atiusb
blacklist ati_remote - Type in a terminal:
sudo rmmod lirc_atiusb
sudo rmmod ait_remote - 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
- Add the following to the end of the file:
KERNEL==”cm19a0″, MODE=”0666″
- One last commad to run:
sudo chmod 0666 /dev/cm19a0
- 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.
Update (9/14/2008)
I just went back and used this post to reconfigure this device on the new kernel. Turns out that for Ubuntu Hardy Heron (8.04), an additional kernel module needs to be blacklisted: ati_remote. That module has been added to the previous steps.
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
September 6th, 2008 at 8:13 pm
when I plug in my cm19a, I don’t see /dev/cm19a0.
instead I see:
usbdev1.8_ep00
usbdev1.8_ep02
usbdev1.8_ep81
(they weren’t there before I plugged in my cm19a module.
if I do “ls /dev/usbdev1.8_ep00″ I get an error “No such device or address”
I’m running ubuntu 7.10, linux 2.6.22-14-generic
September 6th, 2008 at 9:29 pm
after I rebooted my system, I am able to see /dev/cm19a0
and echo +A1 > /dev/cm19a0 works.
November 4th, 2008 at 4:33 pm
Hi,
I just followed this guide with Ubuntu server 8.04. the only problem I had was that the dev was not created.
Then I did “/dev/MAKEDEV” update and /dev/cm19a0 appeared.
soooo.. echo +A1 > /dev/cm19a0 now works.
Regards, JP.
November 4th, 2008 at 4:36 pm
Thanks for the tip, JP. I just upgraded my home server to 8.04 a couple weeks ago, and I still have to reinstall this driver before Christmas lights go up.
November 19th, 2008 at 11:09 am
Hello.
Does anyone have, or is willing to create a custom driver set for the CM19a? This would be a simple driver set that shows “Wireless system” or something generic like that in the Device Manager? This would need to run on Windows – all recent versions.
January 10th, 2009 at 2:49 pm
I believe the following patch to drivers/usb/comm/x10-cm19a.c is required to compile the driver under more recent kernels
19c19
< #include <linux/config.h>
—
> #include <linux/autoconf.h>
25d24
< #include <linux/config.h>
43d41
< typedef int bool;
162c160
< MODULE_PARM(ReadTimeout, “i”);
—
> module_param(ReadTimeout, int, 0);
165c163
< MODULE_PARM(MaxTscvrCnt, “i”);
—
> module_param(MaxTscvrCnt, int, 0);
April 17th, 2009 at 6:05 pm
[...] Some great instructions on how to install it are located here: http://wp.pr0gr4mm3r.com. [...]
August 23rd, 2009 at 10:15 pm
What exactly do you do with MAKEDEV to make the device show up? I can’t get it to show up!
October 10th, 2009 at 10:47 am
That works great – I have now replaced the serial interface Firecracker CM17 with the USB CM19 for my Halloween setup – http://www.komar.org/cgi-bin/halloween_webcam
BTW, minor typo in the step-by-step above as the “ati” is transposed to “ait” here – sudo rmmod ait_remote