by

Spotify Free On Raspberry Pi

Spotify Free On Raspberry Pi Average ratng: 5,6/10 3953 votes

This tutorial will guide you through all the steps necessary to stream Spotifyto your Pi, using Mopidy,Mopidy-Spotify, and theIris web interface. The endresult will be a streaming Spotify box that you can control remotely fromanother computer in your house or from your phone (Android or iOS) or tablet.

We've put together a neat little one-line-installer to make this whole processreally easy, but we'll also explain what it does later, because you wouldn'tbe learning otherwise, huh?

  1. Apr 02, 2019 Reboot the Pi for the modules to reload. “Setting Up” Spotify. No additional configuration is required on the spotify clients. Simply open the desktop application and look for the devices icon on the bottom right corner. Click it and select the spotipi. The mobile app will show “Devices Available” on the bottom of the playback screen.
  2. It is also worth noting that with ExaGear Desktop you can run other x86 apps on Raspberry Pi and other ARM-based devices such as Odroid, Banana Pi, Beagleboard, Cubox, Jetson, Cubieboard etc. Please note that running Spotify on Raspberry Pi 1 and Raspberry Pi Zero is not possible because of lack of NEON support in the hardware of these devices.

It will work either with the built-in 3.5mm stereo jack on your Pi model B+, 2,or 3, or with our audio boards -pHAT BEAT,pHAT DAC, orSpeaker pHAT. It'salso perfect for thePirate Radio Kit,turning it into a neat little streaming audio box.

Here’s how to listen to Spotify on the Raspberry Pi. How to listen to Spotify on the Raspberry Pi. For this project, you’ll need a Raspberry Pi and all of the basic peripherals: a screen, a keyboard, a mouse, a power supply, and a microSD card. You’ll also need a computer with an SD card slot. Step 5 Transfer converted Spotify music to Raspberry Pi. When the whole conversion is completed, you can locate and check the converted files on your computer and transfer them to your Raspberry Pi. And then you can freely play and enjoy Spotify Music tracks on your Raspberry Pi.

Note that you'll need a Spotify Premiumaccount for this, although you can use this setup to play local music files,like MP3s, as well.

We recommend using the very latest version of Raspbian Lite, and you'll needan internet connection to install the Mopidy packages later (we'll explain howto do that in Raspbian Lite below). We'd recommend using either the NOOBSinstaller, which you can find here(ensure that you select Raspbian Stretch Lite when installing), ordownloading Stretch Lite from hereand then using the Etcher tool to burn the image to yourSD card.

Currently, our spotipy installer is best supported by Stretch Lite, and maynot work properly in the full version of Raspbian. Because Stretch Lite is..liter (sic) it should also run a bit more snappily than the full Raspbian.

Using the Pi's built-in 3.5mm stereo jack

If you're using the built-in audio on your Pi model B+, 2, or 3, then there's noother preparation needed.

Using pHAT DAC

If you're using our pHAT DAC board, then you need to solder the 2x20 pin femaleheader (that comes with it) to your pHAT DAC (and also solder a 2x20 pin maleheader to your Pi Zero or Pi Zero W, if you're using one). We have a guide onhow to solder headers to pHATs here.

Spotify premium free with xbox game pass. Pop the pHAT DAC onto your Pi's GPIO pins.

Using pHAT BEAT or the Pirate Radio Kit

If you're using the Pirate Radio Kit and haven't already built it, then followour guide hereto learn how to put it all together.

If you're just using pHAT BEAT, then make sure that you've soldered the 2x20 pinfemale header to it. Again, you can follow ourguide to solderingpHATs. Connect a couple of speakers (or just one) to your pHAT BEAT's push fitspeaker terminals.

Pop the pHAT BEAT onto your Pi's GPIO pins, if you haven't already.

Using Speaker pHAT

If you're using Speaker pHAT, then follow our guide to soldering ithere.

Pop the Speaker pHAT onto your Pi's GPIO pins.

Running the installer

Just to reiterate, you'll need an internet connection to run this installer.Pop the SD card into your Pi, make sure that the audio board that you're usingis attached to your Pi (on its GPIO pins) if you're using one, and then plug inthe power and boot up your Pi. Because you're using Stretch Lite, your Pi willboot straight to a terminal, but don't be scared!

You'll need to connect to Wi-Fi. To do this, you need to edit a file calledwpa_supplicant.conf. Type the following:

Use the arrow keys to move to the bottom of the file, and add the following,replacing the parts that say 'YOURSSID' and 'YOURPASSWORD' with theSSID and password for the Wi-Fi network to which you'd like to connect.

Once you've made those changes, press control and x, then y, and thenenter to save and close the file.

Now, type sudo reboot and press enter to reboot. Your Pi should now beconnected to Wi-Fi.

To run the installer, type the following:

You'll need you Spotify username and password handy for this part. The installerwill ask you to enter your username and password and will use this to configurethe Mopidy-Spotify plugin. Note that your username and password will be storedin plain text so it's a good idea, for safety's sake, to have a unique password(i.e. to make sure it isn't the same as any other passwords that you use), andthat you don't have any open, insecure ports on your local area network.

