SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
An Intro to AWS IoT
Capital Saratoga Region AWS User Group
Scott Stewart
May 18, 2017
Before we talk AWS IoT,
lets talk IoT in general.
Thanks to IoT, 90% of the data in
the world today, has been created
in the past 4 years (as of 2017).
Not "One Size Fits All"
Internet of Things (IoT) is a sprawling
set of technologies and use cases that
has no clear, single definition.
Overview of Internet of Things
https://cloud.google.com/solutions/iot-overview
The Things
• Sensors
• Temperature, humidity, telemetry, acceleration,
altitude, light, flow rates, etc.
• Actuators
• Switches, flow control valves (water, gas, oil), door
locks, thermostats, cameras, robotics, embedded
controls, etc.
Iot Use Cases
• Smart Metering - Water, Gas, consumption
• Manufacturing - Assembly line predictive
maintenance
• Asset Tracking - From office and IT to cargo units.
• Autonomous Driving
• Fleet Management
IoT Use Cases
• Smart Farming
• Health and Fitness (FitBit, Watch, Running gear)
• Home Appliances
• Pest Control
• Public Trash Collection Efficiences
Lots of Things
It's expected that by 2020 there
will be somewhere around 50
billion connected IoT devices.
Back to The Things
• Sensors
• Temperature, humidity, telemetry, acceleration,
altitude, light, flow, etc.
• Actuators
• Switches, flow control valves (water, gas, oil), door
locks, thermostats, cameras, robotics, embedded
controls, etc.
Challenges of IoT
• Connectivity
• Battery Life (external power)
• Processing Power
• Security
• Cost (projects might require lots of sensors)
IoT Connectivity
• RFID (Radio-frequency identification)
• NFC (Near-Field Communications)
• Bluetooth
• Wifi
IoT Connectivity
Specifications RFID NFC Bluetooth wifi
Range 3meter 10cm 100meter 100meter
Communication 1-way 2-way 2-way 2-way
Data rate varies 106,212,424Kbps 22Mbps 144Mbps
Applications
EZ-pass,
SpeedPass
warehouse tracking,
cargo, crates, etc.
ApplePay,
GooglePay, etc
Laptop, phone and
peripherals
wireless
internet
IoT Connectivity
But there is more...
• Dash7 (multi year battery life, 0-5km)
• IEEE P802.11ah (low power Wi-Fi)
• nWave (10-30km!)
• Zigbee (low power, wireless, 10-100m los)
• Z-Wave (powered, used primarily hvac)
• TSMP (Time synchronized Mesh)
IoT Connectivity
...and more
Source: http://www.cnx-software.com/wp-content/uploads/2015/09/LPWAN_Comparison_Table.png
IoT Connectivity
The best connectivity solution for an IoT use case in
terms of power and resources will very often be a
"sometimes" connected strategy.
If that is the case, how do we programmatically
interact with an IoT device when it is usually offline or
disconnected?
Back to The Things
• Sensors
• Temperature, humidity, telemetry, acceleration,
altitude, light, flow, etc.
• Actuators
• Switches, flow control valves (water, gas, oil), door
locks, thermostats, cameras, robotics, embedded
controls, etc.
IoT Data Protocols
Surely this will be simpler...
IoT Data Protocols
• MQTT (Message Queueing Telemetry Transport)
• CoAP (Constrained Application Protocol)
• XMPP (Extensible Messaging and Presence Protocol)
• DDS (Data-Distribution Service for Real-Time Systems)
• LLAP (lightweight local automation protocol)
• AMQP (Advanced Message Queue Protocol)
• LWM2M (Lightweight M2M)
• SSI (Simple Sensor Interface)
• Reactive Stream
• Many many custom JavaScript / Node.js
IoT Data Protocols
Just like there are many connectivity solutions, there are
many data protocol solutions.
IoT Data Protocols
• MQTT Strengths
• Publish/Subscribe model scales well
• Flexible subscription topics
• MQTT Weakness
• Central Broker
IoT Data Protocols
• CoAP Strengths
• Runs over UDP, which while less reliable than
TCP, can offer quicker "wake up and send"
bursts.
• CoAP Weakness
• Request/Report one to one interaction
IoT Data Protocols
and the winner is...
MQTT
Message Queue Telemetry Transport
"machine to machine" "Internet of
Things" language
MQTT
• ISO Standard
• Lightweight Messaging Protocol
• Low Battery and Bandwidth Usage
• For use on top of TCP/IP
• Pub/Sub via a Broker
MQTT Methods
• Connect
• Disconnect
• Subscribe
• Unsubscribe
• Publish
MQTT
In other words,
it's just a lightweight
Pub/Sub Specification
MQTT Significant Parts
• Publish/Subscribe Topic
• Payload
• Quality of Service
MQTT Topics
Pub/Sub over topics (i.e. channels)
sensors/COMPUTER_NAME/temperature/HARDDRIVE_NAME

