getting started with aws iot - september 2016 webinar series

49
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Michael Garcia, Sr. Technical Program Manager AWS IoT September 29, 2016 AWS IoT Getting Started @michaelgarcia__

Upload: amazon-web-services

Post on 22-Jan-2018

1.687 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Getting Started with AWS IoT - September 2016 Webinar Series

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Michael Garcia, Sr. Technical Program Manager AWS IoT

September 29, 2016

AWS IoTGetting Started

@michaelgarcia__

Page 2: Getting Started with AWS IoT - September 2016 Webinar Series

Today’s webinar

Hands-On

AWS IoT

Get started !

AWS IoT Starter Kit

Page 3: Getting Started with AWS IoT - September 2016 Webinar Series
Page 4: Getting Started with AWS IoT - September 2016 Webinar Series

Challenges

Many SDKs &

Tools

Scalability Security &

Management

Cloud Powered

Apps

Big Data & Analytics &

predictions

Page 5: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT

DEVICE SDKSet of client libraries to

connect, authenticate and

exchange messages

DEVICE GATEWAYCommunicate with devices via

MQTT

AUTHENTICATION

AUTHORIZATIONSecure with mutual

authentication and encryption

RULES ENGINETransform messages

based on rules and

route to AWS Services

AWS Services

- - - - -

3P Services

DEVICE SHADOWPersistent thing state

during intermittent

connections

APPLICATIONS

AWS IoT API

HTTP

DEVICE REGISTRYIdentity and Management of

your things

Page 6: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT

DEVICE SDKSet of client libraries to

connect, authenticate and

exchange messages

Page 7: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Device SDKs

Arduino Yún

Arduino

Mobile SDKs

Android and iOS

C-SDK

RTOS, μControllers

JS-SDK

Embedded Platforms

Java

Embedded Platforms

Python

Embedded Platforms

https://aws.amazon.com/iot/sdk/

Page 8: Getting Started with AWS IoT - September 2016 Webinar Series

Security and Identity

AUTHENTICATIONSecure with mutual

authentication and encryption

Page 9: Getting Started with AWS IoT - September 2016 Webinar Series

Security and Identity

TLS Mutual Authentication

Fine-Grained Permissions through Policies

Standard Web Security

Page 10: Getting Started with AWS IoT - September 2016 Webinar Series

Mutual Auth TLSwww.mywebsite.com

- Secure Pipe

- Anonymous

- Secure Bi-Directional Pipe

- Mutual Proof of Identity

Page 11: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Authentication & Authorization

Page 12: Getting Started with AWS IoT - September 2016 Webinar Series

Device Gateway

Page 13: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Message Broker

Page 14: Getting Started with AWS IoT - September 2016 Webinar Series

MQTT

MQTT vs HTTPS:

• 93x faster throughput

• 11.89x less battery to send

• 170.9x less battery to receive

• 50% less power to keep connected

• 8x less network overhead

Source:

http://stephendnicholas.com/archives/1217

• OASIS standard protocol (v3.1.1)

• Lightweight, pub-sub, transport protocol

that is useful for connected devices

• MQTT is used on oil rigs, connected

trucks, and many more sensitive and

resource-sensitive scenarios

• Customers have needed to build,

maintain, and scale a broker to use

MQTT with cloud applications

Page 15: Getting Started with AWS IoT - September 2016 Webinar Series

MQTT

Publishers SubscribersTOPIC

‘mytopic’

Publish to ‘mytopic’ Subscribe to ‘mytopic’

Page 16: Getting Started with AWS IoT - September 2016 Webinar Series

MQTT

Publishers SubscribersTOPIC

‘mytopic’

Page 17: Getting Started with AWS IoT - September 2016 Webinar Series

MQTT

Publishers SubscribersTOPIC

‘mytopic1’

‘mytopic2’

‘mytopic3’

Page 18: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Message Broker : managed service

Highly Scalable

Device Gateway

