A quick flask server for my Pimironi Presto Now Playing project https://blog.talktech.info/perfecting-a-pimoroni-presto-project
Find a file
2025-07-08 19:30:20 +01:00
.gitignore add gitignore 2025-07-01 20:17:14 +01:00
media-server.py initial commit 2025-07-01 19:54:41 +01:00
README.md Update README.md 2025-07-08 19:30:20 +01:00
requirements.txt add requirements.txt 2025-07-01 20:00:12 +01:00

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