Print Friendly, PDF & Email

Components Required:

1. Raspberry Pi 3 model B – Buy

2. MicroSD card 8 or 16 GB (Class 4 and above) with Raspbian

3. Windows PC / Linux PC (Tested on Windows 10, Ubuntu 14.04 LTS)

4. Micro USB cable – Buy

5. USB 2.0 Mini Microphone / USB Webcam with built-in microphone.

6. External Speaker with 3.5mm audio socket/stereo headset jack

7. Internet connection (Ethernet or WiFi)


1. OS – You are running Raspbian Jessie

2. Naming conventions:

a) Location: The location of your project files is


b) Product ID: my_device.

c) DSN: 123456

d) Passphrase: is left blank

Note: If you do not follow these conventions, you’ll need to manually update the following files and values:

a) config.js - location, product id, DSN

b) config.json - location, passphrase

Way to go ->

1. Login to your Pi using PuTTy or your Ubuntu terminal.

2. Login to your Pi GUI using VNC server (Linux / Windows).

3. Install VLC media player.

sudo apt-get install vlc-nox vlc-data

Note: If you already have VLC installed, you will have to remove two conflicting libraries by running the following commands.

sudo apt-get remove --purge vlc-plugin-notify 

sudo rm /usr/lib/vlc/plugins/codec/

Unable to fetch errors: If you run into some “Unable to fetch” errors while trying to install VLC, try the following:

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install vlc-nox vlc-data

a) Make sure VLC is installed correctly

Type the following into the terminal:

whereis vlc

This will provide you with the installation path.

Most programs are stored in /usr/bin.

vlc: /usr/bin/vlc /usr/lib/vlc /usr/share/vlc /usr/share/man/man1/vlc.1.gz

b) Set the environment variables  for VLC.

Type the following into the terminal:

export LD_LIBRARY_PATH=/usr/lib/vlc

export VLC_PLUGIN_PATH=/usr/lib/vlc/plugins

c) Check if the environment variables were set successsfully.


> /usr/lib/vlc


> /usr/lib/vlc/plugins

4. Download the sample application.

a) Register for a free Amazon Developer Account. Get a free Amazon developer account if you do not already have one.


b) Download the sample application and dependencies on your Pi. Download the sample app zip file from the Github repository.

c) Unless you downloaded the zip directly onto your Pi, copy and expand the .zip file on your Pi to




5. Download and install Node.js

sudo apt-get update && sudo apt-get upgrade

curl -sL | sudo bash - 

sudo apt-get install nodejs

6. Install NPM:

cd /home/pi/Desktop/alexa-avs-rapberry-pi-master/samples/companionService

npm install

7. Install Java Development Kit (version 8 or higher)

cd /home/pi/Desktop/alexa-avs-rapberry-pi-master/samples/javaclient


You will get a message from Oracle Java Installer that you must accept the Terms of Service for Java SE Platform. Say “Yes” to the Terms of Service.

8. Verify JDK version

java -version

javac -version

9. Make sure JDK and ALPN versions match.

Using the file manager on your Pi, navigate to


In the text editor, open pom.xml and locate <alpn-boot.version>xxx</alpn-boot.version>

Confirm the ALPN version matched your JDK version using the table located at If the versions do not match, update the pom.xml with the correct ALPN version and save.

10. Download the file apache-maven-3.3.9-bin.tar.gz from

11. Setup maven.

cd /home/pi/Downloads

sudo tar xvf apache-maven-3.3.9-bin.tar.gz -C /opt

sudo touch /etc/profile.d/

sudo nano /etc/profle.d/

In the editor (nano), add the following to and save it

export M2_HOME=/opt/apache-maven-3.3.9

export PATH=$PATH:$M2_HOME/bin

Logout of the Pi and login. Check maven:

mvn -version

12. Generate self-signed certificates.

sudo apt-get install openssl

whereis ssl

cd /home/pi/Desktop/alexa-avs-rapsberry-pi-master/samples/javaclient


Enter the following information exactly, when prompted.

product ID: my_device

serial number (DSN): 123456

password: press Enter to leave to blank

password: press Enter to leave to blank

Getting started with Alexa Voice Service (AVS)

13. Login to Amazon Developer Portal.

14. Click on Apps & Services tab -> Alexa -> Alexa Voice Service -> Get Started
















Update the config files

15. Login to Pi via VNC and open config.js

nano /home/pi/Desktop/alexa-avs-rasspberry-pi-master/samples/companionService/config.js

16. Edit the following values and save.



17. Run the server via VNC (make sure you’re logged into your Pi via VNC)

cd /home/pi/Desktop/alexa-avs-raspberry-pi-master/samples/companionService

npm start

18. Start the client via VNC (make sure you’re logged into your Pi via VNC). In a new terminal window:

cd /home/pi/Desktop/alexa-avs-raspberry-pi-master/samples/javaclient

19. Build the app.

mvn install

There will be a “BUILD SUCCESS” message in the terminal.


20. Run the client app, by typing: 

mvn exec:exec

21. When the client is run there is a pop up message.

Copy/paste the url in your web browser in the Pi.


Note: Due to the use of a self-signed certificate, there may be a warning about an insecure website. This is expected. It is safe to ignore this warning during testing.

22. Enter your Amazon credentials.




23. After device tokens ready, return to the java application and click OK.


24. Click Start Listening, and wait for the audio cue before speaking. It may take a second or before you hear the audio cue.


25. Click Stop Listening, when you are done speaking.