Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 2.51 KB

step-5.md

File metadata and controls

57 lines (41 loc) · 2.51 KB

Ingredients

  1. Setup Thing || 2. Create The Skill || 3. Create The Lambda Function || 4. Connect Skill To Lambda & Add IOT Permissions || 5. Webapp-Thing

Webapp Thing

The browser app at thing1.html can be configured to point to your IOT Thing and receive updates triggered by Alexa requests.

Steps

Create a new AWS Cognito Identity Pool

  1. Login to the AWS Cognito console
  2. Click the button called "Manage Federated Identities"
  3. Click "Create new identity pool" such as MyPool
  • Check the box to "Enable access to unauthenticated providers"
  1. The next page states "Your Cognito identites require access to your resources." This is fine, just click the "Allow" button to continue.
  • Two new empty IAM roles are created for you, called Cognito_MyPoolAuth_Role and Cognito_MyPoolUnauth_Role.
  1. Once your pool is created, click on the "Sample Code" menu item
  2. Within your code, find the string called Identity Pool ID and record this as your IdentityPoolId.

Add permissions to users of your Identity Pool:

  1. Go to the AWS IAM Console
  2. Click Roles
  3. Click on the new Unauth role, such as Cognito_MyPoolUnauth_Role
  4. Click the Attach Policy button to add the appropriate permissions to your role
  5. For the IOT webapp, choose AWSIoTDataAccess or define a specific set of permissions.

Prepare your web application

Be sure you are working from a local laptop repository, cloned or downloaded from github.com/alexa/alexa-cookbook.

  1. In your favorite text editor, open the /webapp-thing/js/aws_config.js file.
  2. Replace the default values with your own for:
  • REGION
  • mqttEndpoint
  • IdentityPoolId

Launch the page

  • Open the page thing1.html in Chrome or Firefox browser (within the browser, choose File, Open)
    • You can open the page right from within your project folder, you do not need to host it on a website.
  • The page should display with a green status label saying "CONNECTED"

Test your skill

  1. Say: Alexa, open city browser
  2. Say: go to Frankfurt
  3. Say: go to Dublin
  4. Say: stop

The browser page should automatically create a new child window pop-up, that points to an Image Search URL for the city you requested!

Debug

  • If there are any issues, open your browser's Debug Console and look for any Javascript errors for clues.
  • Check for any suppressed popup window within your browser's URL bar.

Back to the Home Page