LIRC - Linux Infrared Remote Control¶
With LIRC you can receive IR control codes of hundreds of known remote controls.
You can run it as a daemon and listen to incoming codes on it's network socket.
You can build the hardware yourself, or use one of the many supported IR receivers supplied with Multimedia PC's.
Look at the LIRC website for more info.
The ways this interface is integrated in the DomotiGa code is that for each IR code you receive you define an IRRemote trigger in the Events module.
See below for a detailed example.
How to install:
Install LIRC software:
$ sudo apt-get install lirc
It should give you a menu of remotes to pick from. If not, or you want to reconfigure it later try:
$ sudo dpkg-reconfigure lirc
I have a USB IR receiver, a Windows Media Center compatible one.
You can look in dmesg output for more information.
[445027.342540] input: PHILIPS MCE USB IR Receiver- Spinel plus as /devices/pci0000:00/0000:00:04.1/usb1/1-1/1-1.1/1-1.1:1.0/input/input11 [445027.342995] generic-usb 0003:0471:0613.0007: input,hiddev96,hidraw2: USB HID v1.00 Keyboard [PHILIPS MCE USB IR Receiver- Spinel plus] on usb-0000:00:04.1-1.1/input0 [446033.847572] lirc_dev: IR Remote Control driver registered, major 61 [446033.858284] lirc_mceusb: Windows Media Center Edition USB IR Transceiver driver for LIRC 1.90 [446033.858293] lirc_mceusb: Daniel Melander <lirc@rajidae.se>, Martin Blatter <martin_a_blatter@yahoo.com>, Dan Conti <dconti@acm.wwu.edu> [446033.858398] usbcore: registered new interface driver lirc_mceusb
Setting up lirc (0.8.6-0ubuntu2) ... * Loading LIRC modules [ OK ] * Starting remote control daemon(s) : LIRC [ OK ]
With this command you can check if your receiver detects commands, simply start it and press some buttons.
$ irw 000000037ff07bfe 00 One mceusb 000000037ff07bfe 01 One mceusb 000000037ff07bfd 00 Two mceusb 000000037ff07bfd 01 Two mceusb CTRL-C to break
Adjust your config file so the lird daemon listen for connections on port 8765.
This is my current one, you have to add '--listen' to REMOTE_LIRCD_ARGS
$ sudo vi /etc/lirc/hardware.conf # /etc/lirc/hardware.conf # #Chosen Remote Control REMOTE="Windows Media Center Transceivers/Remotes (all)" REMOTE_MODULES="lirc_dev lirc_mceusb" REMOTE_DRIVER="" REMOTE_DEVICE="/dev/lirc0" REMOTE_SOCKET="" REMOTE_LIRCD_CONF="mceusb/lircd.conf.mceusb" REMOTE_LIRCD_ARGS="--listen" #Chosen IR Transmitter TRANSMITTER="None" TRANSMITTER_MODULES="" TRANSMITTER_DRIVER="" TRANSMITTER_DEVICE="" TRANSMITTER_SOCKET="" TRANSMITTER_LIRCD_CONF="" TRANSMITTER_LIRCD_ARGS="" #Enable lircd START_LIRCD="true" #Don't start lircmd even if there seems to be a good config file #START_LIRCMD="false" #Try to load appropriate kernel modules LOAD_MODULES="true" # Default configuration files for your hardware if any LIRCMD_CONF="" #Forcing noninteractive reconfiguration #If lirc is to be reconfigured by an external application #that doesn't have a debconf frontend available, the noninteractive #frontend can be invoked and set to parse REMOTE and TRANSMITTER #It will then populate all other variables without any user input #If you would like to configure lirc via standard methods, be sure #to leave this set to "false" FORCE_NONINTERACTIVE_RECONFIGURATION="false" START_LIRCMD=""
Now if you want to use a remote in DomotiGa, configure LIRC, and enable LIRC debug in DomotiGa LIRC settings.
View debug log file page and press the button you want to map to an event.
2010/09/23 19:27:05 [LIRC] Parse String: 000000037ff07bfe 00 One mceusb 2010/09/23 19:27:05 [LIRC] Remote: mceusb Button: One 2010/09/23 19:27:05 [LIRC] Parse String: 000000037ff07bfe 01 One mceusb 2010/09/23 19:27:05 [LIRC] Remote: mceusb Button: One 2010/09/23 19:27:09 [LIRC] Parse String: 000000037ff07bfd 00 Two mceusb 2010/09/23 19:27:09 [LIRC] Remote: mceusb Button: Two 2010/09/23 19:27:10 [LIRC] Parse String: 000000037ff07bfd 01 Two mceusb 2010/09/23 19:27:10 [LIRC] Remote: mceusb Button: Two
Enter the Remote string and Button name you see into the Event Trigger like so:
Do this for all buttons you want to map.
Don't forget to disable debug if all works ok.
Related Resources¶
Comment¶
Updated by: rdnzl, Updated 9 months ago
Access count: 810 since 2011-08-25