In the last post I tested the IR receiver; next step verify the IR LEDs emit light. If you are lucky enough to have a remote in the database maintained @ lirc.sourceforge.net/remotes/, you may not even need to record. None of these worked for my remotes, so I created custom config files for each remote. However, these are great for testing functionality. I found it easier to connect to the Raspberry Pi via FTP with FileZilla to move config files around than via SSH with PuTTy. This did require adjusting permissions using chmod on /etc/lirc/lircd.conf via SSH, to allow the Write operation.
Back up the original /etc/lirc/lircd.conf and then replace it with a working config from the LIRC Database.
Restart LIRC to pick up these changes:
- Use irsend to list the commands available for the specific remote (name line in .conf file), for example samsung:
- Use irsend to initiate an IR signal:
The easiest way to verify the IR LEDs are working is to point them at a camera that detects IR and check if the LEDs emit light when initiating the SEND_ONCE command. Some cameras may have a filter to remove light in this spectrum. Older devices are less likely to have these filters; IR was visible on the built in webcam of my HP Envy laptop.
Now that the hardware and LIRC are working, the next step is control from a website. Lirc_web relies on Node.js and luckily it’s easy to install on the Raspberry Pi thanks to node-arm.herokuapp.com. For most of the following steps I referenced alexba.in/blog/2013/02/23/controlling-lirc-from-the-web.
- Install and verify Node.js:
- Install and start lirc_web:
- Create an initialization script in /etc/init.d and register it using update-rc.d, this way lirc_web starts automatically when the Raspberry Pi boots. For more details see stuffaboutcode.com/2012/06/raspberry-pi-run-program-at-start-up and wiki.debian.org/LSBInitScripts.
Make the script executable:
Test starting lirc_web with the script:
Test stopping lirc_web with the script:
Register the script to be run at start-up:
- Stop lirc to free up /dev/lirc0:
- Create a new remote control configuration file using /dev/lirc0 and save the output to ~/lircd.conf. Once a file is generated for each remote it can be compiled into a single lircd.conf, this is much easier with FTP access. A list of namespace values for buttons is available @ocinside.de/modding_en/linux_ir_irrecord_list.
- After all the remotes are recorded and compiled, the lircd.conf file can be placed @ /etc/lirc/ and then restart LIRC to pick up the new configuration:
To finish of the hardware build I made a case out of Lego bricks, so it stays oriented vertically and has some protection.
Now control of IR devices is possible from a website, next up controlling Bluetooth devices the same way using GIMX.