TRemote Host for Linux

Would you like to remote control a Raspbery Pi or a similar device? TRemote Host for Linux let's you do just that with a small Bluetooth LE remote.


Sample configuration A

Let's have a look at mapping.txt. This is where remote buttons get connected to functionality on the host device.

Below we connect two buttons (P1, P2) to two Internet radio stations (DLF, TheJazzGroove):

P1, TalkRadio, play_stream|DLF=http://st01.dlf.de/dlf/01/104/ogg/stream.ogg|...
P2, MusicRadio, play_stream|TheJazzGroove.org=http://199.180.75.26:80/stream|...

The play_stream command let's you provide one radio station per button, or as many as you like (separated by pipe characters). When you provide more than one station, you will be able to step through the list with short button presses. Long button presses (500ms+) will take you backwards through the list.

Next we connect two buttons (P3, P4) with audio content (mp3/ogg/flac) in two folders on the local filesystem:

P3, Jazz, play_audio|/home/pi/Music/Jazz
P4, Rock, play_audio|/home/pi/Music/Rock

When you hit P3 or P4 and do nothing else, audio playback will continue forever in random fashion. It does not matter how many files are stored in these folders. Songs that have started playing will not be played again for the next (at least) 50 new songs. A button short-press will always take you to the next song. A long-press will take you to the previous song.

Note that play_audio supports any type of audio content. Hi-Res audio (such as 24/96 audio in flac files) will be played back in bit-perfect fashion. You want to attach a good USB DAC to take advantage of this.

Here a few buttons to manage audio volume. These commands have no arguments:

P5, Vol-, volume_down
P6, Vol+, volume_up
P7, Mute, volume_mute
P7L,Stop, media_stop

Volume up and down support long-press repeat. Short-press P7 will mute audio. Long-press P7 will stop audio playback.

Button P8 will get two special Internet radio links. Short-press will always play back the latest news. Long-press will play back the latest weather news:

P8, News, play_stream|DLF News=http://ondemand-mp3.dradio.de/file/dradio/...
P8L,Weather,play_stream|Weather News=https://www.weatherforecast.com/locations/...

OK. Done.

This is what our 10 line configuration results in:





Sample configuration B

This time we create a Bluetooth remote control for VLC:

P1, Prev, http_request_get|(hostaddr)/requests/status.xml?command=pl_previous
P2, Pause,http_request_get|(hostaddr)/requests/status.xml?command=pl_pause
P2L,Play, http_request_get|(hostaddr)/requests/status.xml?command=pl_play
P3, Next, http_request_get|(hostaddr)/requests/status.xml?command=pl_next
P4, Stop, http_request_get|(hostaddr)/requests/status.xml?command=pl_stop

Note: (hostaddr) must be replaced with "username|passwd|http://localhost:8090"
username and passwd may be empty, in which case you have 3 pipes in a row. Example:
P3,Next,http_request_get|||http://localhost:8090/requests/status.xml?command=pl_next

Keeping P5-P8 from sample configuration A, this is what we get:




It is also possible to connect button events to command line tools. You can use shell_command and root_command to execute anything you like. This let's you create bindings for, say, a USB DVB device or a USB SAT reveiver. Or something completely different.

TRemote Host works as a Linux background service. It requires less than 10 MB of RAM.

A remote control can be be connected via Bluetooth LE or USB-Serial. TRemote via Bluetooth LE connects on average within 2.2 secs (1660ms-2780ms). TRemote via USB-Serial connects on average within 1.4 secs (power up time).

TRemote Host consists of a single executable binary. Raspbian OS comes with everything needed on board. No 3rd party dependecies need to be installed.

We think that TRemote Host for Linux is a great alternative to the Android variant.