The other day I was watching TV on a Virgin V6 box when I thought how convenient it would be to be able to ask Alexa to change the channel; I started scrolling through the menus when I stumbled across a setting for "Network Remote Control" that was disabled. There was no information on what it did, but I turned it on and then turned to Mr Google. A little digging found me on this document provided by TiVo themselves. It explains how you can connect to a box over the local network and issue simple text based commands to do things like change channels and navigate around the menus. So, I fired up the Terminal on my computer and connected to the box over telnet. Quickly I saw the potential for some C++ practice and dove into writing the v6Control library, for sending remote control commands from a WiFi enabled Arduino.
If you want to download the library, check it out on GitHub.
I wanted to make the library as out-of-the-box compatible with multiple targets, so I started with the standard Arduino WiFi library and created the v6Client class by inheriting from the WiFiClient class. From this point, it was relatively straightforward to implement a function that opened a TCP connection on a specified port and sent whatever text was supplied. After this it was simply a matter of creating some friendly named functions that users can use in their own sketches quickly that then use the library to send the relevant command. The full command list is below:
- changeChannel(int c);
- numericInput(int n);
By far the hardest part of writing this library was creating the examples. A browser-based remote that runs on a ESP32 / ESP8266 running the Arduino core that you could connect to from any device seemed like the most immediately useful example.
It's particularly lightweight and fast at running when you press a button, so it can work in the background on a microcontroller that you're using to do something else. I implemented it in the background of our RN52 Metadata Display, which we have on all day during the day anyway and was quickly changing channels from my Mac in Safari.
Well, back to the Alexa integration that this was a total diversion from I guess! I'll also probably try implement it with an IR LED so that we can control the volume and turn the TV on and off too. Stay tuned for a follow up article on the progress, and maybe you too will be controlling a V6 or TiVo box using Alexa or a home assistant of your choice.