Setting Up Alexa on Rpi
By: Naeem Hadiq
Tags: Guides And Tutorials, Alexa, Raspberry Pi, DIY, Alexa Voice Service

Run the Install Script

You are now ready to run the install script. This will install all dependencies, including the Wake Word Engine (WWE) from Sensory. The WWE compares incoming audio to an onboard model of a wake word (“Alexa”) and will initiate the transmission of audio to the cloud when triggered. Note that this WWE is provided for prototyping purposes only and would need to be licensed for a commercial device. The AVS Device SDK is modular and flexible. When you’re ready to build your product, you can choose any WWE you prefer. Remember that for AVS products, the wake word must be Alexa so that your customers aren’t confused about how to interact with your device.

To run the install script, open a terminal by clicking on the console window in the Pi’s toolbar in the upper-left corner of the screen (or just use your existing terminal window). Copy and paste the following command into your terminal window and hit return to upgrade apt-get.

sudo apt-get upgrade

Now, let’s get the SDK installation and configuration scripts. Copy and paste the following into your terminal and hit return:



wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/genConfig.sh \

wget wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/setup.sh \wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/genConfig.sh \wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/pi.sh

Download your credentials

If you didn’t already save it to your Pi when creating your product profile, it’s time to get your config.json file onto your client device. Start by opening a browser and logging into your AVS dashboard Click on your Product Name, it should be AVS Tutorials Project or whatever you named it when creating the product profile.

on the left side you should see Product Details. Select Security Profile below that and choose Other devices and platforms from the Web — Android/Kindle — iOS — Other devices and platforms menu. When you click the Download button on your Security Profile in your web browser, you’ll see a config.json file appear in your home/pi/downloads folder. In the file manager, copy this file from the /downloads folder and place it in your home/pi folder

Build the AVS Device SDK

To run the install script, open a terminal by clicking on the console window in the Pi’s toolbar in the upper-left corner of the screen (or just use your existing terminal window). You should see a setup.sh script in your /home/pi/ directory. This pulls the credentials from your config.json file to run the install script. To launch the setup script, copy and paste the following command into your terminal window and hit return:

cd /home/pi/

sudo bash setup.sh config.json [-s 1234]

Note that the field in double brackets is the Device Serial Number which will be unique to each instance of the SDK. In this case it’s pre-populated with 1234.

Type “AGREE” when it prompts you to accept the licensing terms from our third-party libraries. Unless, of course, you disagree!

This will kick off the installation process which could normally take over 20 minutes, but for reInvent we’ve precompiled the image to save you some time.

Once you’ve finished compiling, you should see a success screen. If your device freezes up — don’t worry, just restart by unplugging your Pi’s power cord. When you get back to your desktop, re-run the above setup.sh command to finish your install.

Now you just need to launch the sample app and get a refresh token from AVS so your device can authenticate with the cloud via Login With Amazon (LWA).