I have already raved in earlier posts about mymedia for alexa (which allows you to play your own music on the Amazon echo series rather than using one of the common music streaming services).
This skill requires a little help in the form of a piece of software that runs on a PC. However, it can also run on a raspberry PI.
This tutorial assumes that you have some familiarity with the raspberry pi (but lets see how it goes).
Stage 1 – Install the OS on a raspberry PI.
(1) For this we need to download an OS which we will install on the raspberry pi.
Download the image file and remember where you saved it as we will need it in a moment.
(2) Then download Win32diskimager which is the tool we will use to write the OS onto the microsd card.
Install win32diskimager to your PC.
(3) Ensure you do not have any external hard drives or USB sticks plugged into your PC. This will minimise the chances of writing the OS to the wrong drive and destroying your meda on that device.
(4) Run Win32DiskImager, select the raspberry pi file you downloaded.
(5) Make sure the device shown in Win32diskimager matches the SDCARD devices in your PC – This is your last chance to ensure its set correctly because if its not, you will destroy whatever is written on that device.
(6) Select Write on the Win32diskimager application to write the OS to the SDCARD.
(7) Once its finished writing, you can remove the sdcard, pop it into the raspberry pi. For the moment, life will be easier if you boot the raspberry pi on a wired network and you can always setup wifi later.
Stage 2 – Setup Raspberry PI
(1) Boot the raspberry pi with the newly installed scard. Wait until it resizes the partition and boots upto to the main screen.
My pictures are a little blurry but you get the drift.
(2) If using wifi, setup the wifi by the icon on the top right that looks like 2 red x’s.
(3) Now lets change our raspberry pi preferences by selecting the raspberry as the top left off the screen
(4) Lets ensure that the hostname is changed to something a little for useful like mymedia alexa. Then ensure network at boot is ticket (because we want to ensure the network is up before later potentially mounting our NAS drive or wheverever the music is located).
(5) Ensure ssh is enabled on the interfaces screen.
(6) Press OK and the Raspberry PI will reboot with the new settings.
(7). Once the raspberry pi has rebooted, everything else can be done from the command line. The first thing we will do is change the default pi password. At this point you can either do it from the console or once you have ssh’d into the raspberry pi. I will cover this in the next step.
Stage 3 – Installing MyMedia Alexa Software.
For this stage, Im assuming that you are going to connect to the raspberry pi via SSH if its on your network. We first need to figure out the IP address of the raspberry PI. I use. I use a tool like AngryIP scanner to see what IP address I need to connect to.
Putty is normally the tool I use to connect.
Assuming, you can connect, you login with the username pi and the password is raspberry (if you did not change it earlier). To change it now, type password. it will ask you for your current password and then the new once (twice).
we are now ready to install the mymedia software.
Stage 3 – Installing the mymedia software
(1) execute the following commands:
(2) Execute the following command:
sudo apt-get install ./mymedia_18.104.22.168-1_armhf.deb
The software is now installed.
Stage 4 – Accessing your music.
The instructions for this step depend upon whether your music is on a hard drive that you will plug directly into the raspberry PI or on a NAS drive that needs to be mounted on the PI. If its on a directly connected hard drive then you can skip the rest of this stage and move to stage 5.
(1) We we need to mount the NAS drive with the music on the raspberry pi. In my case Im running FREENAS and I know that my is setup under a share called share1 and the music is in a folder called music/MP320
sudo nano /etc/fstab
and add the following line.
//FREENAS/share1/music/MP320 /home/pi/media cifs username=guest,password=NULL,workgroup=WORKGROUP,users,auto,user_xattr 0 0
press control_x to save.
(2) execute sudo mount -a
(3) execute df
You should now see your share mounted on /home/pi/media
Now we need to ensure that this happens every time the pi restarts, so execute the following commands to reboot the pi and ensure the mount is still in place after the reboot
and then logon to the raspberry pi again and make sure you can still see the mount.
Stage 6 – Configuring mymedia for alexa.
Obviously, you have followed all of my earlier posts about ensuring your music is properly tagged and has album art (although we wont need the album art in this case). This work will now pay off because it will allow you to issue a wide variety of commands to your echo, relating to music.
The following instructions are taken directly from the mymediaalaexa website and are common to both the windows or raspberry pi install.
- On your normal computer, open your favourite browser and navigate to http://%5Bipaddress_of_pi%5D:52051 (the URL given in the step before)
- Use the My Media Web Console to complete installation
Now please follow the next set of instructions to finish configuration.
Configuring My Media for Alexa
- Ensure the My Media Web Console is open (the last step of each installation method above), and then click the ‘Next’ button on the Welcome screen:
- You now need to link your My Media for Alexa install with the Amazon account you use with your Echo device. Enter your Amazon Email address and password when prompted:
- Once paired, you will be returned to the My Media Web Console. You’ll be asked if you want to download sample media – you can say Yes or No:
- The next step is to add your media, click the ‘Watch Folders’ menu option on the left hand side of the Console:
- Click ‘Add Folder’:
- Navigate the folder structure on your device to find the media, for example /home/pi/media. This can also be a NAS location if you have mounted your NAS drive:
- My Media for Alexa will index your media and show that it is now ready for Serving to Alexa:
- You should now be able to see your media in the various views of the My Media Web Console, eg the Album view:
- Now try playing your music by saying for example, “Alexa, open My Media” or click here to see the other commands you can use.
Stage 7 – Play That Funky Music
Try the following commands:
Alexa, open mymedia (it should start to play music from your media collection)
Alexa, ask mymedia to play the album (albumname)
Alexa, ask mymedia to place (artistname)
Alexa, ask mymedia to play (genre) (jazz,acoustic,etc) music
You now ave a working mymedia setup without the need to have your PC on permanently.