Domotiga/LIRC

LIRC - Linux Infrared Remote Control

With LIRC you can receive and send 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 port. You can build the hardware yourself, or use one of the IR receivers supplied with Multimedia PC's. Look at the LIRC website for more info.

The current DomotiGa code is hardcoded for a BEO4 RC, I'm thinking about ways to implement this in a more flexible way. One of them is define a LIRC Controller Interface, which you can create devices under (for example BEO4 Remote), and the values of that device are set to incoming LIRC IR commands, events are then used to control devices or do whatever you want to do.

How to install:

Install 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. Look in dmesg 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.

$ irw

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=""

Related Resources