Turn Raspberry Pi into an Amazon Echo

Today virtual assistant software is gradually becoming more popular and becoming a useful friend to help us complete jobs in the office and at home easier.It is not difficult to find a virtual assistant speaker, but the interesting thing is that you can completely create your own virtual assistant device with Amazon Developer.Amazon Developer allows you to use Alexa software to turn Raspberry Pi into an Amazon Echo.

Category

  1. Materials needed
  2. Register for an Amazon Developer account
  3. Create your device on Amazon Developer
  4. Create your security profile
  5. Copy the Alexa sample application
  6. Update installation commands using credentials
  7. Run the installation commands
  8. 3 Terminal
    1. Terminal 1
    2. Terminal 2
    3. Terminal 3
  9. Trial

Materials needed

For this task, you will need:

  1. Raspberry Pi 3 or Pi 2 Model B and Micro-USB power cable
  2. Micro SD card (minimum 8 GB) - If you have not installed the operating system, there is a fairly easy to use new operating system called NOOBS.The easiest way to download NOOBS is to buy NOOBS pre-loaded SD cards.
  3. A mini microphone has a USB 2.0 port
  4. Speaker and 3.5mm audio cable
  5. USB keyboard, mouse and HDMI monitor
  6. Internet connection (Ethernet or WiFi)
  7. For the Raspberry Pi 2, to connect wireless Internet, you need to prepare additional WiFi Adapter.And the Raspberry Pi 3 has integrated Wi-Fi.

Register for an Amazon Developer account

Turn Raspberry Pi into an Amazon Echo Picture 1

If you don't have an Amazon Developer account yet, create a free account on their site.

Full dictionary of personal information needed

Turn Raspberry Pi into an Amazon Echo Picture 2 Read and accept the Application Agreement.

Turn Raspberry Pi into an Amazon Echo Picture 3

Choose whether you make money from your application or not.

Turn Raspberry Pi into an Amazon Echo Picture 4

Create your device on Amazon Developer

After registering an Amazon Developer account, create an Alexa device and a security profile.Note, pay attention to this information after you perform the installation: ProductID, ClientID and ClientSecret , because you will need these parameters in the following steps.

At the top of the screen, option menu, select Alexa Voice Service.

Turn Raspberry Pi into an Amazon Echo Picture 5

The "Welcome to Developer" screen will appear.

Turn Raspberry Pi into an Amazon Echo Picture 6

The screen first asks you about the product you are developing.

1. First, give your device a name.

Turn Raspberry Pi into an Amazon Echo Picture 7

2. Next, enter ProductID (do not have spaces or special characters)(Note you will need this information in the following steps, please note again).

Turn Raspberry Pi into an Amazon Echo Picture 8

3. Select Alexa-Enabled Device for the product category.

Turn Raspberry Pi into an Amazon Echo Picture 9

4. Alexa will need a companion application.Select Yes for this section.

Turn Raspberry Pi into an Amazon Echo Picture 10

5. Select Wireless Speakers in the options menu.

6. Enter 'Raspberry Pi Project on Github' in the description box.This is information for AVS and other users will not be able to read.

7. Earn both Touch-pay and Hands-free options .

Turn Raspberry Pi into an Amazon Echo Picture 11

8. You can now upload images to your device.

9. Select No for commercial device development and child related questions.

Turn Raspberry Pi into an Amazon Echo Picture 12

10. Click Next .

Create your security profile

On this page, you create a new LWA (Login with Amazon) security profile to identify user data and secure login information.

1. Click 'Create new profile'. Turn Raspberry Pi into an Amazon Echo Picture 13

2. Create a name for the profile.Examples are "Alexa Security Profile".

Turn Raspberry Pi into an Amazon Echo Picture 14

3. In the description entry for the profile.You can select 'Alexa Security Profile Description'.

Turn Raspberry Pi into an Amazon Echo Picture 15

4. Click Next .

