Introduction
Step 3: Get weather information
Step 4 : Send weather information to Android Device
Step 5 : Build for Android Device
Read moreWith this skill, kids can ask Amazon Alexa the current weather. The result will display on BBC micro:bit LEDs. This is a sample that connects Amazon Alexa and BBC micro:bit.
Application Id: amzn1.ask.skill.3d69813d-d47b-4cf7-8e79-af25b589b8f6
Step 1 : Make Amazon Alexa Skill (Amazon Alexa herself. )- Go to https://developer.amazon.com/edw/home.html#/skills/list and click "
Add a New Skill
".
- Select Skill Type:
Custom Interaction Model
, and inputName
andInvocation Name
, ClickNext
.
- Input Intent Schema and Sample Utterances, and click
Next
.
- Input AWS Lambda ARN (See Step 2 : Make AWS Lambda), click
Next
- Then you can test the skill, if you finish
Publishing Information
andPrivacy & Compliance
, you cansubmit for Certification
.
- Go to https://console.aws.amazon.com/lambda/home?region=us-east-1#/functions?display=list ,and click
Create a Lambda function
- Select
Blank Function
- Select
Alexa Skills Kit
, and clickNext
- Input
Name
, and copy the lambda source to the source area, and input the other fields, clickNext
- In the next screen, click
Create function
.
- Then you will see ARN, fill the arn to Step 1's arn field.
- Go to http://openweathermap.org, and sign up a account, and you can find API key at your member page. Replace your app id by the key.
- Go to https://console.aws.amazon.com/sns/v2/home?region=us-east-1#/applications, click
Create platform application
- Input
Application name,
selectPush notification platform
toGoogle Cloud Messaging(GCM)
, inputAPI key
(You can get this key from firebase. See Step 5 : build for Android Device), clickCreate platform application
- Now you can find the ARN, replace android source by this arn (if necessary, modify Region field to your region).
- Go to https://console.aws.amazon.com/sns/v2/home?region=us-east-1#/topics , click
Create new topic
- Input
Topic name
andDisplay name
, then clickCreate topic
.
- You can find topic ARN, and replace lambda source and android source. (if necessary, modify Region field to your region).
- Go to https://console.aws.amazon.com/cognito/federated/?region=us-east-1 ,click
Create new identity pool
.
- Input
Identity pool name
and checkEnable access to unauthenticated identities
.clickCreate Pool
.
- In the next screen click
Allow
.
- You will find the cognito ARN, and replace android source by this arn (if necessary, modify Region field to your region).
- Go to https://console.aws.amazon.com/iam/home?region=us-east-1#/roles , select your cognito role name such as Cognito_xxxxxUnauth_Role.
- Click
Edit Policy
- Add SNS permission such as below picture.
- Go to https://firebase.google.com ,you can
Create new project
,and you can findServer key
onSettings
'CLOUD MESSAGING
tab. Fill this information to Step 4 : Send weather information to Android Device.
- Get the android source from https://github.com/tbchen/microbit-meets-alexa/tree/master/android
- Create firebase android app ,then download the google-services.json file from your firebase console, replace android source file.
- Use Android Studio import downloaded project, modify the arn information and firebase information, build app to android device.
- Go to https://pxt.microbit.org, add Bluetooth support, then click
JavaScript
, replace the source by micro:bit source.
- When you back to
Blocks
, you will see like below picture.
- Transfer this program to micro:bit. and DONE!
Thanks to microbit-foundation.
Comments