Friday, December 23, 2011

The Remote Control

As I mentioned in my hardware post, I got a pretty generic Vista MCE Remote Control. By far, this was the most time consuming and frustrating piece of the install up to this point mainly because lirc is kind of a black box for me and guides for setting it up are scattered. Another problem that I ran into is that the USB IR receiver shows up as two devices. I finally got it working and minimized the process to a few basic steps, but a lot of blood and sweat went into the next set of instructions.

First off, install lirc. No additional drivers or kernel modules are necessary since I will be using /dev/input
[root@htpc ~]# yum install lirc
Next, get the generic lirc.conf for devinput from the lirc web site
[root@htpc ~]# wget http://lirc.sourceforge.net/remotes/devinput/lircd.conf.devinput -O /etc/lirc/lircd.conf
Then, because there are two devices in /dev/input, I needed a way to tie them together in lircd. I did this by editing the /etc/sysconfig file and putting in the following lines. The device names will be different depending on the remote, but these work for the one that I got.
LIRCD_OPTIONS_1="--driver=devinput --device=/dev/input/by-id/usb-05a4_9881-event-kbd  --pidfile=/var/run/lirc1.pid --listen=9988"
LIRCD_OPTIONS_2="--driver=devinput --device=/dev/input/by-id/usb-05a4_9881-event-if01 --pidfile=/var/run/lirc2.pid --connect=localhost:9988"
Finally, edit the lircd init script and modify the start function so that two lircd daemons are started up with the options from /etc/sysconfig
daemon lircd $LIRCD_OPTIONS_1
daemon lircd $LIRCD_OPTIONS_2
All that's left is to set lircd to start at boot and start the service
[root@htpc ~]# chkconfig lircd on
[root@htpc ~]# service lircd start
And of course test
[root@htpc ~]# irw 
Pressing the buttons on the remote control should show up in the output of irw.

References:
http://www.gossamer-threads.com/lists/mythtv/users/430004
http://old-de.opensuse.org/Linux_Infrared_Remote_Control


No comments:

Post a Comment