As an alternative to Infrared, you could use HDMI, if your TV has HDMI 2.0, it will support some kind of CEC (
Consumer Electronics Control) implemenatation
Each TV brand calls this something else, like Panasonic Viera Link. But it all uses the same standard just some TV's implement more, some less but the basics should be there. Like turn TV on or off, navigate channels, etc.
cec-o-matic is a useful tool to try and help you decode message that the array of HDMI devices are sending across the CEC network. Remember that you can also control the Pi form the TV via a remote, but that can also be an AMP, Blu Ray Play, etc. It is uni directional.
You would need to build CEC-CLIENT so you first need a few dependencies
apt-get install build-essential autoconf liblockdev1-dev libudev-dev git libtool pkg-config
Then get it from GIT and build
git clone git://github.com/Pulse-Eight/libcec.git
./configure --with-rpi-include-path=/opt/vc/include --with-rpi-lib-path=/opt/vc/lib --enable-rpi
You can then check if the CEC device is working properly on the Pi by using this console command
Here are a few more commands to get you going
- Scan the CEC bus, and report all devices:
echo "scan" | cec-client -s -d 1
- Check the power status of the TV (device 0):
echo "pow 0" | cec-client -s -d 1
- Turn the TV on:
echo "on 0" | cec-client -s -d 1
- Turn the TV off:
echo "standby 0" | cec-client -s -d 1
It might be a bit difficult to work out all the commands at first but it is a very robust way to control devices connected via HDMI.
Most tutoritals show how to control the Pi via the TV, like XBMC does. Basically you use your TV remote to navigate the menu on the XBMC. But you can do it other way too.
I hope this helps somebody in the future as an alternative to Infradead.