LIRC is the Linux Infra-red remote control library which provides drivers and utilities for managing consumer infra-red devices under Linux.
As of December 2012, LIRC support has recently been added to the preferred RPi distro, Raspbian, but foolproof instructions to get this working are hard to find
Upgrade to the latest distro software | |
1 | Make sure the time/date is accurate. Generally a time server should be used, which seems to be built in to the distro, but make sure the time zone is correct. |
2 | If in doubt about the time server, follow the 2 substeps below, extracted from here1 |
2a | sudo apt-get install ntpdate |
2b | sudo ntpdate uk.pool.ntp.org |
3 | Extracting from the instructions here1, the substep below |
3a | sudo apt-get update && apt-get dist-upgrade |
4 | I also ran sudo apt-get upgrade |
Install LIRC | |
5 | sudo apt-get install lirc |
Run the firmware update tool | |
6 | Instructions for the update tool are found here2 |
6a | sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi_update && sudo chmod +x /usr/bin/rpi-update |
7 | sudo rpi-update |
The update tool will go away and eventually come back when the firmware is upgraded. This should now allow lirc to run | |
LIRC Basic configuration | |
8 | LIRC configuration instructions are here3 |
8a | Add the following lines to /etc/modules: lirc_dev lirc_rpi gpio_in_pin=23 gpio_out_pin=22 |
The easiest way to work out how to program for LIRC is to look at the source for the existing tools. This can be retrieved using the following command:
git clone git://lirc.git.sourceforge.net/gitroot/lirc/lirc
This unpacks the source into a subdirectory lirc under the current directory
1 | http://www.raspbian.org/HexxehImages |
2 | https://github.com/Hexxeh/rpi-update/ |
3 | http://www.raspberrypi.org/phpBB3/viewtopic.php?f=45&t=7798&start=75 |