5. Amazon creates a Client ID and Client Secret for you.Here are two information you will need later.So please note.

Turn Raspberry Pi into an Amazon Echo Picture 16

6. Enter the URL of Allowed origins and Allowed return.We are setting http and https addresses for this project, so enter 'http:/// localhost: 3000.'go to your 'Allowed origins' section.

7. Click Add .

8. Continue typing the address 'https: // localhost: 3000' as you typed in the box above.

Turn Raspberry Pi into an Amazon Echo Picture 17

9. Continue Click Add.

10. Do the same with the URL of Allowed return, except enter the following two URLs:

http:/// localhost: 3000 / authresponse
https: // localhost: 3000 / authresponse

11. The website will look like this before you click Finish.Make sure the URLs are displayed in a gray background after you have entered them in the corresponding boxes.

Turn Raspberry Pi into an Amazon Echo Picture 18

12. After you click Finish , this screen will appear.At this point, your project has been created and ready to go to the installation.

Turn Raspberry Pi into an Amazon Echo Picture 19

Copy the Alexa sample application

  1. Open the command input window (Terminal).

Turn Raspberry Pi into an Amazon Echo Picture 20

2. Enter the following information:

 cd Desktop 
git clone https://github.com/alexa/alexa-avs-sample-app.git

Update installation commands using credentials

Before running the installation commands, update them with the credentials provided by Amazon: ProductID, ClientID, ClientSecret.

1. In Terminal, type the following:

 cd ~ / Desktop / alexa-avs-sample-app 
nano automated_install.sh

2. When the command runs, a screen like this will appear. You use the keyboard arrow navigation keys to navigate and replace the fields for ProductID, ClientID and ClientSecret with the values ​​you have received.

Turn Raspberry Pi into an Amazon Echo Picture 21

The following change command will look like this:

 ProductID = "Your Device Name" 
ClientID = "amzn.xxxxx.xxxxxxxxx"
ClientSecret = "4e8cb14xxxxxxxxxxxxxxxxxxxxxxxxxxxxx6b4f9"

Click Ctrl + X to exit the script.Click Y and then press Enter to save your changes.

Run the installation commands

To run the script, open Terminal and enter the following commands:

 cd ~ / Desktop / alexa-avs-sample-app 
. automated_install.sh

While this script is running, you will be asked to answer some simple questions to make sure that you have completed all the necessary settings on Amazon before installing the program.

Turn Raspberry Pi into an Amazon Echo Picture 22

The installation process will take about thirty minutes.

After a successful installation, your Terminal window will look like the image below.

Turn Raspberry Pi into an Amazon Echo Picture 23

3 Terminal

You must complete three steps to run the Alexa application.Each step is run in a separate Terminal window, and you perform the steps in the correct order.

Terminal 1

This window will run a web service to authorize your application with the AVS (Alexa Voice Service).

Open Terminal and enter the following commands:

 cd ~ / Desktop / alexa-avs-sample-app / samples 
cd companionService && npm start

Note : npm is a management package for JavaScript programming language.If it is not available when you run the command, you can get it here.

When the command process finishes, a window that looks like this will appear.

Turn Raspberry Pi into an Amazon Echo Picture 24

Do not rush to close, this window needs to remain open while you proceed to the next steps.

Terminal 2

This window helps communicate with AVS.

Type the following command into another Terminal window:

 cd ~ / Desktop / alexa-avs-sample-app / samples 
javaclient cd && mvn exec: exec

Note: mvn stands for Apache Maven.If you don't have one, click here.

When you run the client, a dialog box will appear, saying: " Please register your device by . "

Select Yes .

Turn Raspberry Pi into an Amazon Echo Picture 25

For some browsers, you will receive a warning that this connection is not secure.Turn off this notification by clicking the Advance button. Then, on the next screen, click Proceed to localhost (unsafe).

Now, log into Amazon with the developer login you already have.

