SlideShare une entreprise Scribd logo
1  sur  29
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Beginning to Automate
your home with Amazon
Alexa
PETE GALLAGHER
PJGCREATIONS.CO.UK
21/06/2018
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
About Me
Pete Gallagher
@pete_codes / @PJGCreations
www.PJGCreations.co.uk
Pete@PJGCreations.co.uk
• IT Consultant
• Decades of Desktop, Web & Embedded
Software experience
• Gadget Addict
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
What we’re going to be doing…
 A description of the basic elements
 Amazon Echo and Alexa
 An introduction to the software elements
 Building a Basic Alexa Skill
 Amazon IoT
 Smart Home Skills
 Amazon Rekognition
 Q&A
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
The Parts
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Amazon Echo
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Amazon Echo
“Amazon Echo is a hands-free speaker you control with your
voice.
Echo connects to the Alexa Voice Service to play music, answer
questions, make calls, send and receive messages, provide
information, news, sports scores, weather and more.
All you have to do is ask”
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 Invocation, Intents and Utterances
 Voice First Design
 Connects to AWS Lambda
Alexa Skills
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 Skill Name
 Doesn’t have to be unique
 Name used for the Store
 Invocation
 Used to launch
 Must be at least two words – Unless you are a recognised brand name
 Doesn’t have to be unique
 Choose something Memorable, easy and relevant
 Can be different to the skill name
 Can’t use Alexa Reserved Words or infringe copyright
Building a Basic Alexa Skill
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 Intents
 Used to access sections of the Skill
 Acts as a separation between distinct operations
 Must be unique to the Skill
 Naming is only for reference and convention
 Utterances
 Per Intent
 Set out how the user will invoke the Intents
 Multiple different permutations of how to invoke.
 Contain Slots – Options fed back to lambda.
Building a Basic Alexa Skill
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Download here:
http://bit.ly/AlexaSmartHome2018Instruction
s
Instructions
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s Build a Skill…
Building a Basic Alexa Skill
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 Serverless Computing
 Endpoint for Alexa Skills
 Process and return responses using ASK SDK
 Can be written in Node, Python, C#, Java, GO
 Can call out to other services to compute response
AWS Lambda
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 Enables Developers to integrate Alexa into their products
 SDK’s & API’s for Windows, Linux, Mac OS, Raspberry Pi
 https://github.com/alexa/avs-device-sdk/
 https://github.com/alexa/avs-device-sdk/wiki/Raspberry-Pi-Quick-Start-
Guide-with-Script
 Hardware Development Kits from Synaptics, Intel, Amlogic
Alexa Voice Service
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s add a Lambda…
AWS Lambda
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 “Managed Cloud Platform”
 Allows billions of devices to securely communicate through a centralised
location.
 Devices referred to as “Things”
 Works even while offline using “Device Shadow”
AWS IoT Core
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
R
E
S
O
U
R
C
E
S
F
I
E
L
D
IoT and Amazon IoT Core
I
O
T
C
O
R
E
Device Gateway
Message Broker
AWS Lambda
S3 Storage
Queue
Notification Service
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s add a “Thing”…
AWS IoT Core
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Raspberry Pi 3B+
Manufacturer: Raspberry Pi Foundation
Processor:
Quad Core Broadcom BCM2837 ARM Cortex
A53 @ 1.4GHz + 1GB RAM
Connectivity: 4x USB, Gigabit Lan, Wifi, Bluetooth LE
I/O: 40 GPIO Pins – SPI, UART, I2C, PWM
Sensors etc: None
Cost: £35 (+ SD Card + PSU + Peripherals)
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 4 Channel Relay
 Can switch anything from 3v up to 240v
 Powered by 5v directly from Pi
 Controlled via simple logic direct from Pi
Mains Relay
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Mains Relay
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 Code in JavaScript (Node), Python, Node Red etc
 Node for this example
 Add Node Packages for AWS (IoT Core, S3 etc), Camera, GPIO