Millions of devices

sending billions of

messages

SubscribersPublishers

Page 19: Getting Started with AWS IoT - September 2016 Webinar Series

Device Registry

THING REGISTRYIdentity and Management of

your things

Page 20: Getting Started with AWS IoT - September 2016 Webinar Series

Device Registry

$ aws --region us-east-1 iot describe-thing --thing-name pump1

{

"attributes": {

"MN": "AB776",

"install_date": "12-23-2011",

"SN": "225458854"

},

"thingName": "pump1",

"defaultClientId": "pump1"

}

Page 21: Getting Started with AWS IoT - September 2016 Webinar Series

Device Shadows

THING SHADOWPersistent thing state

during intermittent

connections

Page 22: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Device Shadows

Page 23: Getting Started with AWS IoT - September 2016 Webinar Series

Device Shadows

{

"state" : {

“desired" : {

"lights": { "color": "RED" },

"engine" : "ON"

},

"reported" : {

"lights" : { "color": "GREEN" },

"engine" : "ON"

},

"delta" : {

"lights" : { "color": "RED" }

} },

"version" : 10

}

Thing

Report its current state to one or multiple shadow

Retrieve its desired state from shadow

Mobile App

Set the desired state of a device

Get the last reported state of the device

Delete the shadow

Shadow

Shadow reports delta, desired

and reported states along with metadata and version

Page 24: Getting Started with AWS IoT - September 2016 Webinar Series

