It did what I wanted.
Then I stopped. Oh my gosh. How did that do that? That shouldn't have worked.
I'm an engineer. I understand things. If you push a button on a remote control, infrared light waves go speeding to an eye built into the TV. The Raspberry Pi has no eyes. It is blind to infrared light and everything else. It CAN'T respond to the remote!
Your eye does not work in the infrared. So, when you push the button on the remote control, you don't see anything. Your smartphone's camera uses a sensor that is sensitive to infrared. So, when you aim a remote at it, you can tell whether it's emitting or not.
(If you're a terrorist worried about infrared targeting lasers from the US military, you already know this. I said I understand things.)
My wife held the remote up to the camera with the button off and the button pushed on so that we could illustrate this.
How in the world did my Raspberry Pi figure out that I'd pushed the button on the TV remote?
After a bit of Googling, I found the HDMI standard and read about a CEC (Consumer Electronics Control) connection. If you have the right kind of HDTV, it can send commands back down the HDMI cable from the TV. And if the thang, Blu-Ray player, cable box, satellite box, whatever, is smart enough, it'll respond to those commands. It's like freaking magic.
This has profound ramifications for use of a Raspberry Pi as a set top computer. You don't need to hook ANY MOUSE or KEYBOARD to it: Just power, HDMI, and Ethernet. No USB hub or even those cute little wireless dongles.
So, I got to thinking, let's try this on my other TV set. I did. No joy. HDMI CEC is not on every TV set, just a select few. Since Black Friday is coming up, you might want to know what to look for if you're going to be buying a TV.
According to Wikipedia, the Trade names for CEC are
- Anynet+ (Samsung);
- Aquos Link (Sharp);
- BRAVIA Link and BRAVIA Sync (Sony);
- HDMI-CEC (Hitachi);
- E-link (AOC);
- Kuro Link (Pioneer);
- CE-Link and Regza Link (Toshiba);
- RIHD (Remote Interactive over HDMI) (Onkyo);
- RuncoLink (Runco International);
- SimpLink (LG);
- HDAVI Control, EZ-Sync, VIERA Link (Panasonic);
- EasyLink (Philips); and
- NetCommand for HDMI (Mitsubishi).