The Linux Infrared Remote Control (LIRC) Project

Want to build an infrared remote control for your laptop, MythTV or hidden computer? Learn how.
The Software

I cheated a little for the software and used a short cut made possible by Jarod Wilson, who has done a great job of documenting MythTV and Fedora Core 4. After you have used up2date to bring your system up to date with the latest security patches, start up a terminal session and enter:

   <enter the root password>
   echo "export KVER=\`uname -r\`" >>
   cd /etc/yum.repos.d/
   yum install lirc-kmdl-$KVER
   yum install lirc-lib
   wget --no-check-certificate
   patch /etc/rc.d/rc.sysinit < rc.sysinit-mm.diff
   yum install lirc

Assuming that you are connecting the detector to ttyS0, put the following lines in file /etc/modprobe.conf:

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

If you are connecting the detector to ttyS1, enter the following lines:

   install lirc_serial /bin/setserial /dev/ttyS1 uart
none ; /sbin/modprobe --ignore-install lirc_serial
   alias char-major-61 lirc_serial
   options lirc_serial irq=3 io=0x2f8  

To test that you have a working infrared detector, type mode2. Point a working remote control at your detector and start pressing buttons. If you see something like:

   pulse 1187
   space 596
   pulse 598
   space 623
   pulse 553
   space 643
   pulse 630
   space 603

you have a working detector. If not, it's time to open up the hood and start troubleshooting. The first thing to check for is cold solder joints, where the solder has not bonded properly with the parts. Look for connections with a dull surface. Clip the heat sink to the appropriate nearby part, reheat those joints and remove the old solder with your solder remover. Then, re-solder using fresh solder.

Two Fully Complete Detectors

Assuming things do work now, you need to start configuring your system to work with the remote. But that is another significant project, one for another article.

Colin McGregor works for a Toronto area charity, does consulting on the side and has served as President of the Toronto Free-Net. He also is secretary for and occasional guest speaker at the Greater Toronto Area Linux User Group meetings.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

A minor detail, but it's

Anonymous's picture

A minor detail, but it's called a DE9 connector, not a DB9 :)

Actually, it is called a DB9

Anonymous's picture

Actually, it is called a DB9 connector... but again... minor point.

I'll jump in on this just

Anonymous's picture

I'll jump in on this just because I can :)

IR Detector

Anonymous's picture

I Could not find where the software is to use with the IR Detector. Do I just download the mythtv software or is there a specific software for the IR detector. I just need the software for the IR detector. I do not plan to use the myth tv stuff.

IR Detector software

Mike's picture

It's lirc. Go to for more information.

For a better usage of the 5V regulator

domi's picture

The capacitor should be connected to the input pin of the regulator instead of the output pin.

This way, you'll get a much better 5V supply.

creative infra

Nitin's picture

Hi Did you manage to get it working with an creative infra drive. I have been struggling for the same for days now. It requires it to have the ide-scsi module loaded; and then use scsi inquiries to do the same. Would this work with oldish mother boards / very old Creative Infra drive ??

Actually, you need a cap at

Anonymous's picture

Actually, you need a cap at both the input & the output for regulation and stabilty, respectively. A 1uF at the input and a 0.1uF at the output is fine for this.

Make me one!!

ErRoNeUs's picture

That serial device looks really cool. And while it appears to be simple enough, I was born with five thumbs on each hand and soldering irons hate me. Would there be any volunteers to make one for me? :) (How can someone contact me though? I left my valid email address but it won't show publically...)

maybe, i don't know, type it

Anonymous's picture

maybe, i don't know, type it in the big comment box

Check out this one:

Anonymous's picture

Check out this one:
I added a little led, to blink when I receive some IR signal (this is great for debuging and every days job)

Why not radio?

Anonymous's picture

IR is quite anitquated. It's cool for TV's and video where you have line of sight, but not much use for things like controlling music from another room.

Why not go radio? Or WiFi? Or Bluetooth? Linux should take the lead on some of these instead of just playing catchup.

RF remote with Lirc

Anonymous's picture

I use an rf remote, the X10 Mp3Anywhere remote with Lirc.

Where do you get the appliances ?

Anonymous's picture

1) Where do you get a 'radio' capable remote control ?
2) Where do you get a 'WiFi' capable remote control ?
3) Where do you get a 'Bluetooth' capable remote control ?

LIRCD allows you to interact with a Linux based computer using the same technology as you use to interact with your TV/VCR/DVD/Stereo/... equipment.

If you were to say use something like a Nokia 770 as your remote (hope the battery does not go flat) to control all your home AV equipment, then you need something to convert it's signals from Radio/WiFI/Bluetooth back to IR to allow you to interact with the end appliances.

IR may be old, but it's cheap, pervasive, reliable, secure, and proven to work.


Lansing's picture

I think you might need to re-evaluate that statement:

A simple brute force attack reneders every "secure" ir system useless. For example, most garage door systems work off sending an 8 bit message to the reciever. If you brute force this, that means that you only have to send out 256 guesses ( do you know how fast your computer can count to 256). Furthermore, the most "secure" ir systems use 16 bits which can be brute forced with 64k attempts which at most will take about 3 mins to break. Just a little food for thought.

Antiquated but affordable

pbardet's picture

I suppose the problem is to find a device that will be able to send information to the PC via your preferred method. Currently, finding an infra-red remote is fairly easy, not to mention cheap.

Sure it's a great ID. I personnally love my UHF remote on my PVR, but finding those remotes is not easy, and I didn't even look for an appropriate receiver.