USB IR Toy: Configure LIRC
From DP
LIRC is an infrared PC control program for Linux. LIRC currently works with the IR Toy's IRMAN-compatible mode, but could also be upgraded to support the IR Toy's sampling mode.
Hints
# udevadm monitor --udev
Run this command and plug in the IR Toy, it should say what /dev is assigned.
Any Recent Linux Distro
Any Linux distro with a kernel version greater than <FIXME> will work out of the box. You can check the version of you Linux kernel by running:
# uname -r
Setup
These instructions were tested on:
- Mandriva 2010 with lirc installed by urpmi (0.8.7)
Find the IR Toy
# dmesg usb 5-2: new full speed USB device using uhci_hcd and address 2 usb 5-2: New USB device found, idVendor=04d8, idProduct=fd08 usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 5-2: Product: USBIRtoy (CDC-232) usb 5-2: Manufacturer: DangerousPrototypes.com cdc_acm 5-2:1.0: This device cannot do calls on its own. It is not a modem. cdc_acm 5-2:1.0: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
- Plug in the USB IR Toy
- Type dmesg in your terminal and look for the ttyACMx number
- Check in /dev if ttyACM0 (or ACM1 ACM2 3 etc...) exists
Stop LIRC service
# service lircd stop
Record buttons with irrecord
irrecord -n -H irman -d /dev/ttyACM0 RemoteXXX.conf Hold down an arbitrary button. ................................................................................
- Start irrecord :irrecord -n -H irman -d /dev/ttyACM0 RemoteXXX.conf
- If your remote is detected you should see the dot appear when you push a button
Found gap length: 112976 Now enter the names for the buttons. etc...
- If succeed you'll be prompted to name and press each button on the remote
Ok it's good! usb-ir-toy is working but it's not finished.
Copy the remote configuration file
The RemoteXXX.conf becomes the configuration file for the LIRC daemon (lircd):
# cp RemoteXXX.conf /etc/lirc/lircd.conf
Start LIRC service
- service lirc start
Or, launch the LIRC daemon manually with this command:
# lircd --device=/dev/ttyACM0 --driver=irman
Confirm setup
#irw ffff001700000000 00 ok RemoteXXX.conf ffff001000000000 00 up RemoteXXX.conf ffff001100000000 00 down RemoteXXX.conf
- Run irw from the terminal and press buttons on the remote
Mythbuntu 10.04
This describes how lank23 got the IR Toy working with LIRC on Mythbuntu 10.04. Other distro's would be similar.
Stop the current driver
sudo modprobe -r cdc_acm
Stop the default driver from loading on plug in / boot up
gksu gedit /etc/modprobe.d/blacklist.conf
and add this line to the bottom of the file.
blacklist cdc_acm
Save and close the file.
Find out the name of your unit by running
lsusb
This is my output
lank23@MythServer:~$ lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 04d8:000a Microchip Technology, Inc.
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 058f:6362 Alcor Micro Corp. Hi-Speed 21-in-1 Flash Card Reader/Writer (Internal/External)
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
So from that I see that "04d8:000a Microchip Technology, Inc." is my device I need.
Edit the "/etc/modules" using the numbers from step 3
gksu gedit /etc/modules
at the bottom of the file add this line
usbserial vendor=0x04d8 product=0x000a
NOTE: Match your numbers as needed so that the "usbserial"driver will load for your device.
Save and close file.
Edit LIRC configuration files to use this new device
gksu gedit /etc/lirc/hardware.conf
Edit the file to match below
REMOTE="Custom"
REMOTE_MODULES=""
REMOTE_DRIVER="irman"
REMOTE_DEVICE="/dev/ttyUSB0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="/etc/lirc/lircd.conf"
REMOTE_LIRCD_ARGS=""
START_LIRCD=”true”
LOAD_MODULES=”true”
Save and close the file.
Unplug the device
Wait a little bit "2 seconds" then plug it back in.
Stop LIRC so we can edit configuration files for the remote
sudo service lirc stop
Record your remote.conf file Open a terminal and run
irrecord -n -H irman -d /dev/ttyUSB0 RemoteXXX.conf
Change the "RemoteXXX" to something you like.
Finish all the buttons you want.
Copy that file to the /etc/lirc/lircd.conf location
sudo cp RemoteXXX.conf /etc/lirc/lircd.conf
Now start LIRC
sudo service lirc start
Open terminal and run
irw
and see if you get output..., if so you have got it working. Next is to map the buttons to you programs.