Device Shadows{

"state" : {

“desired" : {

"engine" : "ON”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"reported" : {

"engine" : ”OFF”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"version" : 10

}

Page 25: Getting Started with AWS IoT - September 2016 Webinar Series

Device Shadows{

"state" : {

“desired" : {

"engine" : ”OFF”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"reported" : {

"engine" : ”OFF”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"delta" : {

”engine" : “ON”

} },

"version" : 10

}

"engine" : ”OFF”

Page 26: Getting Started with AWS IoT - September 2016 Webinar Series

Device Shadows{

"state" : {

“desired" : {

"engine" : "ON”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"reported" : {

"engine" : ”OFF”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"delta" : {

”engine" : “ON”

} },

"version" : 10

}

"engine" : ”ON”

Page 27: Getting Started with AWS IoT - September 2016 Webinar Series

Device Shadows{

"state" : {

“desired" : {

"engine" : "ON”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"reported" : {

"engine" : ”OFF”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"delta" : {

”engine" : “ON”

} },

"version" : 10

}

"engine" : "ON”

Page 28: Getting Started with AWS IoT - September 2016 Webinar Series

Device Shadows{

"state" : {

“desired" : {

"engine" : "ON”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"reported" : {

"engine" : ”ON”,

“tires”: {

“LF”:40,

“RF”:38,

“LR”:37,

“RR”:39

},

“CCD”: {

“A”:0,

“B”:8,

“C”:7,

“D”:9

}

},

"version" : 10

}

"engine" : "ON”

Page 29: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Rules Engine actions

RULES ENGINETransform messages

based on rules and

route to AWS Services

AWS Services

- - - - -

3P Services

AWS Services

- - - - -

3P Services

Page 30: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Rules Engine

Page 31: Getting Started with AWS IoT - September 2016 Webinar Series

Rules Engine

building1/chillers/xx881

building1/fans/aj982

building3/chillers/ks434

building1/radiators/ss243

building2/chillers/fe324

"sql": "SELECT * FROM 'building1/#'"

"actions": [{ "dynamoDB":….

Page 32: Getting Started with AWS IoT - September 2016 Webinar Series

Rules Engine

building1/chillers/xx881

building1/fans/aj982

building3/chillers/ks434

building1/radiators/ss243

building2/chillers/fe324

"sql": "SELECT * FROM 'building1/#'"

"actions": [{ "dynamoDB":….

Page 33: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Rules Engine

SELECT DATA FROM TOPIC WHERE FILTER

THEN ACTION

Page 34: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT – SQL Reference

SELECT DATA FROM…

• SELECT *

• SELECT deviceid, temp

• SELECT coords.latitude

• SELECT a.another_level.b

• Returns {“b” : 3}

• SELECT a..b

• Returns {“b” : 3}

{

“deviceid” : “iot123”,

“temp” : 54,

“humidity” : 32,

“coords” : {

“latitude” : 47.615694,

“longitude” : -122.3359976

},

“a” : {

“another_level” : {

{“b” : 3},

{“b” : 5}

}}

}

SAMPLE PAYLOAD

Page 35: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT – SQL Reference

SELECT DATA FROM…

• SELECT deviceid AS client

• SELECT md5(deviceid) AS hashed_id

Substitution Templates

• ${expression}

• ${topic() - md5(deviceid)}

• ${deviceid - temp}

{

“deviceid” : “iot123”,

“temp” : 54,

“humidity” : 32,

“coords” : {

“latitude” : 47.615694,

“longitude” : -122.3359976

},

“a” : {

“another_level” : {

{“b” : 3},

{“b” : 5}

}}

}

SAMPLE PAYLOAD

Page 36: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT – SQL Reference

SELECT DATA FROM TOPIC WHERE FILTER

• Like scanning a database table

• Default source is an MQTT topic

EXAMPLES:

• FROM mqtt(‘my/topic’)

• FROM mqtt(‘my/wildcard/+/topic’)

• FROM (‘my/topic’)

Page 37: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT – SQL Reference

SELECT DATA FROM TOPIC WHERE FILTER

Token Meaning Example

= Equal, comparison color = 'red'

<> Not Equal, comparison color <> 'red'

AND Logical AND color = 'red' AND siren = 'on'

OR Logical OR color = 'red' OR siren = 'on'

() Parenthesis, grouping color = 'red' AND (siren = 'on' OR isTest)

+ Addition, arithmetic 5 + 3

- Substitution, arithmetic 5 - 4

/ Division, arithmetic 8 / 2

Page 38: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT – SQL Reference

SELECT DATA FROM TOPIC WHERE FILTER

THEN ACTION

LambdaSNS SQS

S3 Amazon KinesisDDB RDS

Amazon

Redshift

Amazon Glacier

EC2

3rd party

Page 39: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Starter Kit

Page 40: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Button

https://aws.amazon.com/iot/button/

Page 41: Getting Started with AWS IoT - September 2016 Webinar Series

AWS IoT Starter Kits

Page 42: Getting Started with AWS IoT - September 2016 Webinar Series

Hands-On

Page 43: Getting Started with AWS IoT - September 2016 Webinar Series

Hands-On !

Page 44: Getting Started with AWS IoT - September 2016 Webinar Series

Get started !

Page 45: Getting Started with AWS IoT - September 2016 Webinar Series

Pricing

• Pay as you go. No minimum fees.

• $5 per million messages published to, or delivered

by, AWS IoT.

• Free Tier: 250,000 messages per month for 12

months.

AWS IoT

https://aws.amazon.com/

Page 46: Getting Started with AWS IoT - September 2016 Webinar Series

Re:Invent 2015 Mobile & IoT

Source:

https://www.youtube.com/playlist?list=PLhr1KZpdzukcBfuUdMOKc94mnrQhBpdmw

Page 47: Getting Started with AWS IoT - September 2016 Webinar Series

Resources

http://aws.amazon.com/iot/developer-resources/

http://aws.amazon.com/iot/getting-started/

Page 48: Getting Started with AWS IoT - September 2016 Webinar Series

Monday, October 24, 2016

JW Marriot Austin

https://aws.amazon.com/events/devday-

austin

Free, one-day developer event featuring tracks, labs,

and workshops around Serverless, Containers, IoT,

and Mobile

Page 49: Getting Started with AWS IoT - September 2016 Webinar Series

Thank you!