Raspberry Pi Code
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s create some code…
Raspberry Pi
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 Simpler Skill System
 No need to Invoke via a skill name
 Requires user to link their account to discover Smart
Things
Building an Alexa Smart Home Skill
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Let’s Build a Smart Home Skill…
Building an Alexa Smart Home Skill
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 Image and Video Recognition
 Understands Image and Video contents.
 Understands Expressions and Emotions
 Can recognise faces when compared to a set of known images.
AWS Rekognition
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
 Cloud Storage
 Fast and Cheap
 Central repository between Pi and Lambda
AWS S3
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Who’s at the door?
Adding Rekognition to our Skill
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Cheese!
Taking Photos with the
Raspberry Pi Camera
Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018
Questions?
All done

Contenu connexe

Tendances

The Enterprise Architecture You Always Wanted
The Enterprise Architecture You Always WantedThe Enterprise Architecture You Always Wanted
The Enterprise Architecture You Always Wanted
Thoughtworks
 
Amazon Alexa: our successes and fails
Amazon Alexa: our successes and failsAmazon Alexa: our successes and fails
Amazon Alexa: our successes and fails
Vyacheslav Lyalkin
 

Tendances (17)

Build an Alexa Skill Step-by-Step
Build an Alexa Skill Step-by-StepBuild an Alexa Skill Step-by-Step
Build an Alexa Skill Step-by-Step
 
ALX319_It’s All in the Data
ALX319_It’s All in the DataALX319_It’s All in the Data
ALX319_It’s All in the Data
 
Frameworks, Plugins and APIs
Frameworks, Plugins and APIsFrameworks, Plugins and APIs
Frameworks, Plugins and APIs
 
WKS403 Build an Alexa Skill using AWS Lambda
WKS403 Build an Alexa Skill using AWS Lambda WKS403 Build an Alexa Skill using AWS Lambda
WKS403 Build an Alexa Skill using AWS Lambda
 
The Enterprise Architecture You Always Wanted
The Enterprise Architecture You Always WantedThe Enterprise Architecture You Always Wanted
The Enterprise Architecture You Always Wanted
 
Introduction to Alexa Skill Building
Introduction to Alexa Skill BuildingIntroduction to Alexa Skill Building
Introduction to Alexa Skill Building
 
Writing Alexa Voice Skills With NodeJS (with a little IoT)
Writing Alexa Voice Skills With NodeJS (with a little IoT)Writing Alexa Voice Skills With NodeJS (with a little IoT)
Writing Alexa Voice Skills With NodeJS (with a little IoT)
 
Amazon alexa - building custom skills
Amazon alexa - building custom skillsAmazon alexa - building custom skills
Amazon alexa - building custom skills
 
Amazon Alexa - Introduction & Custom Skills
Amazon Alexa - Introduction & Custom SkillsAmazon Alexa - Introduction & Custom Skills
Amazon Alexa - Introduction & Custom Skills
 
AWS re:Invent 2016: From VUI to QA: Building a Voice-Based Adventure Game for...
AWS re:Invent 2016: From VUI to QA: Building a Voice-Based Adventure Game for...AWS re:Invent 2016: From VUI to QA: Building a Voice-Based Adventure Game for...
AWS re:Invent 2016: From VUI to QA: Building a Voice-Based Adventure Game for...
 
ALX326_Applying Alexa’s Natural Language to Your Challenges
ALX326_Applying Alexa’s Natural Language to Your ChallengesALX326_Applying Alexa’s Natural Language to Your Challenges
ALX326_Applying Alexa’s Natural Language to Your Challenges
 
Alexa bootcamp - Skill building 101
Alexa bootcamp - Skill building 101Alexa bootcamp - Skill building 101
Alexa bootcamp - Skill building 101
 
Your First Amazon Alexa Skill
Your First Amazon Alexa SkillYour First Amazon Alexa Skill
Your First Amazon Alexa Skill
 