iotbuttons/ABC

iotbuttons/+

home/first_floor/living_room/bulb1/brightness

home/first_floor/kitchen/bulb2/brightness

home/first_floor/kitchen/temperature/

home/second_floor/master/bulbABC/brightness

home/first_floor/+/temperature (temperature of all rooms on first floor)
MQTT Payload
Each MQTT contains a Payload
• MQTT Payload is data agnostic
• Payload can be images, text, any encoding,
encrypted or not.
• Generally Json text:
{ temperature: 72, pressure_value:1013.2,
pressure_type: mbar }
AWS IoT
An Intro to AWS IoT
AWS IoT Platform
All-in-one service
•Device Gateway
•Message Broker
•Rules Engine
•Thing Registry
Managed Services
•No Installation
•Automatic Scaling
•Redundant AZ
•Pay as go ($5/M msg)
How it works
G
a
t
e
w
a
y
AWS IoT Protocols
AWS IoT Message
topic: iotbutton/ABCDEFG12345
payload:
{
"serialNumber" : "ABCDEFG12345",
"batteryVoltage" : "2000mV",
"clickType" : "SINGLE"
}
AWS IoT Button Example
• Register a Thing
• Note its ARN, and Endpoint
• Create and download Certificate
• Create a Policy, and attach to Cert
• Subscribe a Test listner
• Configure IoT Button and Test it.
• Create a Rule to send SMS on Click
AWS IoT HTTPS Example
curl --tlsv1.2 --cacert root-CA.crt --cert
certificate.pem.crt --key private.pem.key -X POST -
d "{ "serialNumber": "ABC", "clickType":
"SINGLE", "batteryVoltage": "2000mV" }" "https:/
<your end point>.iot.us-east-1.amazonaws.com:
8443/topics/iotbutton/ABC?qos=1"
AWS IoT Node.js SDK
var awsIot = require('aws-iot-device-sdk');
var device = awsIot.device({
keyPath: "./certs/3fdf14d588-private.pem.key",
certPath: "./certs/3fdf14d588-certificate.pem.crt",
caPath: "./certs/root-CA.crt",
clientId: "NodePublisher1",
region: "us-east-1",
host: "<your end point>.iot.us-
east-1.amazonaws.com"
});
AWS IoT Node.js SDK
device
.on('connect', function() {
console.log('connect');
device.subscribe('iotbutton/+')
setInterval(function() {
console.log('publishing...');
device.publish('iotbutton/ABCD', JSON.stringify({ clickType:
"SINGLE", batteryVoltage: '999mV'}));
console.log('done.');
}, 2000)
});
AWS IoT Node.js SDK
device
.on('message', function(topic, payload) {
console.log('message', topic, payload); });
device
.on('close', function() {
console.log('close'); });
device
.on('reconnect', function() {
console.log('reconnect'); });
device
.on('offline', function() {
console.log('offline'); });
device
.on('error', function(error) {
console.log('error', error); });
Closing Thoughts
• AWS IoT is a low-latency, scalable pub/sub service.
• A rules engine to connect devices with no code.
• Can pub/sub over WSS
• In a way, it is AWS’s only infinitely scalable WebSocket
service gateway into Lambda.
• But (there is always a but), its security model is complex
and cumbersome at best. Certs/SigV4. No built-in
Websocket security or ability to custom JWT AuthHeader
etc.
Closing Thoughts
IoT on the Edge and
The Fog...
AWS Greengrass
•AWS Greengrass seamlessly extends AWS to devices so
they can act locally on the data they generate 

