OpenWrt NetSoM users guide. Using as Amazon Alexa development kit.

Here described steps to use as NetSoM development board as Alexa development kit and run Alexa Sample App.

Hardware requirements.

You have to stick WM8960 audio module to NetSoM development board. This setup will act as SIP client allowing to make a voice calls to/from another devices in network

Software requirements.

You have to use amazon_voice_service or amazon_voice_service_wifi images. Steps to update NetSoM firmware described here.

 

Amazon Voice Service product registration.

In order to work with avs-device-sdk you need to compile one variant of amazon-voice-servce firmware. While doing this you need to register on main Amazon Developer portal in order to add device in their system. After firmware is flashed on board you’ll need to initiate SampleAPP or your application with proper configuration and proceed with standard steps of Authorization.

By default this firmware provides SampleAPP and all necessary libraries from avs-device-sdk. Configuration in firmware is stored in /etc/alexa/ directory.

All of this is described in next chapters.

 

Register device and profile.

This is part of official documentation from Amazon Developer site – Prototyping – Register a product.

  • Create an Amazon developer account

Create a free developer account at developer.amazon.com. If you already have an account, you can skip this step.

  • Create a product.

After you’ve created an Amazon developer account, you create a product and security profile. This authenticates your software client so it can connect to AVS.

To create a product:

  1. Log in to the AVS dashboard.
  2. Click PRODUCTS.
  3. Click ADD NEW PRODUCT.
  • Fill in product information

You now must fill in your product information. This information identifies your device with AVS.

To fill in your product information:

  1. Choose a Product Name. For example, AVS Tutorials Project.
  2. Choose a Product ID. For example, PrototypeIMX6ULL.

Don’t use any spaces in your product name.

  1. In the Please Select Your Product Type dropdown, select Device with Alexa built-in.
  2. For Will your device use a companion app?, choose No.
  3. In the Product Category dropdown, select Other (please specify).
  4. Write a meaningful description in the Brief product description box. For example, Prototype.
  5. Under How will users interact with your product?, select Hands-free.
  6. Skip the Upload an image step. This isn’t required for prototyping.
  7. Under Do you intend to distribute this product commercially?, select No.
  8. Under Will your device be used for Alexa for Business?, select No.
  9. Under Is this device associated with one or more AWS IoT Core Accounts?, select No.
  10. Under Is this a children’s product or is it otherwise directed to children younger than 13 years old?, Select No.
  11. Click NEXT.
  • Set up your AVS security profile.

A login with Amazon (LWA) security profile associates your security credentials with your product.

To set up your security profile:

  1. Click CREATE NEW PROFILE.
  2. Under Security Profile Name, enter a relevant name. For example, AVS Tutorials Project.
  3. Under Security Profile Description, enter a relevant description. For example, AVS Tutorials
  4. Click NEXT. Your Security Profile ID generates.
  5. Select the Other devices and platforms tab.
  6. Under Client ID name, enter a relevant name. For example, Prototype.
  7. Click Generate ID.
  8. Click Download. This downloads your config.json file that contains your AVS credentials. Save the file to your home directory directory. This file will be needed in next chapter.
  9. Read the Amazon terms and conditions. If you agree, check the I agree to the AVS agreement and the AVS Program Requirements box.
  10. Click FINISH. Congratulations! You now have access to AVS.
  11. A pop-up appears. Click OK. You can now view your device on your AVS dashboard.

The following screenshots highlight the important steps described in the previous section.

Alexa development kit

 

Alexa development kit

Configuration of Amazon Voice Service in Firmware.

When firmware is compiled and flashed on board you’ll need clientID and productID from previously downloaded from AVS dashboard config.json file. You need to copy them into /etc/alexa/AlexaClientSDKConfig.json file in section deviceInfo. Also you’ll need to fill deviceSerialNumbermanufacturerName and description with your information in that file.

Be aware, that ‘clientIDandproductID` is generated by AVS and used for authorization.

For example, section of AlexaClientSDKConfig.json will be:

“deviceInfo”:{
// Unique device serial number. e.g. 123456
“deviceSerialNumber”:”123456″,
// The Client ID of the Product from developer.amazon.com
“clientId”:”at5544″,
// Product ID from developer.amazon.com
“productId”:”amzn1.application-oa2-client.ec4582853953483a89fdade69f066cb18″,
// The name of the device manufacturer.
“manufacturerName”: “Temp”,
// The description of the device which should contain the manufacturer name or how the device is connected.
“description”: “Temporary test device for compatibility checks.”
},

 

First run and test.

On first run SampleApp will ask you to enter PIN on AVS website. To run SampleApp in firmware type in console:

# SampleApp /etc/alexa/AlexaClientSDKConfig.json

On first run you’ll see message like this:

##################################
#                NOT YET AUTHORIZED                       #
##################################
################################################################################################
#                                To authorize, browse to: ‘https://amazon.com/us/code’ and enter the code: {XXXX}                                                       #
################################################################################################

You’ll need to login to AVS and input XXXX code. After this SampleApp will automatically switch to Authorized state and you can test AVS.
SampleApp does not support keyword/hotword activation, so you’ll need to activate service manually. To do this just type t and Enter, after that Alexa will switch to Listening state and you can say “Tell me a joke” or “Pick a number between zero and ten” in microphone. In first case Alexa will tell you joke, in second it’ll say random number between 0 and 10. To exit application use Ctrl+C combination.

 

Coming soon at CrowdSupply!