The next screen will require permission to use the security profile you created earlier for the device you are registering.Click OK. Turn Raspberry Pi into an Amazon Echo Picture 26

You will then be redirected to a URL starting with 'https: // localhost: 3000 / authresponse' that looks like the image below. Turn Raspberry Pi into an Amazon Echo Picture 27

Go back to the open dialog and click the OK button.Now the client can accept requests from your Alexa device.

Do not close the terminal window and the Voice Service Dialog dialog box .

Turn Raspberry Pi into an Amazon Echo Picture 28

Terminal 3

Alexa voice wake up application will be installed in this window.If you do not want to use voice to command Alexa, you can skip this step.

Open a new Terminal window and use one of the following commands to bring up the Alexa wake-up speech system using Sensory or KITT.AI.

To use the wake up speech system, enter the command:

 cd ~ / Desktop / alexa-avs-sample-app / samples 
cd wakeWordAgent / src && ./wakeWordAgent -e sensory

Trial

Awaken virtual assistant by saying 'Alexa'.After a beep appears you can start the command.For example, try by saying, 'Alexa.'Wait for a beep and ask, 'what time is it?'(What's the time?).

If Alexa answers correctly then your virtual assistant is ready for work.

See more:

  1. How to set up Alexa virtual assistant as the default assistant on Android
  2. Instructions to turn on Cortana and use this virtual assistant on Windows 10
  3. 18 useful commands you should try with Cortana
4 ★ | 1 Vote

May be interested

  • How to properly turn off the Raspberry PiHow to properly turn off the Raspberry Pi
    as you may have noticed, there is no button to enable or disable the raspberry pi. your first instinct is probably to unplug the power cord, but this is highly discouraged.
  • 3 Amazon Echo security features to use when you leave the house3 Amazon Echo security features to use when you leave the house
    alexa has built-in safety functions to help keep your home protected while you're away.
  • The echo command in WindowsThe echo command in Windows
    the echo command displays the message or turns on / off the command repeat feature. if used without parameters, the echo command will display the current echo setting.
  • 9 surprising Alexa tricks to try with your Amazon Echo tonight9 surprising Alexa tricks to try with your Amazon Echo tonight
    amazon's alexa voice assistant can recognize a can of soup and create music playlists on the fly.
  • Looking back at Amazon's 2017Looking back at Amazon's 2017
    there are many things that happened in 2017, it's hard to know where to start when looking at the tech giant's 2017s. therefore, for e-commerce companies like amazon, it is best to start with a simple statement: reduce avocado prices.
  • How to turn a Raspberry Pi into an IRC serverHow to turn a Raspberry Pi into an IRC server
    irc is one of the classic chat protocols still used by many modern online communities. today, there is no shortage of irc servers and clients available. you can also set up your own irc server with a raspberry pi.
  • Apple Music is now available on Amazon Fire TVApple Music is now available on Amazon Fire TV
    amazon said it has completed adding apple music support features to the echo smart speaker last december, allowing users to choose apple's service as their favorite source of music on the device.
  • How to turn off WiFi of Raspberry PiHow to turn off WiFi of Raspberry Pi
    there are several reasons why you might want to disable wifi on your raspberry pi. one of the reasons is to reduce system usage. although the wifi module does not consume a lot of memory and cpu, but still uses a certain amount.
  • How to turn a Raspberry Pi into a WiFi BridgeHow to turn a Raspberry Pi into a WiFi Bridge
    today, it seems that every device supports wifi, but not all devices actually have wireless internet connectivity. this is where the raspberry pi works. you can turn a raspberry pi into a wifi bridge.
  • How to turn Raspberry Pi into a personal cloud serverHow to turn Raspberry Pi into a personal cloud server
    in this tutorial, we will show you how to turn your raspberry pi into a personal cloud server. before proceeding, make sure you've booted up your pi, have a mouse and keyboard connected, and finally the raspbian operating system installed on it.