The Roku TV is perfect for watching Netflix but I don't like the remote. Although the little box is small and easy to use, the infrared range is pretty bad. I almost always reach out for the iOS app instead.
The Roku External Control API offers a super simple way to control a Roku device from the local network.
For instance, once you find out the local IP address of your Roku, you can turn it on and control the volume from your terminal.
$ curl -d '' http://192.168.1.134:8060/keypress/PowerOn
$ curl -d '' http://192.168.1.134:8060/keypress/VolumeUp
This means we can build our own remote using an Arduino enabled WiFi board. No more IR issues.
This seems simple enough, let's a build a proof of concept.
When searching for a Arduino compatible board with WiFi, I looked no further than the ESP8266. It’s cheap and has tons of documentation. I used an Adafruit Huzzah Breakout board that I had lying around and powered it with a Lipo battery.
I then built a simple prototype with two buttons for Volume Up and Down and it worked perfectly.
Let's build the real thing
The original remote has 18 buttons. If we get rid of the 4 channel shortcuts, we’re left with 16 buttons. This means we can use a numeric keypad! We’ll cover the numbered buttons later using stickers.
Let’s get started!
- Plastic enclosure
- 4x4 Matrix Keypad
- Lithium Ion Polymer Battery — 3.7v 1200mAh
- Adafruit Huzzah ESP8266 breakout
- Female/Female jumper wires
- Prototype board
- Male Headers
- CP2102 USB to Serial converter
- Adafruit Micro-Lipo Charger
Note: You don’t need the last two components when using a Feather Huzzah with ESP8266 instead of the breakout board.
- Label maker with black label tape for creating the stickers
- M2.5 nylon screws and nuts
- Cordless drill
- Hobby knife and a file
First, mount the ESP8266 and the USB charger on the prototype board:
- Cut the corners of the board and drill 2 holes so that it can be mounted inside the enclosure.
- Solder the breakout board between 2 rows of male headers and connect the pins together.
- Drill 4 holes and screw the charger on the board
Then, install the components in the enclosure:
- Cut openings to fit the keypad and the micro-USB port. I proceeded by drilling multiple holes, then finished the edges with a file and a hobby knife.
- After mounting the keypad, drill 4 holes from the inside for the M2.5 screws.
- Plug the battery, place it underneath the prototype board. Then screw the board in the enclosure.
Finally, connect the components together using the jumper wires according to the diagram below.
After connecting the USB-to-Serial cable, follow these instructions for installing the Arduino Code. While holding down the GPIO0 button, click the RESET button to enter bootload mode.
Here’s what it looks like with the stickers on. It’s bulky, but it works!
I hope this was useful! You can find all the resources in the GitHub repository.