•Respond to Local Events in Near Real-time

•Operate Offline
An Intro to AWS IoT
Scott Stewart
https://github.com/csr-aws-ug/aws_iot_intro

Contenu connexe

Tendances

Rackspace: Best Practices for Security Compliance on AWS
Rackspace: Best Practices for Security Compliance on AWSRackspace: Best Practices for Security Compliance on AWS
Rackspace: Best Practices for Security Compliance on AWS
Amazon Web Services
 

Tendances (20)

Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
Rackspace: Best Practices for Security Compliance on AWS
Rackspace: Best Practices for Security Compliance on AWSRackspace: Best Practices for Security Compliance on AWS
Rackspace: Best Practices for Security Compliance on AWS
 
AWSomeday Brussels Technical Track
AWSomeday Brussels Technical TrackAWSomeday Brussels Technical Track
AWSomeday Brussels Technical Track
 
Enterprise-Grade IoT Infrastructure and Connectivity on AWS
Enterprise-Grade IoT Infrastructure and Connectivity on AWSEnterprise-Grade IoT Infrastructure and Connectivity on AWS
Enterprise-Grade IoT Infrastructure and Connectivity on AWS
 
Introduction to AWS IoT
Introduction to AWS IoTIntroduction to AWS IoT
Introduction to AWS IoT
 
AWS re:Invent 2016: IoT: Build, Test, and Securely Scale (GPST302)
AWS re:Invent 2016: IoT: Build, Test, and Securely Scale (GPST302)AWS re:Invent 2016: IoT: Build, Test, and Securely Scale (GPST302)
AWS re:Invent 2016: IoT: Build, Test, and Securely Scale (GPST302)
 
SRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoTSRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoT
 
Srv204 Getting Started with AWS IoT
Srv204 Getting Started with AWS IoTSrv204 Getting Started with AWS IoT
Srv204 Getting Started with AWS IoT
 
Building Intelligent Solutions with AWS IoT
Building Intelligent Solutions with AWS IoT Building Intelligent Solutions with AWS IoT
Building Intelligent Solutions with AWS IoT
 
(MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols
(MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols(MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols
(MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols
 
AWS October Webinar Series - Getting Started with AWS IoT
AWS October Webinar Series - Getting Started with AWS IoTAWS October Webinar Series - Getting Started with AWS IoT
AWS October Webinar Series - Getting Started with AWS IoT
 
IoT End-to-End Security Overview
IoT End-to-End Security OverviewIoT End-to-End Security Overview
IoT End-to-End Security Overview
 
AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)
AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)
AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)
 
Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
AWS Enterprise Summit Netherlands - Infosec by Design
AWS Enterprise Summit Netherlands - Infosec by DesignAWS Enterprise Summit Netherlands - Infosec by Design
AWS Enterprise Summit Netherlands - Infosec by Design
 
Serverless Data Processing on AWS - Level 300
Serverless Data Processing on AWS - Level 300Serverless Data Processing on AWS - Level 300
Serverless Data Processing on AWS - Level 300
 
AWS Services Overview - September 2016 Webinar Series
AWS Services Overview - September 2016 Webinar SeriesAWS Services Overview - September 2016 Webinar Series
AWS Services Overview - September 2016 Webinar Series
 
Security & Compliance (Part 1)
Security & Compliance (Part 1)Security & Compliance (Part 1)
Security & Compliance (Part 1)
 
AWS re:Invent 2016: Understanding IoT Data: How to Leverage Amazon Kinesis in...
AWS re:Invent 2016: Understanding IoT Data: How to Leverage Amazon Kinesis in...AWS re:Invent 2016: Understanding IoT Data: How to Leverage Amazon Kinesis in...
AWS re:Invent 2016: Understanding IoT Data: How to Leverage Amazon Kinesis in...
 
(SEC321) Implementing Policy, Governance & Security for Enterprises
(SEC321) Implementing Policy, Governance & Security for Enterprises(SEC321) Implementing Policy, Governance & Security for Enterprises
(SEC321) Implementing Policy, Governance & Security for Enterprises
 

Similaire à An Intro to AWS IoT

A Pragmatic Reference Architecture for The Internet of Things
A Pragmatic Reference Architecture for The Internet of ThingsA Pragmatic Reference Architecture for The Internet of Things
A Pragmatic Reference Architecture for The Internet of Things
Rick G. Garibay
 
AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법 (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법  (김무현 솔루션즈 아키텍트)AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법  (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법 (김무현 솔루션즈 아키텍트)
Amazon Web Services Korea
 
Windows iot barone
Windows iot baroneWindows iot barone
Windows iot barone
DotNetCampus
 

Similaire à An Intro to AWS IoT (20)

AWS re:Invent 2016: Introduction to AWS IoT in the Cloud (IOT204)
AWS re:Invent 2016: Introduction to AWS IoT in the Cloud (IOT204)AWS re:Invent 2016: Introduction to AWS IoT in the Cloud (IOT204)
AWS re:Invent 2016: Introduction to AWS IoT in the Cloud (IOT204)
 
Ecawed1230iot204 161228175642
Ecawed1230iot204 161228175642Ecawed1230iot204 161228175642
Ecawed1230iot204 161228175642
 
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake ScherrerAWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
 
SRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoTSRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoT
 
Io t first(1)
Io t first(1)Io t first(1)
Io t first(1)
 
AWS re:Invent 2016: IoT State of the Union (IOT307)
AWS re:Invent 2016: IoT State of the Union (IOT307)AWS re:Invent 2016: IoT State of the Union (IOT307)
AWS re:Invent 2016: IoT State of the Union (IOT307)
 
A Pragmatic Reference Architecture for The Internet of Things
A Pragmatic Reference Architecture for The Internet of ThingsA Pragmatic Reference Architecture for The Internet of Things
A Pragmatic Reference Architecture for The Internet of Things
 
AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법 (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법  (김무현 솔루션즈 아키텍트)AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법  (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - AWS IoT 소개 및  AWS 서비스 연동 방법 (김무현 솔루션즈 아키텍트)
 
AWS for IoT
AWS for IoTAWS for IoT
AWS for IoT
 
AWS IoT 深入探討
AWS IoT 深入探討AWS IoT 深入探討
AWS IoT 深入探討
 
IoT
IoT IoT
IoT
 
OK, I Need an IoT Service. Now What??
OK, I Need an IoT Service. Now What??OK, I Need an IoT Service. Now What??
OK, I Need an IoT Service. Now What??
 
IoT Building Blocks: From Edge Devices to Analytics in the Cloud - SRV204 - T...
IoT Building Blocks: From Edge Devices to Analytics in the Cloud - SRV204 - T...IoT Building Blocks: From Edge Devices to Analytics in the Cloud - SRV204 - T...
IoT Building Blocks: From Edge Devices to Analytics in the Cloud - SRV204 - T...
 
Windows iot barone
Windows iot baroneWindows iot barone
Windows iot barone
 
MICROSOFT E IL MONDO IOT
MICROSOFT E IL MONDO IOTMICROSOFT E IL MONDO IOT
MICROSOFT E IL MONDO IOT
 
Gustavo Zastrow - Introduction to AWS IoT Core and MQTT
Gustavo Zastrow - Introduction to AWS  IoT Core and MQTTGustavo Zastrow - Introduction to AWS  IoT Core and MQTT
Gustavo Zastrow - Introduction to AWS IoT Core and MQTT
 
Introduction to IoT Technologies - The need to know basics
Introduction to IoT Technologies - The need to know basicsIntroduction to IoT Technologies - The need to know basics
Introduction to IoT Technologies - The need to know basics
 
Workshop AWS IoT @ SIDO
Workshop AWS IoT @ SIDOWorkshop AWS IoT @ SIDO
Workshop AWS IoT @ SIDO
 
Eurotech and Red Hat collaboration simplifies Internet of Things integration ...
Eurotech and Red Hat collaboration simplifies Internet of Things integration ...Eurotech and Red Hat collaboration simplifies Internet of Things integration ...
Eurotech and Red Hat collaboration simplifies Internet of Things integration ...
 
Internet of things
Internet of thingsInternet of things
Internet of things
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

An Intro to AWS IoT

  • 1. An Intro to AWS IoT Capital Saratoga Region AWS User Group Scott Stewart May 18, 2017
  • 2. Before we talk AWS IoT, lets talk IoT in general.
  • 3. Thanks to IoT, 90% of the data in the world today, has been created in the past 4 years (as of 2017).
  • 4. Not "One Size Fits All" Internet of Things (IoT) is a sprawling set of technologies and use cases that has no clear, single definition. Overview of Internet of Things https://cloud.google.com/solutions/iot-overview
  • 5. The Things • Sensors • Temperature, humidity, telemetry, acceleration, altitude, light, flow rates, etc. • Actuators • Switches, flow control valves (water, gas, oil), door locks, thermostats, cameras, robotics, embedded controls, etc.
  • 6. Iot Use Cases • Smart Metering - Water, Gas, consumption • Manufacturing - Assembly line predictive maintenance • Asset Tracking - From office and IT to cargo units. • Autonomous Driving • Fleet Management
  • 7. IoT Use Cases • Smart Farming • Health and Fitness (FitBit, Watch, Running gear) • Home Appliances • Pest Control • Public Trash Collection Efficiences
  • 8. Lots of Things It's expected that by 2020 there will be somewhere around 50 billion connected IoT devices.
  • 9. Back to The Things • Sensors • Temperature, humidity, telemetry, acceleration, altitude, light, flow, etc. • Actuators • Switches, flow control valves (water, gas, oil), door locks, thermostats, cameras, robotics, embedded controls, etc.
  • 10. Challenges of IoT • Connectivity • Battery Life (external power) • Processing Power • Security • Cost (projects might require lots of sensors)
  • 11. IoT Connectivity • RFID (Radio-frequency identification) • NFC (Near-Field Communications) • Bluetooth • Wifi
  • 12. IoT Connectivity Specifications RFID NFC Bluetooth wifi Range 3meter 10cm 100meter 100meter Communication 1-way 2-way 2-way 2-way Data rate varies 106,212,424Kbps 22Mbps 144Mbps Applications EZ-pass, SpeedPass warehouse tracking, cargo, crates, etc. ApplePay, GooglePay, etc Laptop, phone and peripherals wireless internet
  • 13. IoT Connectivity But there is more... • Dash7 (multi year battery life, 0-5km) • IEEE P802.11ah (low power Wi-Fi) • nWave (10-30km!) • Zigbee (low power, wireless, 10-100m los) • Z-Wave (powered, used primarily hvac) • TSMP (Time synchronized Mesh)
  • 14. IoT Connectivity ...and more Source: http://www.cnx-software.com/wp-content/uploads/2015/09/LPWAN_Comparison_Table.png
  • 15. IoT Connectivity The best connectivity solution for an IoT use case in terms of power and resources will very often be a "sometimes" connected strategy. If that is the case, how do we programmatically interact with an IoT device when it is usually offline or disconnected?
  • 16. Back to The Things • Sensors • Temperature, humidity, telemetry, acceleration, altitude, light, flow, etc. • Actuators • Switches, flow control valves (water, gas, oil), door locks, thermostats, cameras, robotics, embedded controls, etc.
  • 17. IoT Data Protocols Surely this will be simpler...
  • 18. IoT Data Protocols • MQTT (Message Queueing Telemetry Transport) • CoAP (Constrained Application Protocol) • XMPP (Extensible Messaging and Presence Protocol) • DDS (Data-Distribution Service for Real-Time Systems) • LLAP (lightweight local automation protocol) • AMQP (Advanced Message Queue Protocol) • LWM2M (Lightweight M2M) • SSI (Simple Sensor Interface) • Reactive Stream • Many many custom JavaScript / Node.js
  • 19. IoT Data Protocols Just like there are many connectivity solutions, there are many data protocol solutions.
  • 20. IoT Data Protocols • MQTT Strengths • Publish/Subscribe model scales well • Flexible subscription topics • MQTT Weakness • Central Broker
  • 21. IoT Data Protocols • CoAP Strengths • Runs over UDP, which while less reliable than TCP, can offer quicker "wake up and send" bursts. • CoAP Weakness • Request/Report one to one interaction
  • 22. IoT Data Protocols and the winner is...
  • 23. MQTT Message Queue Telemetry Transport "machine to machine" "Internet of Things" language
  • 24. MQTT • ISO Standard • Lightweight Messaging Protocol • Low Battery and Bandwidth Usage • For use on top of TCP/IP • Pub/Sub via a Broker
  • 25. MQTT Methods • Connect • Disconnect • Subscribe • Unsubscribe • Publish
  • 26. MQTT In other words, it's just a lightweight Pub/Sub Specification
  • 27. MQTT Significant Parts • Publish/Subscribe Topic • Payload • Quality of Service
  • 28. MQTT Topics Pub/Sub over topics (i.e. channels) sensors/COMPUTER_NAME/temperature/HARDDRIVE_NAME iotbuttons/ABC iotbuttons/+ home/first_floor/living_room/bulb1/brightness home/first_floor/kitchen/bulb2/brightness home/first_floor/kitchen/temperature/ home/second_floor/master/bulbABC/brightness home/first_floor/+/temperature (temperature of all rooms on first floor)
  • 29. MQTT Payload Each MQTT contains a Payload • MQTT Payload is data agnostic • Payload can be images, text, any encoding, encrypted or not. • Generally Json text: { temperature: 72, pressure_value:1013.2, pressure_type: mbar }
  • 30. AWS IoT An Intro to AWS IoT
  • 31. AWS IoT Platform All-in-one service •Device Gateway •Message Broker •Rules Engine •Thing Registry Managed Services •No Installation •Automatic Scaling •Redundant AZ •Pay as go ($5/M msg)
  • 34. AWS IoT Message topic: iotbutton/ABCDEFG12345 payload: { "serialNumber" : "ABCDEFG12345", "batteryVoltage" : "2000mV", "clickType" : "SINGLE" }
  • 35. AWS IoT Button Example • Register a Thing • Note its ARN, and Endpoint • Create and download Certificate • Create a Policy, and attach to Cert • Subscribe a Test listner • Configure IoT Button and Test it. • Create a Rule to send SMS on Click
  • 36. AWS IoT HTTPS Example curl --tlsv1.2 --cacert root-CA.crt --cert certificate.pem.crt --key private.pem.key -X POST - d "{ "serialNumber": "ABC", "clickType": "SINGLE", "batteryVoltage": "2000mV" }" "https:/ <your end point>.iot.us-east-1.amazonaws.com: 8443/topics/iotbutton/ABC?qos=1"
  • 37. AWS IoT Node.js SDK var awsIot = require('aws-iot-device-sdk'); var device = awsIot.device({ keyPath: "./certs/3fdf14d588-private.pem.key", certPath: "./certs/3fdf14d588-certificate.pem.crt", caPath: "./certs/root-CA.crt", clientId: "NodePublisher1", region: "us-east-1", host: "<your end point>.iot.us- east-1.amazonaws.com" });
  • 38. AWS IoT Node.js SDK device .on('connect', function() { console.log('connect'); device.subscribe('iotbutton/+') setInterval(function() { console.log('publishing...'); device.publish('iotbutton/ABCD', JSON.stringify({ clickType: "SINGLE", batteryVoltage: '999mV'})); console.log('done.'); }, 2000) });
  • 39. AWS IoT Node.js SDK device .on('message', function(topic, payload) { console.log('message', topic, payload); }); device .on('close', function() { console.log('close'); }); device .on('reconnect', function() { console.log('reconnect'); }); device .on('offline', function() { console.log('offline'); }); device .on('error', function(error) { console.log('error', error); });
  • 40. Closing Thoughts • AWS IoT is a low-latency, scalable pub/sub service. • A rules engine to connect devices with no code. • Can pub/sub over WSS • In a way, it is AWS’s only infinitely scalable WebSocket service gateway into Lambda. • But (there is always a but), its security model is complex and cumbersome at best. Certs/SigV4. No built-in Websocket security or ability to custom JWT AuthHeader etc.
  • 41. Closing Thoughts IoT on the Edge and The Fog...
  • 42. AWS Greengrass •AWS Greengrass seamlessly extends AWS to devices so they can act locally on the data they generate •Respond to Local Events in Near Real-time •Operate Offline
  • 43. An Intro to AWS IoT Scott Stewart https://github.com/csr-aws-ug/aws_iot_intro