Giter Site home page Giter Site logo

alexa-ai-iot-sample's Introduction

Alexa AI IoT Sample

Sample code for using Alexa with an IoT thing and managed AI services.

About

Using the sample code you can connect an ESP32-CAM device to AWS IoT Core and have it take pictures on-demand and store them in Amazon S3 using Alexa. You can then have Alexa analyze the image using Amazon Rekognition.

Alexa AI IoT Architecture

1. Setup IoT thing

  1. Open device subfolder in VS Code and install PlatformIO extension.
  2. Create your device using the Creating AWS IoT things wizard in AWS Console (or using cli for power users). Take note of the thing name and download the certificates and CA certificate.
  3. Create a policy using the AWS Console or cli. See policy.json.template for needed policies.
  4. Create lib/conf/conf.h based on lib/conf/conf.h.template. Update WIFI_SSID, WIFI_PASSWORD, DEVICE_NAME, AWS_IOT_SUB_TOPIC, AWS_IOT_PUB_TOPIC, AWS_IOT_ENDPOINT and the three certificates.
  5. Flash your device. Keep an eye on the serial output to see that all goes well.

Read Nathan Glover's blog post for more information: https://devopstar.com/2020/05/16/aws-iot-esp32-cam-setup

2. Create a new Alexa skill

  1. Click Create skill in Alexa developer console and give it a name.
  2. Select Custom model and Provision your own backend.
  3. Add AnalyzePictureIntent and TakePictureIntent.
  4. Go to Assets > Endpoint and take note of Your Skill ID to use later.

Read more in the Alexa documentation: https://developer.amazon.com/en-US/docs/alexa/devconsole/create-a-skill-and-choose-the-interaction-model.html

3. Setup backend using AWS SAM and connect to Alexa skill

  1. Open backend subfolder in VS Code.
  2. Build using AWS SAM.
sam build
  1. Deploy using AWS SAM guided.
sam deploy --guided
  1. Enter values for AlexaSkillId, IotEndpoint, IotTopicPub, IotTopicSub, and ObjectName.
  2. Take note of AlexaSkillFunctionARN in the SAM output.
  3. Go to Assets > Endpoint in the Alexa developer console and enter AlexaSkillFunctionARN in Default Region. Click Save Endpoints.

Questions

Reach out to Gunnar Grosch if you have any questions.

Author

Gunnar Grosch - GitHub | Twitter | LinkedIn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.