Setting up the Redirect plugin lets you configure endpoints that respond to your TRMNL device as if it were the core web application.
Use Cases
You already use the Alias plugin, but want to avoid screen flicker if the content hasn't changed.
You want a more dynamic rotation of content. Instead of the fixed minutes interval from your Playlist > Playlist Group preferences, you may instruct a device to wait 3 mins, or 20 mins (for example) based on the content being returned.
Your server's content is uploaded to remote locations, where the URL is not predictable. Either because it is hashed (e.g. S3 bucket) or otherwise unique. The Alias plugin requires a static endpoint, whereas Redirect allows you to pass back a different URL on each request.
Step 1 - Configure Plugin
From the Plugins directory, select the Redirect plugin. Provide a URL endpoint from your server. This Web Address must be publicly accessible on the web.
TRMNL will ping your server to get the response data. Your server should respond with the below JSON data. Please keep in mind that TRMNL has strict timeout of 2 seconds, before sending a failure response.
{ filename: 'get-coffee', url: 'https://192.168.2.1:4567/get-coffee.bmp', refresh_rate: 3000 }
Note that the url
response param can be anywhere, including a local network.
Filename
The filename attribute is used as the "diff" parameter. If the filename between requests does not change, your device will not refresh the screen, thus avoiding unnecessary screen flicker and saving battery power.
βURL
Make sure this points to an image that is 1 bit bitmap(bmp3) or 1 bit PNG, 800x480 pixels. See here for a hint on generating this format with ImageMagick. Your image may be at a local destination, for example 192.168.5.3/my/image.png
.
Refresh Rate
The number of seconds your device should sleep before waking up again to request new content. The fastest you can go is 1x/minute (subject to change).
Step 2 - You're Done!
Based on your device's refresh settings, TRMNL will begin forwarding your content requests to the Web Address specified above.
Stay focused.
Credits:
Redirect by Alex Bickov from Noun Project (CC BY 3.0)