Install Slinger server on Android - a mini manual
Now that the slingboxes are not just unsupported, but the automatic updates
actively and deliberately try to destroy the slibgoxes, we kind of have to rely
on the Slinger server by Gerry Dazoo.
Though it is still possible to use the old 1.5 slingplayer for Windows and MacOSX,
on Android we have to use the Slinger
application. But that requires the Slinger server running somewhere. And since I wanted to minimize the amount of electronic clutter, I tried to run the server locally on Android, and this turned out to be rather easy, thanks to termux.
Or perhaps you have an old Android TV settop box around that can be used as the server (after all, it is designed to be running continuously) and you can save your Raspberry PI for other projects...
This somewhat assumes you are familiar with termux, but I include a termux installation and setup, just in case. I'll assume your Slingbox is set up and working, with all the necessary port forwarding, access to Sling media servers disabled etc.
- install termux & termux-widget (preferably from F-Droid or sideload, installing from Google Play is deprecated).
- Make all the usual adjustments to ensure you Termux is not terminated by battery savers or freezer apps…; if you are on Android 12 or higher, make sure you've read and understand about phantom processes restrictions and how to disable them
- add Files and media permissions to termux (Settings, Apps, Termux, Permissions, Files and Media, Allow…)
- add overlay permissions to termux (necessary for the widget): Settings, Apps, Termux, Display on top
- open termux and install necessary packages:
pkg update
pkg install python-pip
pip install Flask
- download and configure slinger server in your termux environment, I’ll assume it is in the ~/slinger directory, i.e. edit config.ini, custom remote etc…
- install the Slinger app from https://github.com/GerryDazoo/SlingerPlayer/tree/main/Android
- test the server:
- open termux and run:
- cd slinger; ./slingbox_server.py
- leave the terminal running, start the Slinger app, it should detect your (android) ip and display it into the url, tap the arrow to play the video
- if everything works, kill the slingbox_server.py with Ctrl C (or stop whole termux, from the notification bar)
- run termux again and:
- make the shortcut directory: mkdir .shortcuts
- put the following contents into the .shortcuts/slinger file:
#!/bin/sh
cd ~/slinger
# this is ugly, but it works...
pgrep -f slingbox_server.py && exit 0
exec timeout -k 30 4h python ~/slinger/slingbox_server.py
- make it executable: chmod a+x .shortcuts/slinger
- add the widget: tap and hold on a home screen (or whatever your launcher requires), select Widgets, Termux, Termux Widget, slinger; confirm adding it to your launcher
Now, you have a shortcut icon that launches the slingbox_server.py locally on your android. When you want to watch TV, tap the shortcut and then you can launch the Slinger. (sidenote: I tried to set up a Macrodroid macro to launch the shortcut automatically, but it seems that Macrodroid supported launching a shortcut until some version, but it just does not work anymore)
If your Android IP number changes in between, the Slinger will detect it and add it to the list of URL's - and you have to select the correct one. Unfortunately, for some reason, using 127.0.0.1 does not work.
Do not forget to kill the slingbox_server.py if you stop watching, otherwise it will drain your battery. As a failover, there is the timeout command that kills the server after some time (4 hours in the example above; modify according to your wieving habits).