We need to use the Raspbian desktop because this guide cannot be completed via SSH as there’s a web browser authentication step required, so hook up your screen, keyboard, mouse, network cable, microphone and speaker (use the 3.5mm auxiliary connector and USB to power the speaker) to your Raspberry Pi and boot up (note that Raspbian will expand the filesystem automatically and reboot the first time).
Once you’ve booted into the user prompt, enter username:
raspberry. Before we start installation of AlexaPi, we need to update Raspbian, so enter the following commands then reboot:
sudo apt-get update
sudo apt-get upgrade -y
shutdown -r now
Once Raspbian has finished rebooting you can continue below.
Now we’ll install AlexaPi on your RPi via GitHub repository. Follow the text guide below or the slideshow further below.
- Change directory to /opt
- Make sure git is installed:
1sudo apt-get install git
- Clone the AlexaPi repository:
1sudo git clone https://github.com/alexa-pi/AlexaPi.git
- Now we run the install/setup script which can take between 10 and 30 minutes to download and install:
- There are several Q&A’s the script requires answered as follows, just hit Enter to the first two questions as it will automatically detect your setup:
1234Which operating system are you using? debian [enter]Which device are you using? raspberrypi [enter]Do you want AlexaPi to run on boot? 1 - yes, use systemd (default, RECOMMENDED and awesome)Would you like to install Airplay support? n (unless you want it, then enter Y)
- The script will now download and install a heap of packages so go make yourself a cuppa coffee
- Once the script has finished installing preliminary packages, you’ll be presented with another Q&A, so insert your USB drive into your RPi, open
credentials.txt, then copy and paste each answer (you’ll need to use right-click copy/paste):
12345Enter your Device Type ID: alexapi_assistantEnter your Security Profile Description: AlexaPi Security ProfileEnter your Security Profile ID: amzn1.application.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxEnter your Client ID: amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxEnter your Client secret: a8dd0a1e3d7exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- Now we need to authorize your app with Amazon. In the code that’s generated after answering the above questions, look for the following, except replace
192.168.2.22with your RPi’s IP address:
1Ready goto http://192.168.2.22:5050
- Right-click on the URL and choose Copy URL
- Open up your RPi’s web browser, then past the URL into the address bar and hit Enter
- Once on the Amazon sign-in page, enter your Developer account email and password, then click Sign in
- You’ll be presented with a Success! message if everything went to plan. You may also have to Authorize Device before seeing the Success! message
- Connect your USB mic and speaker and turn on (use the 3.5mm AUX and USB to power the speaker) and make sure your speaker is in the AUX mode, not Bluetooth or FM modes
- Close your web browser and your Terminal window, then reboot:
1sudo shutdown -r now
- All done!
On reboot, you should hear Alexa say “Hello” (make sure your volume level on the speaker is on 8 to 10) or you can just speak “Alexa” and she’ll answer “Yes?“. I strongly recommend asking Alexa "What does Gordon Ramsay think of my dish?" and Gordon will give you a rather unflattering critique 😉
- The Seven Best Things You Can Do With an Amazon Echo (Lifehacker)
- 10 things your new Alexa-powered smart speaker can do (VentureBeat)
- The 15 coolest things you can do with your Amazon Echo (CNet)
- Thing you can do with Alexa (YouTube)
Well this project was a doozy! Took me a while to figure everything out so it works first time, but well worth the effort. It also got my 3D design skills up to scratch again after a sabbatical, as my Cocoon Create (Aldi) 3D printer was not printing very well at all, but after much research I found out how to properly level the bed and now it works like a charm 🙂
I hope you have enjoyed this guide and it all worked for you, but remember, it took me 3 attempts to get things working so if you weren’t successful, try again or comment below and I’ll help you out.