Amazon Alexa: our successes and fails
Amazon Alexa: our successes and failsAmazon Alexa: our successes and fails
Amazon Alexa: our successes and fails
 
Amazon Alexa Workshop
Amazon Alexa WorkshopAmazon Alexa Workshop
Amazon Alexa Workshop
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
 
Amazon Echo
Amazon EchoAmazon Echo
Amazon Echo
 

Similaire à Controlling gadgets with amazon Alexa - June 2018

Similaire à Controlling gadgets with amazon Alexa - June 2018 (20)

AWS re:Invent 2016: Voice-enabling Your Home and Devices with Amazon Alexa an...
AWS re:Invent 2016: Voice-enabling Your Home and Devices with Amazon Alexa an...AWS re:Invent 2016: Voice-enabling Your Home and Devices with Amazon Alexa an...
AWS re:Invent 2016: Voice-enabling Your Home and Devices with Amazon Alexa an...
 
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
 
Alexa Smart Home Skill
Alexa Smart Home SkillAlexa Smart Home Skill
Alexa Smart Home Skill
 
Use Alexa Skills to Buy Digital Content: A Workshop for In-Skill Purchasing (...
Use Alexa Skills to Buy Digital Content: A Workshop for In-Skill Purchasing (...Use Alexa Skills to Buy Digital Content: A Workshop for In-Skill Purchasing (...
Use Alexa Skills to Buy Digital Content: A Workshop for In-Skill Purchasing (...
 
Building Alexa Skills with AWS | AWS Floor28
Building Alexa Skills with AWS | AWS Floor28Building Alexa Skills with AWS | AWS Floor28
Building Alexa Skills with AWS | AWS Floor28
 
Deploy Alexa for Business in Your Organization & Build Your First Private Ski...
Deploy Alexa for Business in Your Organization & Build Your First Private Ski...Deploy Alexa for Business in Your Organization & Build Your First Private Ski...
Deploy Alexa for Business in Your Organization & Build Your First Private Ski...
 
Facilidanto um pouco nossa vida com serverless framework
Facilidanto um pouco nossa vida com serverless frameworkFacilidanto um pouco nossa vida com serverless framework
Facilidanto um pouco nossa vida com serverless framework
 
From Zero to DevSecOps in 60 Minutes - DevTalks Romania - Cluj-Napoca
From Zero to DevSecOps in 60 Minutes - DevTalks Romania - Cluj-NapocaFrom Zero to DevSecOps in 60 Minutes - DevTalks Romania - Cluj-Napoca
From Zero to DevSecOps in 60 Minutes - DevTalks Romania - Cluj-Napoca
 
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
 
Writing Alexa Voice Skills with NodeJS- David Janes
Writing Alexa Voice Skills with NodeJS- David JanesWriting Alexa Voice Skills with NodeJS- David Janes
Writing Alexa Voice Skills with NodeJS- David Janes
 
Intro to AWS Cloud Development Kit | AWS Floor28
Intro to AWS Cloud Development Kit | AWS Floor28Intro to AWS Cloud Development Kit | AWS Floor28
Intro to AWS Cloud Development Kit | AWS Floor28
 
Azure IoT Hubs with Raspberry Pi and Node.js
Azure IoT Hubs with Raspberry Pi and Node.jsAzure IoT Hubs with Raspberry Pi and Node.js
Azure IoT Hubs with Raspberry Pi and Node.js
 
20190206 AWS Black Belt Online Seminar Amazon SageMaker Basic Session
20190206 AWS Black Belt Online Seminar Amazon SageMaker Basic Session20190206 AWS Black Belt Online Seminar Amazon SageMaker Basic Session
20190206 AWS Black Belt Online Seminar Amazon SageMaker Basic Session
 
Building Voice Controls and Integrating with Automation Actions on an IoT Net...
Building Voice Controls and Integrating with Automation Actions on an IoT Net...Building Voice Controls and Integrating with Automation Actions on an IoT Net...
Building Voice Controls and Integrating with Automation Actions on an IoT Net...
 
Serverless:It All Started in Vegas (DVC306) - AWS re:Invent 2018
Serverless:It All Started in Vegas (DVC306) - AWS re:Invent 2018Serverless:It All Started in Vegas (DVC306) - AWS re:Invent 2018
Serverless:It All Started in Vegas (DVC306) - AWS re:Invent 2018
 
Integrate drupal 8 with alexa - Rakshith
Integrate drupal 8 with alexa - RakshithIntegrate drupal 8 with alexa - Rakshith
Integrate drupal 8 with alexa - Rakshith
 
Bring Alexa to Work
Bring Alexa to Work Bring Alexa to Work
Bring Alexa to Work
 
Build the Next-Gen Meeting Room Experience Using Alexa for Business (BAP303-R...
Build the Next-Gen Meeting Room Experience Using Alexa for Business (BAP303-R...Build the Next-Gen Meeting Room Experience Using Alexa for Business (BAP303-R...
Build the Next-Gen Meeting Room Experience Using Alexa for Business (BAP303-R...
 
Bring Alexa to Work - ENT306 - Chicago AWS Summit
Bring Alexa to Work - ENT306 - Chicago AWS SummitBring Alexa to Work - ENT306 - Chicago AWS Summit
Bring Alexa to Work - ENT306 - Chicago AWS Summit
 
New AI/ML Solutions with AWS DeepLens & Amazon SageMaker with ConocoPhillips ...
New AI/ML Solutions with AWS DeepLens & Amazon SageMaker with ConocoPhillips ...New AI/ML Solutions with AWS DeepLens & Amazon SageMaker with ConocoPhillips ...
New AI/ML Solutions with AWS DeepLens & Amazon SageMaker with ConocoPhillips ...
 

Plus de Peter Gallagher

Plus de Peter Gallagher (20)

Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalRBuilding a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
 
Supercharging your Data with Azure AI Search and Azure OpenAI
Supercharging your Data with Azure AI Search and Azure OpenAISupercharging your Data with Azure AI Search and Azure OpenAI
Supercharging your Data with Azure AI Search and Azure OpenAI
 
Experience Raspberry Pi 5 - October 2023
Experience Raspberry Pi 5 - October 2023Experience Raspberry Pi 5 - October 2023
Experience Raspberry Pi 5 - October 2023
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
 
Azure Percept Home Automation - Hacksoc 2022
Azure Percept Home Automation - Hacksoc 2022Azure Percept Home Automation - Hacksoc 2022
Azure Percept Home Automation - Hacksoc 2022
 
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
 
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
 
Config and Deployments as Code with Octopus Deploy
Config and Deployments as Code with Octopus DeployConfig and Deployments as Code with Octopus Deploy
Config and Deployments as Code with Octopus Deploy
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...
 
Azure Percept Home Automation - Microsoft Reactor London - 28-05-22
Azure Percept Home Automation - Microsoft Reactor London - 28-05-22Azure Percept Home Automation - Microsoft Reactor London - 28-05-22
Azure Percept Home Automation - Microsoft Reactor London - 28-05-22
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptxBuilding a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptx
 
Building a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptxBuilding a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptx
 
Azure Percept Home Automation - Festive Tech Calendar 2021 - 01-12-21
Azure Percept Home Automation  - Festive Tech Calendar 2021 - 01-12-21Azure Percept Home Automation  - Festive Tech Calendar 2021 - 01-12-21
Azure Percept Home Automation - Festive Tech Calendar 2021 - 01-12-21
 
IoT with only your Laptop - Build Stuff 2021
IoT with only your Laptop - Build Stuff 2021IoT with only your Laptop - Build Stuff 2021
IoT with only your Laptop - Build Stuff 2021
 
Azure Percept Home Automation - .NET Liverpool - 28-10-21
Azure Percept Home Automation  - .NET Liverpool - 28-10-21Azure Percept Home Automation  - .NET Liverpool - 28-10-21
Azure Percept Home Automation - .NET Liverpool - 28-10-21
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...
 
Azure Percept Home Automation - .NET Docs Show - 20-09-21
Azure Percept Home Automation  - .NET Docs Show - 20-09-21Azure Percept Home Automation  - .NET Docs Show - 20-09-21
Azure Percept Home Automation - .NET Docs Show - 20-09-21
 

Dernier

Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
amitlee9823
 
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men 🔝Vijayawada🔝 E...
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men  🔝Vijayawada🔝   E...➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men  🔝Vijayawada🔝   E...
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men 🔝Vijayawada🔝 E...
amitlee9823
 
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
ougvy
 
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Just Call Vip call girls Begusarai Escorts ☎️9352988975 Two shot with one gir...
Just Call Vip call girls Begusarai Escorts ☎️9352988975 Two shot with one gir...Just Call Vip call girls Begusarai Escorts ☎️9352988975 Two shot with one gir...
Just Call Vip call girls Begusarai Escorts ☎️9352988975 Two shot with one gir...
gajnagarg
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men 🔝kakinada🔝 Escor...
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men  🔝kakinada🔝   Escor...➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men  🔝kakinada🔝   Escor...
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men 🔝kakinada🔝 Escor...
amitlee9823
 
➥🔝 7737669865 🔝▻ Muzaffarpur Call-girls in Women Seeking Men 🔝Muzaffarpur🔝 ...
➥🔝 7737669865 🔝▻ Muzaffarpur Call-girls in Women Seeking Men  🔝Muzaffarpur🔝  ...➥🔝 7737669865 🔝▻ Muzaffarpur Call-girls in Women Seeking Men  🔝Muzaffarpur🔝  ...
➥🔝 7737669865 🔝▻ Muzaffarpur Call-girls in Women Seeking Men 🔝Muzaffarpur🔝 ...
amitlee9823
 
Just Call Vip call girls Berhampur Escorts ☎️9352988975 Two shot with one gir...
Just Call Vip call girls Berhampur Escorts ☎️9352988975 Two shot with one gir...Just Call Vip call girls Berhampur Escorts ☎️9352988975 Two shot with one gir...
Just Call Vip call girls Berhampur Escorts ☎️9352988975 Two shot with one gir...
gajnagarg
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
tufbav
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
amitlee9823
 
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
tufbav
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Dernier (20)

Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men 🔝Vijayawada🔝 E...
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men  🔝Vijayawada🔝   E...➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men  🔝Vijayawada🔝   E...
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men 🔝Vijayawada🔝 E...
 
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Point of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratoryPoint of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratory
 
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
 
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Just Call Vip call girls Begusarai Escorts ☎️9352988975 Two shot with one gir...
Just Call Vip call girls Begusarai Escorts ☎️9352988975 Two shot with one gir...Just Call Vip call girls Begusarai Escorts ☎️9352988975 Two shot with one gir...
Just Call Vip call girls Begusarai Escorts ☎️9352988975 Two shot with one gir...
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men 🔝kakinada🔝 Escor...
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men  🔝kakinada🔝   Escor...➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men  🔝kakinada🔝   Escor...
➥🔝 7737669865 🔝▻ kakinada Call-girls in Women Seeking Men 🔝kakinada🔝 Escor...
 
➥🔝 7737669865 🔝▻ Muzaffarpur Call-girls in Women Seeking Men 🔝Muzaffarpur🔝 ...
➥🔝 7737669865 🔝▻ Muzaffarpur Call-girls in Women Seeking Men  🔝Muzaffarpur🔝  ...➥🔝 7737669865 🔝▻ Muzaffarpur Call-girls in Women Seeking Men  🔝Muzaffarpur🔝  ...
➥🔝 7737669865 🔝▻ Muzaffarpur Call-girls in Women Seeking Men 🔝Muzaffarpur🔝 ...
 
Just Call Vip call girls Berhampur Escorts ☎️9352988975 Two shot with one gir...
Just Call Vip call girls Berhampur Escorts ☎️9352988975 Two shot with one gir...Just Call Vip call girls Berhampur Escorts ☎️9352988975 Two shot with one gir...
Just Call Vip call girls Berhampur Escorts ☎️9352988975 Two shot with one gir...
 
VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...
 
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
 
(ISHITA) Call Girls Service Aurangabad Call Now 8617697112 Aurangabad Escorts...
(ISHITA) Call Girls Service Aurangabad Call Now 8617697112 Aurangabad Escorts...(ISHITA) Call Girls Service Aurangabad Call Now 8617697112 Aurangabad Escorts...
(ISHITA) Call Girls Service Aurangabad Call Now 8617697112 Aurangabad Escorts...
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
 
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
 

Controlling gadgets with amazon Alexa - June 2018

  • 1. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Beginning to Automate your home with Amazon Alexa PETE GALLAGHER PJGCREATIONS.CO.UK 21/06/2018
  • 2. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 About Me Pete Gallagher @pete_codes / @PJGCreations www.PJGCreations.co.uk Pete@PJGCreations.co.uk • IT Consultant • Decades of Desktop, Web & Embedded Software experience • Gadget Addict
  • 3. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 What we’re going to be doing…  A description of the basic elements  Amazon Echo and Alexa  An introduction to the software elements  Building a Basic Alexa Skill  Amazon IoT  Smart Home Skills  Amazon Rekognition  Q&A
  • 4. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 The Parts
  • 5. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Amazon Echo
  • 6. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Amazon Echo “Amazon Echo is a hands-free speaker you control with your voice. Echo connects to the Alexa Voice Service to play music, answer questions, make calls, send and receive messages, provide information, news, sports scores, weather and more. All you have to do is ask”
  • 7. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  Invocation, Intents and Utterances  Voice First Design  Connects to AWS Lambda Alexa Skills
  • 8. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  Skill Name  Doesn’t have to be unique  Name used for the Store  Invocation  Used to launch  Must be at least two words – Unless you are a recognised brand name  Doesn’t have to be unique  Choose something Memorable, easy and relevant  Can be different to the skill name  Can’t use Alexa Reserved Words or infringe copyright Building a Basic Alexa Skill
  • 9. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  Intents  Used to access sections of the Skill  Acts as a separation between distinct operations  Must be unique to the Skill  Naming is only for reference and convention  Utterances  Per Intent  Set out how the user will invoke the Intents  Multiple different permutations of how to invoke.  Contain Slots – Options fed back to lambda. Building a Basic Alexa Skill
  • 10. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Download here: http://bit.ly/AlexaSmartHome2018Instruction s Instructions
  • 11. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Let’s Build a Skill… Building a Basic Alexa Skill
  • 12. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  Serverless Computing  Endpoint for Alexa Skills  Process and return responses using ASK SDK  Can be written in Node, Python, C#, Java, GO  Can call out to other services to compute response AWS Lambda
  • 13. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  Enables Developers to integrate Alexa into their products  SDK’s & API’s for Windows, Linux, Mac OS, Raspberry Pi  https://github.com/alexa/avs-device-sdk/  https://github.com/alexa/avs-device-sdk/wiki/Raspberry-Pi-Quick-Start- Guide-with-Script  Hardware Development Kits from Synaptics, Intel, Amlogic Alexa Voice Service
  • 14. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Let’s add a Lambda… AWS Lambda
  • 15. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  “Managed Cloud Platform”  Allows billions of devices to securely communicate through a centralised location.  Devices referred to as “Things”  Works even while offline using “Device Shadow” AWS IoT Core
  • 16. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 R E S O U R C E S F I E L D IoT and Amazon IoT Core I O T C O R E Device Gateway Message Broker AWS Lambda S3 Storage Queue Notification Service
  • 17. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Let’s add a “Thing”… AWS IoT Core
  • 18. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Raspberry Pi 3B+ Manufacturer: Raspberry Pi Foundation Processor: Quad Core Broadcom BCM2837 ARM Cortex A53 @ 1.4GHz + 1GB RAM Connectivity: 4x USB, Gigabit Lan, Wifi, Bluetooth LE I/O: 40 GPIO Pins – SPI, UART, I2C, PWM Sensors etc: None Cost: £35 (+ SD Card + PSU + Peripherals)
  • 19. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  4 Channel Relay  Can switch anything from 3v up to 240v  Powered by 5v directly from Pi  Controlled via simple logic direct from Pi Mains Relay
  • 20. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Mains Relay
  • 21. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  Code in JavaScript (Node), Python, Node Red etc  Node for this example  Add Node Packages for AWS (IoT Core, S3 etc), Camera, GPIO Raspberry Pi Code
  • 22. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Let’s create some code… Raspberry Pi
  • 23. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  Simpler Skill System  No need to Invoke via a skill name  Requires user to link their account to discover Smart Things Building an Alexa Smart Home Skill
  • 24. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Let’s Build a Smart Home Skill… Building an Alexa Smart Home Skill
  • 25. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  Image and Video Recognition  Understands Image and Video contents.  Understands Expressions and Emotions  Can recognise faces when compared to a set of known images. AWS Rekognition
  • 26. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018  Cloud Storage  Fast and Cheap  Central repository between Pi and Lambda AWS S3
  • 27. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Who’s at the door? Adding Rekognition to our Skill
  • 28. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Cheese! Taking Photos with the Raspberry Pi Camera
  • 29. Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018Beginning to Automate your Home with Amazon Alexa – Pete Gallagher – PJG Creations - 2018 Questions? All done

Notes de l'éditeur

  1. https://developer.amazon.com/alexa-skills-kit http://bit.ly/AlexaSmartHome2018Instructions
  2. https://developer.amazon.com/alexa-skills-kit
  3. https://aws.amazon.com/console/ https://s3.amazonaws.com/webappvui/skillcode/v2/index.html
  4. https://aws.amazon.com/iot-core/
  5. https://aws.amazon.com/iot-core/ https://docs.aws.amazon.com/iot/latest/developerguide/iot-policies.html Policy: iot:* Lambda Code: let AWS = require("aws-sdk"); const config = {}; config.IOT_BROKER_ENDPOINT = "a3lr4pxoc781d9.iot.eu-west-1.amazonaws.com"; // also called the REST API endpoint config.IOT_BROKER_REGION = "eu-west-1"; // eu-west-1 corresponds to the Ireland Region. Use us-east-1 for the N. Virginia region config.IOT_THING_NAME = "pi-home-control"; let deviceResolved = ""; let stateResolved = ""; return new Promise(resolve => { updateShadow(deviceResolved, stateResolved, (status) => { let speechOutput = ""; if (status) { speechOutput = status; } else { speechOutput = "Couldn't control the gadget"; } handlerInput.attributesManager.setSessionAttributes(sessionAttributes); resolve(handlerInput.responseBuilder.speak(speechOutput).getResponse()); }); }); function updateShadow(device, desiredState, callback) { // update AWS IOT thing shadow var AWS = require("aws-sdk"); AWS.config.region = config.IOT_BROKER_REGION; //Prepare the parameters of the update call var paramsUpdate = { thingName: config.IOT_THING_NAME, payload: JSON.stringify({ state: { reported: { device: device, // {"Lamp"} state: desiredState // {"Off"} } } }) }; var iotData = new AWS.IotData({ endpoint: config.IOT_BROKER_ENDPOINT }); iotData.updateThingShadow(paramsUpdate, function(err, data) { if (err) { console.log(err); callback("not ok"); } else { console.log( "updated thing shadow " + config.IOT_THING_NAME + " to state " + paramsUpdate.payload ); callback("ok, the " + device + " is " + desiredState); } }); } Add IAM Policies: IOT Full Access Cloudwatch Full Access
  6. BCM = System on a Chip
  7. Create Directory Create certs directory Npm init Create index.js Npm install aws-sdk Npm install rpi-gpio var AWS = require("aws-sdk"); var awsIot = require('aws-iot-device-sdk');
  8. https://login.amazon.com/ Authorization URI: https://www.amazon.com/ap/oa Access Token URI: https://api.amazon.com/auth/o2/token Scope: profile https://alexa.amazon.co.uk/spa/index.html?#cards
  9. let AWS = require("aws-sdk"); let s3 = new AWS.S3({ apiVersion: "2006-03-01" }); let rekognition = new AWS.Rekognition(); var myBucket = "pjgrekogstore2"; var myKey = "demo.jpg"; return new Promise(resolve => { analysePhoto((status) => { let speechOutput = ""; if (status) { speechOutput = status; } else { speechOutput = "Couldn't check the door"; } handlerInput.attributesManager.setSessionAttributes(sessionAttributes); resolve(handlerInput.responseBuilder.speak(speechOutput).getResponse()); }); }); function analysePhoto(callback) { //for text file //fs.readFile('demo.txt', function (err, data) { //for Video file //fs.readFile('demo.avi', function (err, data) { //for image file let say = ""; rekognition.config.loadFromPath("./config.json"); var params = { Attributes: ["ALL"], Image: { S3Object: { Bucket: myBucket, Name: myKey } } }; try { rekognition.detectFaces(params, function(err, data) { if (err) { console.log(err, err.stack); // an error occurred say = "An error occurred"; } else { console.log(JSON.stringify(data, null, "\t")); // successful response console.log("Getting Face Details"); let gender = data.FaceDetails[0].Gender.Value; let lowAge = data.FaceDetails[0].AgeRange.Low; let highAge = data.FaceDetails[0].AgeRange.High; let mainEmotion = data.FaceDetails[0].Emotions[0].Type; say = "A " + gender + " between " + lowAge + " and " + highAge + " years old, who is " + mainEmotion + " is at the door"; console.log(say); } callback(say); }); } catch (ex) { console.log(ex); say = "An error occurred"; } }; Config.json: { "accessKeyId": "", "secretAccessKey": "", "region": "eu-west-1" }
  10. Npm install node-raspistill var Raspistill = require('node-raspistill').Raspistill; AWS.config.loadFromPath("./config.json"); var s3 = new AWS.S3(); var myBucket = "pjgrekogstore3"; var myKey = "demo.jpg"; var photoPath = "./photos/image.jpg"; gpio.on('change', function(channel, value) { takePhoto(); console.log('Channel ' + channel + ' value is now ' + value); }); gpio.setup(3, gpio.DIR_IN, gpio.EDGE_RISING); function takePhoto() { const piStillCamera = new Raspistill({ fileName: photoPath, verticalFlip: true, width: 800, height: 600 }); piStillCamera.takePhoto('image') .then((photo) => { console.log('took first photo', photo); analysePhoto(); }) .catch((error) => { console.error('something bad happened', error); }); }; function analysePhoto() { fs.readFile(photoPath, function(err, data) { if (err) { throw err; } params = { Bucket: myBucket, Key: myKey, Body: data }; try { s3.deleteObject(myKey); } catch (ex) { console.log(ex); } s3.putObject(params, function(err, data) { if (err) { console.log(err); } else { console.log("Successfully uploaded data to myBucket/myKey"); var params = { Attributes: ["ALL"], Image: { S3Object: { Bucket: myBucket, Name: myKey } } }; } }); }); };