Skip to content

zyb90/Darwin-Gadget

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alexa Gadget Control using the SiLabs Thunderboard EFR32BG22

Objective:

This demo serves to showcase the Amazon Alexa Gadget control service over BLE using the Silicon Labs Thunderboard EFR32BG22

Registering a gadget in the Alexa Voice Service Developer Console

To create a gadget that works with your Echo device, you first need to register a new gadget in the Alexa Voice Service Developer Console.

  1. Sign in to the Alexa Voice Service Developer Console. If you don't already have a developer account, create one.

  1. If you haven't registered an AVS product in the past, click GET STARTED.

  1. Click PRODUCTS, and then click ADD NEW PRODUCT.

  1. Fill out the requested information, select Alexa Gadget as the product type, and then click FINISH.

  1. In the pop-up, click OK.
  2. You will be taken to a list of your products. Click on the gadget you just created.

  1. At the top, you'll see an Amazon ID and Alexa Gadget Secret. You'll need these for the following steps to create your Alexa Gadget. Keep this ID and Secret private because they uniquely identify your gadget.

  1. Edit "./AlexaDemo/alexa/alexa.h" located in the cloned repository.

  2. Uncomment these two lines and replace "<Device_Type>" with the Amazon ID and "<Amazon_Secret>" with the Alexa Gadget Secret.

  3. Once that is complete, compile the source and it is ready to flash to the Thunderboard.

  4. Flash the firmware to the Thunderboard and the hardware is ready.

NOTE: To learn more, refer to Register a Gadget in the Alexa Gadgets Toolkit documentation.

Create your Lambda function

  1. Sign in to the AWS Management Console and open the AWS Lambda Console.

  1. Make sure the Region on the top right corner is set to N. Virginia.
  2. Click Create function, leave Author from scratch selected, and name the function whatever you like.

  1. Select Runtime as Python 3.6.

  2. For Permissions, if you don't already have a role that allows for basic Lambda execution, follow Defining a New Role for the Function to create a new role from a template.

  3. Click on Create function.

  1. Under the "Function code" block, click the Actions drop down and select Upload a .zip file.

  1. Press the UPLOAD button in the popup window and browse to the zip "Darwin-Demo.zip" located in the the cloned repo, and click upload.

Note: This zip file contains the skill code, "lambda_function.py", as well as the ASK Python SDK dependencies needed by the skill code.

Create your skill

  1. Sign in to the Alexa Skills Kit Developer Console and click Create Skill.

  1. Enter Skill name as Darwin Demo. Leave the Choose a model to add to your skill to Custom, and Choose a method to host your skill's backend resources to Provision your own.
  2. Click on Create skill on the top right corner of the screen.

  1. On the Choose a template screen, choose Hello World Skill and click on the Choose button on the top right corner of the screen.

  1. The skill is created. Now, click on JSON Editor in the left pane.

  1. Add utterance samples for Amazon.YesIntent and Amazon.NoIntent as follows: Note: This sample assumes that the skill is a US-based skill.

    {
        "name": "AMAZON.YesIntent",
        "samples": [
            "yes",
            "yes please",
            "sure"
        ]
    },
    {
        "name": "AMAZON.NoIntent",
        "samples": [
            "no",
            "no thanks"
        ]
    },
  2. Click on Save Model on the top.

  1. On the left, click Endpoint.

  1. Select AWS Lambda ARN.

  1. Copy the skill ID.

  1. Switch back to your Lambda function in the AWS Lambda Console.

  1. Select "Darwin Demo"

Click on "+ Add trigger"

  1. Select "Alexa Skills Kit"
  2. Paste the Skill ID you just copied into the field "Skill ID"
  3. Then Click Add

  1. At the top of the screen, copy the ARN.

  1. Return to editing your skill in the Alexa Skills Kit Developer Console.
  2. Within the Endpoint section, paste in the Lambda ARN from the function that you created, in the Default Region field under AWS Lambda ARN, and then click Save Endpoints.

  1. On the left, select Interfaces and turn on the toggle for Custom Interface Controller to enable the skill to use Custom Interfaces.

  1. Then, click on Save Interfaces at the top of the screen.

  1. On the left, select Invocation. Then, at the top of the screen, click Build Model.

  1. It will take a few seconds to build the model. A Build Successful message will be posted on the bottom right of the screen once the model is built successfully.

  1. Select Test from the top of the menu bar.
  2. Click the drop down menu and change the "Skill testing is enabled in" and change to "Development".
  3. Using the Alexa App, Pair the new Gadget to the Amazon echo compatible device.
  4. Select devices > Device > Pair Gadget
  5. The advertisement is "Alexa Demo"
  6. Once Paired, say "Alexa, Open Darwin Demo"

About

Amazon Gadget Demo (Thunderboard EFR32BG22)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 90.0%
  • C++ 9.5%
  • Other 0.5%