Skip to content

Background Information

shbatm edited this page Dec 24, 2018 · 4 revisions

Why Fire Stick?

The Amazon Fire Stick remote controls are simple 6-button + D-pad remotes that will connect easily to the Raspberry Pi Zero W and Raspberry Pi 3 built-in Bluetooth and act as an input device with no additional software. They're also cheap, and I've picked them up on eBay for as little as $10. You don't just have to use a Fire Stick remote though, any bluetooth or wireless presentation "clicker" or remote would work great; you just need to update the key map in the config. See: Setting Up the Remote.

Why a Notify and Relay Server?

First, what is a "Notify" server? This is simply an extra route added to the MagicMirror which takes in URL based notifications in the following form:

HTTP GET: http://localhost:8080/MMM-KeyBindings/notify?notification=##NOTIFICATION-TITLE##&payload=##JSON.STRINGIFY'D-PAYLOAD##

The purpose of the "Notify" server is two-fold: (1) it allows the python daemon to communicate easily with the MagicMirror and (2) if enableRelayServer is enabled in the config, it will accept URL notifcations and re-broadcast them internally to other modules. This is useful for controlling other modules from an external source such as through an ISY Network Resources.

Example to fake a "Enter" keypress over the network:

http://mirror_ip:8080/MMM-KeyBindings/notify?notification=KEYPRESS&payload=%7B%22KeyState%22%3A%20%22KEY_PRESSED%22%2C%20%22Duration%22%3A%200.0%2C%20%22KeyName%22%3A%20%22Enter%22%7D

// payload parameter is a url-encoded JSON string:
{"KeyState": "KEY_PRESSED", "Duration": 0.0, "KeyName": "Enter"}
Clone this wiki locally