mirror of
https://github.com/vwillcox/PrestoNowPayingServer.git
synced 2025-12-12 03:05:39 +00:00
A quick flask server for my Pimironi Presto Now Playing project
https://blog.talktech.info/perfecting-a-pimoroni-presto-project
| .gitignore | ||
| media-server.py | ||
| README.md | ||
| requirements.txt | ||
Running this
Please visit https://blog.talktech.info/home/perfecting-a-pimoroni-presto-project for all the information
Getting the code to the Presto:
Save the presto code to your Presto using a tool like Thonny. Save the file as main.py if you would like to to run on startup of the device.
Running the PC server code:
Clone the following repository and follow the instructions:
git clone https://github.com/vwillcox/PrestoMediaPlaying.git
cd PrestoMediaPlaying
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Now if you just want to test this you can run in debug mode:
python3 media-server.py
Now install the Presto Code to your Presto using Thonny and run Play some media on your PC (Youtube, Spotify etc) and the item should show on your Presto. If it does not you need to install one more component
ARCH Based Linux
sudo pacman -S playerctl
Debian Based Linux
sudo apt install -y playerctl
and now ensure it is running:
playerctld daemon
If all is working and you want to run the server code in a production environment, there is one more step
playerctld daemon
export FLASK_ENV=production
export FLASK_APP=media-server.py
gunicorn media-server:app --bind 0.0.0.0:5000 --daemon