A few days ago, I described my Trek through Raspberry Pi and Wifi configs (including APs). Today, I want to talk about a possible use for such a setup.
At first I wanted to use it to compile my apps, and serve them. Note, I’m using WebPack to compile my app, with a lot of plugins on the way. I thought my Pi would be strong enough to do that, even at a slower pace, but after 10 minutes of waiting for webpack to boot, I gave up. Ironically, as per Murphy’s laws, as soon as I disconnected the Pi from a power source I saw that it finally made the initial compile. It wouldn’t have been efficient anyway.
My second idea then was to make it a remote Spotify client. I didn’t want much from it: just a command line interface so I could pick / skip a song, volume control was optional.
Full process supplied below:
The first thing I found that would match my criteria was Despotify. It’s supposed to be a simple CLI version of Spotify that would work with Spotify premium accounts. Turns out, it’s not working that well.
First off, I used this guide to set things up (and I do recommend following up if you intend to try it out yourself), but ended up changing a few things.
For instance, at Part One - Step 2 that command no longer works. Here’s how to fix it:
and the cloning will work. Secondly, the build-script needed a change for my setup (might not apply to all). To use my fix, edit
and edit line
and that will get rid of the installation problems you might have later on. This has, however made my installation not work at all. The simple util will crash on any attempt, and the GUI (-ish) one will not even make a single search. Perhaps I did something wrong (like lpthread being crucial and me being an idiot for not making sure it exists and just ignoring it).
Mopidy is a nice wrapper over MPD, which (as linked above) is a media server of sorts. Mopidy will allow you to stream Spotify from a local server. I followed their installation and configuration guides, especially those with regards to the raspberry pi. Something that was not very clear from the instructions is that you actually need to install the Spotify Extension and a UI / client for it to work properly. I used the extension, Mopify web client and ncmpcpp as a gui client. Both kind of work the same, but different at the same time. Mopify can access the Songs library, and generally works better, while ncmpcpp works without http and can only access playlists. Both, however, work just fine with next/previous/play/pause. Here are the steps to get these started:
From here, just some configuration is needed. Here is mine, for comparison:
At this point, I could access the web client (mopify) by going to:
and use the GUI there, or ssh into the Pi and use ncmpcpp:
It is a very slow process especially if you have a large library like mine. More often than not it’s a long wait until a song starts, but the streaming is good, and the quality is at least decent. Hope this helps someone.