the connected home: managing and innovating with offline devices

45
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Markku Lepistö - Principal Technology Evangelist The Connected Home Managing and Innovating with Offline Devices

Upload: amazon-web-services

Post on 14-Apr-2017

272 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: The Connected Home: Managing and Innovating with Offline Devices

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

Markku Lepistö - Principal Technology Evangelist

The Connected Home

Managing and Innovating with Offline Devices

Page 2: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

Security – IoT Requirements

Strong Authentication

Fine Grained Authorization

Secure Communication

Page 4: The Connected Home: Managing and Innovating with Offline Devices

Security – IoT Requirements

Strong Authentication

Secure Communication

Page 5: The Connected Home: Managing and Innovating with Offline Devices

Security – IoT Requirements

Strong Authentication

Secure Communication

Page 6: The Connected Home: Managing and Innovating with Offline Devices

Security – IoT Requirements

Strong Authentication

Secure Communication

Protect your Keys

Page 7: The Connected Home: Managing and Innovating with Offline Devices

Security – IoT Requirements

Strong Authentication

Secure Communication

Page 8: The Connected Home: Managing and Innovating with Offline Devices

Security – Secure Device

SDKs make it easy to be secure

TLS Mutual Authentication

We package a TLS software library with embedded C

Page 9: The Connected Home: Managing and Innovating with Offline Devices

Protocols / Interaction

Device Shadow

Page 10: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

Protocols – MQTT – Use Cases

mydevices/#

mydevices/1

mydevices/2

mydevices/3

Page 12: The Connected Home: Managing and Innovating with Offline Devices

Protocols – MQTT – Use Cases

mydevices/4

mydevices/4

Page 13: The Connected Home: Managing and Innovating with Offline Devices

Protocols – MQTT – Use Cases

mydevices/4

mydevices/4

Page 14: The Connected Home: Managing and Innovating with Offline Devices

Protocols – MQTT – Use Cases

mydevices/to_all

mydevices/to_all

Page 15: The Connected Home: Managing and Innovating with Offline Devices

Protocols – MQTT – QoS 0

1

2

3

4

5

61,2,3,5,6

Page 16: The Connected Home: Managing and Innovating with Offline Devices

Protocols – MQTT – QoS 1

1

2

3

4

5

41,2,3,4,5,6

6

Page 17: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

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: The Connected Home: Managing and Innovating with Offline Devices

Getting Started with AWS IoT

How do I get started?

AWS IoT SDKs IoT Starter Kits

Page 26: The Connected Home: Managing and Innovating with Offline Devices

Getting Started – SDKs

Arduino (Arduino Yún)

Node.js (Ideal for Embedded Linux)

C – Embedded (Ideal for embedded OS)

Page 27: The Connected Home: Managing and Innovating with Offline Devices

Getting Started – Arduino Yún SDK

Arduino IDE

Libraries

Hardware Ecosystem

Page 28: The Connected Home: Managing and Innovating with Offline Devices

Getting Started – Arduino Yún SDK

Page 29: The Connected Home: Managing and Innovating with Offline Devices

Getting Started – Node.js SDK

Easy install with NPM

Supports Embedded

Linux Boards

High level, but easy

access to hardware

Page 30: The Connected Home: Managing and Innovating with Offline Devices

Getting Started – Node.js SDK

Page 31: The Connected Home: Managing and Innovating with Offline Devices

Getting Started – Embedded C SDK

Deeply embedded

Port to your platform

Delivered as source

w/ POSIX port

Page 32: The Connected Home: Managing and Innovating with Offline Devices

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 33: The Connected Home: Managing and Innovating with Offline Devices

Official IoT Starter Kits, Powered by AWS

Page 34: The Connected Home: Managing and Innovating with Offline Devices

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 35: The Connected Home: Managing and Innovating with Offline Devices

Demo

Connected Home Telemetry Control

Page 36: The Connected Home: Managing and Innovating with Offline Devices
Page 37: The Connected Home: Managing and Innovating with Offline Devices

Temperature & Humidity Telemetry

AWS IoT

Intel

Edison

Shadow

Temp & Humi

Sensor

Page 38: The Connected Home: Managing and Innovating with Offline Devices

Demo

Page 39: The Connected Home: Managing and Innovating with Offline Devices
Page 40: The Connected Home: Managing and Innovating with Offline Devices

Controlling the Lights

Chip

AWS IoT

Intel

EdisonLambda

RelayState: True

Shadow

Publish

Rules

SNS

Page 41: The Connected Home: Managing and Innovating with Offline Devices

Demo

Page 42: The Connected Home: Managing and Innovating with Offline Devices
Page 43: The Connected Home: Managing and Innovating with Offline Devices

Voice Control

Chip

AWS IoT

Intel

EdisonLambda Function

Implements

Alexa Skill: Edison

Utterances: switch the

light on/off

RelayState: True

Shadow

Voice command: ‘Alexa – tell Edison to switch the light on’

Alexa SDK

Success response:

Say: ‘I switched the

light for you’

Call Skill

Page 44: The Connected Home: Managing and Innovating with Offline Devices

AWS IoT

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

Page 45: The Connected Home: Managing and Innovating with Offline Devices