LIRC Serial

It seams that everytime I install a new version of Fedora, I always have to fidget with LIRC to get the remote to work again. At one point I was making a symbolic link from /dev/lirc -> /dev/lircd (if I recall correctly) or some other sillyness in modprobe.conf to fix symptoms similar*[1] to this from /var/log/messages:

lircd-0.8.1-CVS[3637]: accepted new client on /dev/lircd
lircd-0.8.1-CVS[3637]: could not get file information for /dev/lirc0
lircd-0.8.1-CVS[3637]: default_init(): No such file or directory
lircd-0.8.1-CVS[3637]: caught signal

*[1] I say “similar” because this was the message resulting from not loading the kernel modules — “modprobe lirc_serial”. But, as I recall, it gives similar symptoms when /dev/lirc* isn’t happy.
So, once and for all, I’m going to document what works for me. I’m using a homebrew infared receiver connected to COM1 serial port. This setup has worked perfectly with FC3 and FC6 (skipped 4 and 5).
Relevant section of /etc/modprobe.conf. Note that the final line ‘install lirc …’ is wrapped (one line only)

# Lirc stuff
alias char-major-61 lirc_serial
options lirc_serial irq=4 io=0x3f8
install lirc_serial /bin/setserial /dev/ttyS0 uart none; /sbin/modprobe –ignore-install lirc_serial

Here’s the real fix for all the /dev/lirc* unhappiness I’d get after starting lirc, only to watch it die as soon as something tried to use it (like irw). Add the following option to /etc/sysconfig/lircd :

# Options to lircd
LIRCD_OPTIONS=”-d /dev/lirc0″

Since I’m using LIRC to control MythTV, here’s the /etc/lircd.conf for a Yamaha RAV352 Remote control (standard remote that shipped with RX-V2500 receiver) with the default “DVR/VCR2″ remote function active. This will probably work for many other Yamaha remotes:

begin remote

name yamaha_rav352_drv
bits 21
flags RC6|CONST_LENGTH
eps 30
aeps 100

header 2718 842
one 481 406
zero 481 406
gap 108872
toggle_bit 0

rc6_mask 0×10000

begin codes
POWER 0x0ECFF3
POWER 0x0FCFF3
REW 0x0ECFD6
REW 0x0FCFD6
FFWD 0x0ECFD7
FFWD 0x0FCFD7
PREV_CHAPTER 0x0ECFDE
PREV_CHAPTER 0x0FCFDE
NEXT_CHAPTER 0x0ECFDF
NEXT_CHAPTER 0x0FCFDF
REC 0x0ECFC8
REC 0x0FCFC8
STOP 0x0ECFCE
STOP 0x0FCFCE
PAUSE 0x0ECFCF
PAUSE 0x0FCFCF
PLAY 0x0ECFD3
PLAY 0x0FCFD3
CURSOR-UP 0x0ECFA7
CURSOR-UP 0x0FCFA7
CURSOR-DOWN 0x0ECFA6
CURSOR-DOWN 0x0FCFA6
CURSOR-LEFT 0x0ECFA5
CURSOR-LEFT 0x0FCFA5
CURSOR-RIGHT 0x0ECFA4
CURSOR-RIGHT 0x0FCFA4
ENTER 0x0ECFA3
ENTER 0x0FCFA3
TITLE 0x0ECF37
TITLE 0x0FCF37
MENU 0x0ECFAB
MENU 0x0FCFAB
RETURN 0x0ECF7C
RETURN 0x0FCF7C
DISPLAY 0x0ECFF0
DISPLAY 0x0FCFF0
AUDIO 0x0FCFB1
AUDIO 0x0ECFB1
1 0x0ECFFE
1 0x0FCFFE
2 0x0ECFFD
2 0x0FCFFD
3 0x0ECFFC
3 0x0FCFFC
4 0x0ECFFB
4 0x0FCFFB
5 0x0ECFFA
5 0x0FCFFA
6 0x0ECFF9
6 0x0FCFF9
7 0x0ECFF8
7 0x0FCFF8
8 0x0ECFF7
8 0x0FCFF7
9 0x0ECFF6
9 0x0FCFF6
0 0x0ECFFF
0 0x0FCFFF
end codes

end remote

Note that every button has 2 codes so the device can recognize a single button push from an extended button push. If you find that you have to push the remote button twice to get it to function, you are missing the second encoding set. And that’s it for configuration. Once it’s configured, just:

# modprobe lirc_serial

# service lircd start

# /usr/bin/irw

If irw runs, grab the remote and mash some buttons and it should print out messages. If irw dies immediately, there’s some other problem, and it’s time to investigate /var/log/messages to find out why.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>