A MicroPython application that displays your Last.fm "now playing" information on a Pimoroni Presto device. Features album art display, recent tracks list, and a clock with touch navigation between modes.
Inspired by the WiiM Now Playing app.
This project transforms your Pimoroni Presto into a Last.fm display that shows:
- Album Art Mode: Full-screen album artwork for currently playing tracks
- Recent Tracks Mode: List of your 4 most recent Last.fm scrobbles
- Clock Mode: Digital clock with date display
The display automatically updates when you start listening to new music and provides an elegant way to see your music listening activity at a glance.
- Pimoroni Presto
- Pimoroni MicroPython firmware installed
- WiFi network connection
- Last.fm account with API access
- Set up your Pimoroni Presto according to the official documentation
- Ensure MicroPython is installed and the device is connected to your computer
-
Clone this repository:
git clone <repository-url> cd lastfm-presto-display
-
Copy the required files to your Presto:
lastfm_playing.py
- Main applicationsecrets.py
- Configuration file (see Configuration)Roboto-Medium.af
- the Roboto font in Alright Font format.
-
Ensure your Presto has the required dependencies (these should be included with Pimoroni's MicroPython build):
picovector
presto
urequests
jpegdec
,pngdec
- Visit the Last.fm API page to create an API account
- Create a new API application to get your API key
- Note down your API key and Last.fm username
Edit the secrets.py
file with your credentials:
WIFI_SSID = "your_wifi_network_name"
WIFI_PASSWORD = "your_wifi_password"
LASTFM_API_KEY = "your_lastfm_api_key"
LASTFM_USERNAME = "your_lastfm_username"
TIMEZONE_OFFSET = +1 # Adjust for your timezone (+1 for GMT+1, -5 for EST, etc.)
Important: Never commit your secrets.py
file with real credentials to version control.
- Upload both
lastfm_playing.py
and your configuredsecrets.py
to your Presto device - Run the application
import lastfm_playing
- The device will connect to WiFi and start displaying your Last.fm data
- Touch the screen to cycle between display modes:
- Album Art → Recent Tracks → Clock → Album Art...
Album Art Mode
- Shows full-screen album artwork for the currently playing track
- Displays artist name and track title at the bottom
- Updates automatically when you start playing new music
Recent Tracks Mode
- Lists your 4 most recent Last.fm scrobbles
- Shows track numbers, artist names, and song titles
- Indicates currently playing tracks
Clock Mode
- Large digital time display
- Shows current date with day of week
- May be useful as a bedside clock when not actively listening to music?
- Automatic Updates: Polls Last.fm API every ~30 seconds for new tracks
- Album Art Display: High-quality album artwork with rounded corners
- Touch Navigation: Simple tap-to-cycle interface between modes
- WiFi Auto-Recovery: Automatically reconnects if connection is lost
- Timezone Support: Configurable timezone offset for accurate time display
This application uses the Last.fm API with the following endpoints:
user.getrecenttracks
- Fetches recent listening history- Image proxy via wsrv.nl for album art resizing and optimization
The application makes API calls approximately every 30 seconds to respect Last.fm's rate limits and conserve battery life.
- Pimoroni Presto Product Page
- Pimoroni Presto GitHub Repository
- Last.fm API Documentation
- Last.fm API Key Registration
PRs accepted! Feel free to contribute improvements, bug fixes, or new features.
MIT © 2025 Andy Piper