Teaching an old Pi new tricks: building a “now playing” display with Claude

I built a small e-paper display for my desk that shows whatever’s playing on my Bose speaker, from any source (Spotify, AirPlay, radio), with the album cover, track and artist.

I did a thing.

My parents bought me a Raspberry Pi 3 Model B for my birthday a decade or so ago. The plan was that it would help me learn Python, launch a software company and retire at 40. Naturally, it’s been sitting in a drawer ever since, alongside my GoPro - fantasies of being an extreme athlete; the most exciting thing ever recorded was me jumping into a pool.

I know a little HTML, CSS, Python, C and SQL. That’s enough to recognise code, but not enough to build anything that runs on its own in the real world. So when I came across this Spotify desk widget, it felt like the right project: small, useful, and just ambitious enough. I took a slightly different route, though:

  • Any source, not just Spotify. I play to my speaker from different apps, so my display asks the speaker what it’s playing rather than asking Spotify.

  • One device, no Home Assistant. The original used a second server. Mine runs everything on the Pi.


Prototyping

The additional parts took a while to arrive, so I started on my Mac with a pretend screen: a Python script that asks what’s playing and draws the picture the e-paper will show, then opens it in Preview. The first time my song appeared as a grainy little album cover was pretty cool.

I spent a few evenings reading the scripts line by line, working out what each part did, and changing things to see what would break.

Then I decided Spotify wasn’t enough. I wanted the display to show anything playing on my Bose.

Bose doesn’t offer an official way to ask a speaker what it’s playing, but some Bose fans have written their own. Using it meant dealing with:

  • an add-on the library forgot to install;

  • a bug that made my script hang forever when saying goodbye to the speaker;

  • discovering that Spotify on my phone reaches the speaker over AirPlay, so the speaker doesn’t even know it’s Spotify;

  • radio stations stuffing the song, composer and station into all the wrong fields.


Where it’s at

It works. The Pi starts by itself, watches my speaker, and redraws the screen whenever the song changes. It’s a bit temperamental: when my router restarts, the speaker gets a new address and the Pi loses track of it. But that’s understandable, and fixable.


What’s next:

  • Sleep mode: go quiet when nothing’s been playing for a while, and wake up at 7am each morning.

  • A weather display to flick to.

  • A case. I’m a fan of the raw look, but a case would be another nice project to keep me busy. So check back here in another decade.


What I’ve learned about learning with Claude

  • It’s a patient tutor, not a vending machine. The most useful prompts weren’t “write me code” but “why”, and later “give me a hint, not the answer”.

  • Doing beats watching. I learned more from my few clumsy lines of code than from pages of Claude’s working ones.

  • Errors are information. Pasting the exact error back and asking what it means got me unstuck almost every time.

  • Real projects are messy. The tutorial version would have been finished sooner. The messy version taught me more.

  • It’s not always right. Claude explained, suggested, and occasionally got things wrong too. Testing everything myself mattered.


If you want to build one yourself, the code is on GitHub: github.com/phknash/pi-now-playing