(mbl313) new! aws iot: understanding hardware kits, sdks, & protocols

50
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Markku Lepisto John Rotach October 8, 2015 AWS IoT Deep Dive Understanding Hardware Platforms, Devices SDKs and Protocols MBL313

Upload: amazon-web-services

Post on 08-Jan-2017

3.777 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

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

Markku Lepisto

John Rotach

October 8, 2015

AWS IoT Deep DiveUnderstanding Hardware Platforms,

Devices SDKs and Protocols

MBL313

Page 2: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

AWS IoT

Any device can connect securelyAnyone can connect a device Getting started is easy

“Securely connect one or one-billion devices to AWS,

so they can interact with applications and other devices”

Page 3: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Security – IoT Requirements

Strong Authentication

Fine Grained Authorization

Secure Communication

Page 4: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Security – IoT Requirements

Strong Authentication

Secure Communication

Page 5: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Security – IoT Requirements

Strong Authentication

Secure Communication

Page 6: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Security – IoT Requirements

Strong Authentication

Secure Communication

Protect your Keys

Page 7: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Security – IoT Requirements

Strong Authentication

Secure Communication

Page 8: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Security – Secure Device

SDKs make it easy to be secure

TLS Mutual Authentication

We package a TLS software library with embedded C

Page 9: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols / Interaction

Device Shadow

Page 10: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – MQTT

MQTTS 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 11: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – MQTT – Use Cases

mydevices/#

mydevices/1

mydevices/2

mydevices/3

Page 12: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – MQTT – Use Cases

mydevices/4

mydevices/4

Page 13: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – MQTT – Use Cases

mydevices/4

mydevices/4

Page 14: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – MQTT – Use Cases

mydevices/to_all

mydevices/to_all

Page 15: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – MQTT – QoS 0

1

2

3

4

5

61,2,3,5,6

Page 16: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – MQTT – QoS 1

1

2

3

4

5

41,2,3,4,5,6

6

Page 17: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – MQTT – Keep Alive

PINGREQ

PINGRESP

Although TCP/IP in theory notifies you when a socket breaks, in practice, particularly on

things like mobile and satellite links, which often “fake” TCP over the air and put

headers back on at each end, it’s quite possible for a TCP session to “black hole”, i.e. it

appears to be open still, but in fact is just dumping anything you write to it onto the floor.

Andy Stanford-Clark on the topic “Why is the keep-alive needed?“ *

* https://groups.google.com/forum/#!msg/mqtt/zRqd8JbY4oM/XrMwlQ5TU0EJ

Page 18: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – AWS IoT Shadow

{

"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 19: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – AWS IoT Shadow Topics (MQTT)

$aws/things/{thing}/shadow/…

Publish

…/get: to get the latest shadow state

…/update: to update the shadow state

…/delete: to remove the shadow state

Subscribe

…/accepted: shadow accepted message

…/rejected: shadow rejected message

…/delta: differences between desired and reported

DEVICE SHADOWPersistent thing state

during intermittent

connections

Page 20: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – AWS IoT Shadow Use Case{

"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 21: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – AWS IoT Shadow Use Case{

"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 22: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – AWS IoT Shadow Use Case{

"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" : ”OFF”

Page 23: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – AWS IoT Shadow Use Case{

"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 24: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Protocols – AWS IoT Shadow Use Case{

"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

}

"engine" : "ON”

Page 25: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Getting Started with AWS IoT

How do I get started?

AWS IoT SDKs IoT Starter Kits

Page 26: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Getting Started – SDKs

Arduino (Arduino Yún)

Node.js (Ideal for Embedded Linux)

C – Embedded (Ideal for embedded OS)

Page 27: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Getting Started – Arduino Yún SDK

Arduino IDE

Libraries

Hardware Ecosystem

Page 28: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Getting Started – Arduino Yún SDK

Page 29: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Demo – Build your own AWS IoT Button

SELECT * FROM sdk/rules/lambda

Action: Lambda

Page 30: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Getting Started – Node.js SDK

Easy install with NPM

Supports Embedded

Linux Boards

High level, but easy

access to hardware

Page 31: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Getting Started – Node.js SDK

Page 32: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Getting Started – Embedded C SDK

Deeply embedded

Port to your platform

Delivered as source

w/ POSIX port

Page 33: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Getting Started –Embedded C SDK

Memory Conscious

TLS

MQTT Client

Shadow SDK

Examples

Page 34: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

C SDK Porting – SDK Architecture

Hardware / OS

Timer Interface

MQTT Interface / Client

Custom Application

TLS Interface

Layered

Well-defined Interfaces

Porting Points

Thing Shadow

Page 35: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

C SDK Porting – SDK Architecture

Hardware / OS

Timer Interface

MQTT Interface / Client

Custom Application

TLS Interface

Your application

The soul of the device

Thing Shadow

Page 36: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

C SDK Porting – SDK Architecture

Hardware / OS

Timer Interface

MQTT Interface / Client

Custom Application

TLS Interface

Shadow SDK

Subscription Management

Version Tracking

Client Tokens

JSON Helpers

Thing Shadow

Page 37: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

C SDK Porting – SDK Architecture

Hardware / OS

Timer Interface

MQTT Interface / Client

Custom Application

TLS Interface

Embedded MQTT Client

Interfaces

Thing Shadow

Page 38: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

C SDK Porting – SDK Architecture

Hardware / OS

Timer Interface

MQTT Interface / Client

Custom Application

TLS InterfaceYou know how timers work

on your system

Thing Shadow

Page 39: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

C SDK Porting – SDK Architecture

Hardware / OS

Timer Interface

MQTT Interface / Client

Custom Application

TLS Interface

Interface to the network

Raw sockets

TLS implementation included

Thing Shadow

Page 40: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

C SDK Porting – SDK Architecture

Hardware / OS

Timer Interface

MQTT Interface / Client

Custom Application

TLS Interface

Your hardware

Thing Shadow

Page 41: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Demo of C SDK

Timers

Network

Yield()

Time on the device

Page 42: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Getting Started – Porting Story

Board Manufacturers

TLS + MQTT

Shadow

Pub/Sub - 8kb code, 4k RAM

Shadow – 11kb code, 6k RAM

(MQTT and SDK, no TLS, TCP/IP)

Page 43: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Official IoT Starter Kits, Powered by AWS

Page 44: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Official IoT Starter Kits on Variety of Platforms

Broadcom WICED

BCM4343W

On Threadx/Netx

Marvell

EZConnect

MW302

On FreeRTOS

Renasas RX63N

On Micrium OS

TI CC3200

On TI-RTOSMicrochip WCM

PIC32 Platform

Intel Edison

on Yocto Linux

Mediatek

LinkOne

on Linkit OS

Dragonboard

410c on

Ubuntu

Seeeduino

Arduino on

openWRT

Beaglebone

Green on

Debian

Page 45: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

DemoEnd-to-end Solution

Page 46: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols
Page 47: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Earthquake Monitoring

Marvell

MW300

MediaTek

LinkIt ONE

Arduino

Yún

AWS IoT

Topics

Rules

Amazon KinesisAll

Amazon

SNS> 5 G

Intel

EdisonAWS Lambda

State: Alarm

Shadow

Page 48: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

AWS IoT

Any device can connect securelyAnyone can connect a device Getting started is easy

Page 49: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Thank you!

Page 50: (MBL313) NEW! AWS IoT: Understanding Hardware Kits, SDKs, & Protocols

Remember to complete

your evaluations!