The installer will prompt you several times, and you should type y for all ofthese, with the exception of the device selection. When it prompts you to selecta device, then type the number of the device that you'd like to install. Notethat if you're using the built-in audio through the 3.5mm jack then you shouldselect option 0 here.

The installer should also ask if you'd like to reboot once the installation iscomplete. If it doesn't, then restart by typing sudo reboot again.

What the installer does

If you're not concerned with what the installer does, then stop reading thissection now! If you are, then read on! It's good to know exactly what it does incase you want to pull down our installer script and modify it for your ownpurposes (which you're very welcome to do!)

Our installer installs Mopidy, and a bunch of plugins to add functionality toit. Mopidy is a network music server, that allows you to stream music over yourlocal network or, in this case, from internet music sources like Spotify.

Here, we're using Spotify as our music source, so we're installing theMopidy-Spotify plugin, which allows you to play songs, albums, playlists, andyour own saved music on Spotify.

The Mopidy-ALSAMixer plugin allows you to control the system volume levelstraight from Mopidy, and will also allow us to hook it into our physicalbuttons on pHAT BEAT (if you're using it).

The physical buttons on pHAT-BEAT are hooked up straight to the GPIO on your Pi.There's a handy Mopidy plugin called Mopidy-TTSGPIO that lets you assignfunctions to buttons connected to GPIO pins; functions like play/pause, forward,back, volume up and down, and shutdown. Fortunately, the buttons on pHAT BEATand the front panel on Pirate Radio are labelled up with those exact functions!

As well as allowing the use of GPIO-linked buttons, this plugin also allowstext-to-speech to announce track and playlist names, and to confirm buttonpresses, amongst other things, although we don't enable this as part of theinstaller script.

Raspberry Pi Spotify Box

The Iris web front-end provides a really slick-looking interface to controlyour Pi running Mopidy. It caters specifically for Spotify, so it's set upwith menu options for playlists and latest releases, etc. If you're not usingSpotify and instead are using local music, then it might be best to look intoone of the other Mopidy web front-ends.

Our installer will also install and configure the software for your chosenmusic output device, be it pHAT DAC, pHAT BEAT, Speaker pHAT, or just the Pi'sbuilt-in audio.

As we mentioned previously, the installer adds your Spotify credentials to theMopidy configuration file (/etc/mopidy/mopidy.conf). It also enables theappropriate plugins mentioned earlier, sets up the correct functions for thebuttons on pHAT BEAT (if you're using it), and makes the Pi's IP addressvisible on your local area network, so that you can control it remotely on yourPC/Mac/phone/tablet via the web front-end.

Spotify Free On Raspberry Pi Keyboard

Lastly, it runs Mopidy as a system service, meaning that it will fire everythingup automatically when your Pi boots.

Booting for the first time, and using Mopidy

As we said, now that everything is installed and set up, Mopidy should fireitself up when your Pi boots. If your Pi rebooted after the installer ran, thenMopidy may well be running already! It takes a couple of minutes to fireeverything up, and maybe a little longer on a Pi Zero or Pi Zero W, so onceyou've plugged the power into your Pi, or rebooted it, then wait for a fewminutes before following the steps below.

You'll need to know your Pi's IP address to access the web front-end remotely.If you have a display and keyboard attached to your Pi (we'll assume you do,since you ran the installer), then type ifconfig in the terminal to find yourIP address. If this is the only Raspberry Pi on your network, and you haven'tchanged the hostname of your Pi, then you will be able to useraspberrypi.local instead of the IP address.

Open a browser window on your PC/Mac/phone/tablet and enter the following URL:

where 192.168.0.2 is the IP address of your Pi, or if you're going to useraspberrypi.local then enter:

Your browser should have loaded up the Iris web interface. It's fairly self-explanatory to navigate, but one important thing you'll have to do is to goto the settings page and log in to Spotify, to authorise it, if it's the firsttime you're using it.

Click 'log in', and it should pop up a new window to authorise Spotify. If itdoesn't, then you might need to switch off any pop-up blockers that might beactive. Now that you've authorised Spotify, you should have access to yourplaylists, and saved albums and artists, featured Spotify playlists, and more.

Because Iris is responsive, it looks really good on mobile as well, resizing andchanging context to work on smaller displays. And because it's just a regularweb front-end it will work equally well in iOS or Android.

With the Mopidy-TTSGPIO installed and active, you should be able to use thebuttons along the side of pHAT BEAT to control your music. Try them!

Taking it further

Raspberry Pi Play Music

Why not try some of the Mopidy webfront-ends, or some of theother plugins to use serviceslike Google Play Music, SoundCloud, TuneIn radio, and YouTube. Or try to add anOLED display to showtrack and artist information? You could try to make your Pi music player Twitteror Slack controlled, turning it into a collaborative music player!