I bought this Infrared Shield for my Rasberry Pi model B (running Raspian Jessie). I wanted to use it to remotely control my Frigidaire FFRE0833S1 window-mounted AC unit. Here are the steps I undertook to get it up and running.
-
Install LIRC software (instructions here were slightly outdated)
sudo apt-get install lirc
-
System-config for LIRC. This had changed since the original instructions I had, this StackExchange post solved it for me. (My transmitter is connected to pin 17, and receiver connected to pin 18 of Raspberry Pi.)
-
Add the following line to
/boot/config.txt
and reboot.dtoverlay=lirc-rpi,gpio_out_pin=17,gpio_in_pin=18.
-
-
Configure LIRC:
-
Edit the hardware.conf of LRIC to enable the infrared function:
sudo nano /etc/lirc/hardware.conf
-
Modify the following lines (originally I had
LIRCD_ARGS="--uinput --listen"
but that seemed to break things!):LIRCD_ARGS="" DRIVER="default" DEVICE="/dev/lirc0" MODULES="lirc_rpi"
-
-
Restart LIRC:
sudo /etc/init.d/lirc stop sudo /etc/init.d/lirc start
-
Stop LIRC software:
sudo /etc/init.d/lirc stop
-
Run the following command:
mode2 -d /dev/lirc0
-
Point any remote toward infrared shield and press any key. If we receive any information like the following, it means that the receiver function is normal.
space 16300 pulse 95 space 28794 pulse 80 [etc]
I found a ready-to-go config file here and some helpful instructions on configuring LIRC.
-
Copy the config file to
/etc/lirc/
:sudo wget -O /etc/lirc/WF-RG63.conf "https://sourceforge.net/p/lirc-remotes/mailman/attachment/1981f5d2-fe75-e9cc-1094-a334a660ac6d%40gmail.com/1/"
-
In /etc/lirc/lircd.conf, include your remote definition file. This will be the only command in the file.
include "/etc/lirc/WF-RG63.conf"
-
In /etc/lirc/hardware.conf, set REMOTE_LIRCD_CONF to the remote definition file. (I don’t think this does anything, but it doesn’t hurt.)
REMOTE_LIRCD_CONF="/etc/lirc/WF-RG63.conf"
-
Start
lircd
and test it withirw
. Press a few of the buttons you have trained in the previous section and make sure they show up in irw. For example:$ sudo service lirc start $ irw 0000000010af8877 00 KEY_POWER frigid 0000000010af8877 01 KEY_POWER frigid
Use the following to toggle the AC unit on or off:
irsend SEND_ONCE frigid KEY_POWER
Homebridge can be installed via these instructions. I needed to upgrade my version, so uninstalled and did a complete reinstall. (I needed to uninstall globally: sudo npm uninstall -g homebridge
)
I have homebridge running as a systems service as per this approach.
I used this homebridge plugin: homebridge-programmableswitch, with the following config file (at /var/homebridge/config.json
):
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:31",
"port": 51826,
"pin": "031-45-154"
},
"description": "Configuration file for the Ryan apartment",
"accessories": [
{
"accessory": "WeMo",
"name": "Kitchen Lights",
"description": "The Table Lights in the Kitchen",
"wemo_name": "Kitchen Lights"
},
{
"accessory": "ProgrammableSwitch",
"name": "Air Conditioner",
"statefull": true,
"pythonScriptPath": "/usr/local/lib/node_modules/homebridge-programmableswitch/",
"pythonScriptName": "IRremote.py",
"minValue": 0,
"maxValue": 1,
"manufacturer": "Frigidaire",
"serialnumber": "WF-RG63",
"irCommands": {
"0": [{
"remote": "frigid",
"key": "KEY_POWER"
}],
"1": [{
"remote": "frigid",
"key": "KEY_POWER"
}]
}
}
]
}