LIRC Infrared Remote Control
2009 Remote control : LIRC
Important files
- /etc/init.d/lirc #loads module and starts deamon
- /dev/lirc0 #lirc device
- /etc/lirc/hardware.conf #lirc device configuration
- /etc/lirc/lircd.conf #lirc remote configuration
- ~\.lircrc #lirc configuration of actions for vlc, totem etc
Install
sudo apt-get install lirc
Configure
I use a "Home-brew (16x50 UART compatible serial port)" / tty0
sudo dpkg-reconfigure lirc
Remote interface
sudo gedit /etc/lirc/hardware.conf
REMOTE_MODULES="lirc_dev lirc_serial" REMOTE_DEVICE="/dev/lirc0" LOAD_MODULES="true" LIRC_SERIAL_PORT="0x03f8" LIRC_SERIAL_IRQ="4" LIRC_SERIAL_CFLAGS=""
Remote configuration
Find the conf-file to go with your specific remote on internet:
sudo gedit /etc/lirc/lircd.conf
Configure events, this file is used by the irexec daemon
gedit ~/.lircrc
3. Start LIRC services
sudo service lirc restart
irexec daemon added system -> preferences -> sessions:
irexec -d
4. Test:
raw remote interface output:
sudo mode2 -d /dev/lirc0
remote keys output:
sudo irw /dev/lircd
Note: never have had the receiver working, but I didnt need it either, record buttons:
irrecord --list-namespace sudo irrecord --disable-namespace --device=/dev/lirc0 lircremote.conf
5. Notifications
sudo apt-get install libnotify-bin notify-send -t 6000 -i ~/Scripts/lirc.ico "Remote"
6. problem to start lirc at boot, modules load fine, daemon fails
remote: lirc: starting LIRC modules [ok] starting remote control daemon(s): LIRC Terminated [fail]
Added "sleep 1" directly after "modprobe":
sudo gedit /etc/init.d/lirc
Note: this was not needed for Urbuntu 11.04
Script
- extract full list of VLC .lirc keys
vlc -H --advanced 2>&1 |sed -n '/--key/ {s/^\ *--//; s/^\(.*\) <[^>]*>\ *\(.*\)$/\2 -> \1/;h}; /^.*[^ ].*-> key/ p; /^ -> key/ { n; s/^[ \t\n]*//M; G; s/\n//; p}'