via PiMyLifeUp
Using the Raspotify software package, we can set up your Raspberry Pi so that it can work as a cheap Spotify Connect device.
This is verified to work with a Raspberry Pi model 3 B+ with Raspbian Stretch on 01/20/19. It really should work with any Pi using Jessie too. The program we will use to stream music from any device to our Pi is called 'raspotify', which makes our Pi into a Spotify connect source. If you’re only interested in Spotify connect and you already have a working Raspbian, there is a very simply way to do this: Raspotify. Whit a single command line, it will install Spotify connect on your Raspberry Pi: curl -sL sh. September 14, 2017. Subscribe to new blog posts. You should now be able to use your Raspberry Pi to Stream music via Spotify Connect. Even the volume control works perfectly. To change the device name in the Spotify connect dialog, simply change the hostname with the raspi-config utility.
Working as a Spotify Connect device allows you to easily stream songs from any Spotify app to your Raspberry Pi. This setup is an affordable way of connecting any speakers to Spotify.
In addition to showing you how to install the Spotify connect software, we will walk you through some of the basic configuration options that you can specify.
While this isn’t the full Spotify, it does allow you to easily use any other device to play music from your Raspberry Pi. It also allows you to run Spotify on your Raspberry Pi in a completely headless setup.
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?
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. https://yellownutrition336.weebly.com/dl-spotify-for-mac.html. It'salso perfect for thePirate Radio Kit,turning it into a neat little streaming audio box.
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. Can you download emojis on android.
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.
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. Quickbooks for mac download. To do this, you need to edit a file called
wpa_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. Jocuri 3d download softonic for mac.
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. Legend of titan download mac. 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). Spotify history mac desktop computers.
Raspberry Pi Streaming Music Player
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.
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.
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!
Raspberry Pi Audio PlayerTaking it further
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!
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |