HomeRaspberry PiStreaming your own music on Amazon Echo for free

Streaming your own music on Amazon Echo for free

Alexa, tell Plex I want to stream my music!

Google Home Mini has been my default smart speaker for streaming music, as the sound was decent, and Google made streaming your own tracks extremely easy. Just sync the files with your Google Play Music and you are good to go. I wouldn’t look for other solutions if not for Amazon Echo Dot (3rd gen). This Amazon offering simply blows the Google Home Mini out of the water music-wise. It was time I do something about my private music collection.

Stream music on Amazon Echo

Amazon Prime Music subscription previously had support for uploading your own tracks to the cloud, however, the option has been available only for premium subscribers and it won’t be supported for much longer. I had to look for other solutions if I wanted to take advantage of the much nicer sound of the Echo Dot device.

Some time ago, I made a NAS-pi – Plex-enabled network drive which stores my files, and streams videos. Plex isn’t something that is immediately associated with music streaming, but it comes with full voice controls for music search and playback. While building the entire 3HDD NAS box is excessive, a Raspberry Pi board loaded with Plex and a USB stick would be sufficient to actually hold your music collection and not to break the bank in the process.

I have tested the following boards to see what would be the cheapest but reliable option:

  • Raspberry Pi 3B ($32) (Ethernet + WiFi)
  • Raspberry Pi 3A+ ($22) (WiFi)

I have tried to use Raspberry Pi Zero series, however, the armv6x is no longer supported and as such these boards cannot be used for Plex services. This is a shame as Raspberry Pi Zero would be a perfect board to stream audio files only.

I’m going to use Raspberry Pi 3A+ because it’s cheaper. It comes with a single USB socket and the onboard WiFi is fast enough to deliver audio content while not limiting me to a single location. USB drives can be picked up for about $10 off the Amazon, so the entire setup will cost you about $30 providing you have a spare USB charger to use.

If you are interested in making it look as nice as my MusicPi – the process of modding the Raspberry Pi 3A+ and building enclosure will be posted soon.

Plex on Raspberry Pi

Grab a fresh Raspbian image and connect to the Raspberry Pi. If you are not sure how here is a tutorial for you.

Update the board using the commands:

sudo apt-get update
sudo apt-get upgrade

Then add dev2dat repo so we could install plex:

wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add -
and
echo "deb https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list

Then update the package list running:

sudo apt-get update

Now, you are ready to install plex:

sudo apt-get install -t jessie plexmediaserver

Once done, change the plex user to “pi” by changing the line in the file

sudo nano /etc/default/plexmediaserver.prev

to

PLEX_MEDIA_SERVER_USER=pi

Close the file (Ctrl+X and Y) and reboot the Raspberry Pi. I would also advise you to set the static IP, so you could connect to the correct IP each time. I have the complete tutorial showing you how to do it here.

Before you can add the files, you need to mount the drive. Run

sudo fdisk -l

and look for your USB Drive – then mount it as

sudo mount /dev/sda1 /home/pi/Music

if you just put the folders with your music in the root directory of the USB stick. If your drive failed to mount after the reboot, use crontab to force mount it after restart:

sudo crontab -e

and add the line:

@reboot sudo mount /dev/sda1 /home/pi/Music &

Now when you open in your web browser (check the IP with ifconfig):

http://192.168.xxx.xxx:32400/web

The Plex interface will open and you can configure and add your music libraries.

Make Amazon Echo play your stuff

Open the Alexa app and add Plex skill to the list of skills. You will be asked to log in with your credentials. When the skill is enabled ask Alexa:

Alexa, ask Plex to set server?

And you are ready to stream music! Below, a list of the most popular Plex voice actions:

Plex Skill Music Voice Actions

Library Radio

Play popular tracks from artists spanning across the entire library.

  • Play some music
  • Play library radio
  • Play Soundtracks library radio (e.g. “Play [library name] library radio”)

Time Travel Radio

Time Travel Radio starts with some of the earliest released music in the library and works forward, providing you with a whirlwind, genre-bending trip through the history of your music.

  • Play time travel radio
  • Play Soundtracks time travel radio (e.g. “Play [library name] time travel radio”)

Artist Radio

Kick off an Artist Radio from your favourite artist and you’ll enjoy music from other similar artists. As the station progresses, it explores more corners of your library, inspired by your starting artist.

  • Play Lana Del Ray radio (e.g. “Play [artist name] radio”)

By Artist

  • Put on music by Bob Marley
  • Play music by Adele
  • Let's hear music by Elton John
  • Shuffle music by Pink Floyd
  • Shuffle Queen
  • Play music by The Pet Shop Boys
  • Play the artist Rihanna
  • I want to hear songs by Avicii

By Album

  • Play the album Thriller
  • Shuffle the album Thriller
  • Put on the album Nevermind
  • I want to hear the album Dark Sky Paradise
  • Start the record Illuminate
  • Let's hear the album Come Away With Me

By Song

  • Play the track Come As You Are
  • Put on the track Billie Jean
  • Play the song Pour It Up
  • Put on the song Holy Grail
  • Let's listen the song Mercy

Playlists

  • Play the playlist Christmas Movies
  • Shuffle the playlist Party Music

Adding more music

Preloading all the music on the USB stick makes sense as the Raspberry Pi network isn’t the fastest. You can also add the files via SFTP using Filezilla or similar software. Use the same credentials as you would with SSH to upload more music to the USB drive without removing it from the Raspberry Pi.

Alternatively…

Treat yourself to a full-size NAS which is perfect for video streaming (1080p), file storage, music streaming and RAID redundancy.

Conclusion

For about $35 (depending on the USB stick size) you could enable your Amazon Echo to stream the local files instead. The system works great if you don’t mind the “ask Plex” prefix. If you want to play video files at the same time, you probably want to upgrade to the Raspberry Pi 3B series to get the dedicated Ethernet and more USB ports for your drives.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

M5Paper

Programable, ESP32 based awesome dev platform with 4.7 e-ink display by M5Stack

More HATs

client-image
client-image

Argon One M.2

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO and M.2 SSD support

More cases on

client-image
client-image

Best Raspberry Pi Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

Slow Internet Warning

0
From time to time my Internet grinds to a stop. Since Raspberry Pi 4 comes with a 1Gbps Ethernet, I decided to take advantage of it and create a reporting system in NodeRED that will monitor and report when the ISP is not keeping the contractual agreements. Works with Alexa, Google Home, Android and Windows 10.

How fast Raspberry Pi NAS is?

0
Let's see how fast Raspberry Pi NAS really is?

Argon18: Argon ONE SSD modification

0
Argon One case just got better - now you can boot it from USB without ruining the design thanks to Argon 18: Argon One SSD modification

HOW TO...

It took me 2 months to boot CM4 from NVMe

0
Complete beginners guide to Compute Module 4 boot from NVMe.

Raspberry Pi Zero 2 W vs other Zero boards

0
It's time to test the Raspberry Pi Zero 2 W against other Raspberry Pi boards from Zero series: power, WiFi, temperature and core performance

C/C++ and MicroPython SDK for Raspberry Pi Pico on Windows

0
A guide to SDK toolchain for Raspberry Pi Pico and C/C++ , Micropython on Windows.

A comprehensive guide to Grafana & InfluxDB

0
How to use Grafana and InfluxDB on Raspberry Pi for IoT sensors in home automation

How to boot Raspberry Pi 4 from USB

0
How to set up and boot Raspberry Pi 4 from USB drive - headless guide.