- Setup Thing || 2. Create The Skill || 3. Create The Lambda Function || 4. Connect Skill To Lambda & Add IOT Permissions || 5. Webapp-Thing
The browser app at thing1.html
can be configured to point to your IOT Thing and receive updates triggered by Alexa requests.
Create a new AWS Cognito Identity Pool
- Login to the AWS Cognito console
- Click the button called "Manage Federated Identities"
- Click "Create new identity pool" such as
MyPool
- Check the box to "Enable access to unauthenticated providers"
- 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
andCognito_MyPoolUnauth_Role
.
- Once your pool is created, click on the "Sample Code" menu item
- Within your code, find the string called Identity Pool ID and record this as your IdentityPoolId.
Add permissions to users of your Identity Pool:
- Go to the AWS IAM Console
- Click
Roles
- Click on the new Unauth role, such as
Cognito_MyPoolUnauth_Role
- Click the
Attach Policy
button to add the appropriate permissions to your role - 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.
- In your favorite text editor, open the
/webapp-thing/js/aws_config.js
file. - Replace the default values with your own for:
REGION
mqttEndpoint
IdentityPoolId
- 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"
- Say: Alexa, open city browser
- Say: go to Frankfurt
- Say: go to Dublin
- 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!
- 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