47
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Constantin Gonzalez, Jan Metzner, Ricardo DeMatos, AWS Danny Williams, Mark Sparks, Monsanto October 2015 From Drones to Cars Connecting the Devices in Motion to the Cloud MBL203

(MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Embed Size (px)

Citation preview

Page 1: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

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

Constantin Gonzalez, Jan Metzner, Ricardo DeMatos, AWS

Danny Williams, Mark Sparks, Monsanto

October 2015

From Drones to CarsConnecting the Devices in Motion to the Cloud

MBL203

Page 2: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

What to Expect from the Session

• Understand the challenges

• Architecture building blocks

• Architecture patterns

• Examples

• Demos

• Practical experience and guidelines

Page 3: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

IoT in Motion at MonsantoDanny Williams, @djwilli3Mark Sparks, @markdsparks Monsanto IoT, @MonsantoIoT

Page 4: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

IoT creates new opportunities in precision agriculture

4

Plan Experiment

Plant

Monitor/applyHarvest

Analyze

Page 5: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Monsanto tests products all around the world

5

Data needs to be reliably gathered from various equipment in remote locations where data connectivity is unreliable

Plan

Plant

MonitorHarvest

Analyze

Plan

Plant

MonitorHarvest

Analyze

Plan

Plant

MonitorHarvest

Analyze

Plan

Plant

MonitorHarvest

Analyze

Plan

Plant

MonitorHarvest

Analyze

Page 6: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

The formula for reliable data transfer and processing

6

Store and forward on

edge

Low overhead communication

protocol

Broker-based processing in

cloud

Page 7: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Data ingestion and storage

Analytics Cloud code

Communication

Rest API Visualizations

HTTP

Page 8: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Demo

FIELDDRIVE

Page 9: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

9

Page 10: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices in motion

Page 11: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices in motion carry a lot of value

• Automated harvesting

• Automated transport

• Connected cars and vehicles

• Aviation

• Sports, gaming, leisure

• Medical and public service

• Tourism

Page 12: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Technical characteristics

• Mobile networks: kBit/s

• Lightweight:

Every gram, every watt counts

Low RAM, low CPU, low power

• Near real-time: Seconds count

• Location-based

• Large-impact use cases

Page 13: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Dash streams more than 1 TB of real-time data per day

Dash connects your smartphone to your car with a

simple, low-cost device which provides real-time road

safety information to drivers.

As a startup, using AWS has

allowed us to scale nicely and use

resources without spending a lot

of capital.

Brian Langel

CTO, Dash

“ • Real-time information for drivers

• Streams more than 1 TB of real-time

data per day over Amazon Kinesis

• Processes billions records using

Amazon DynamoDB

• Thousands of updates per second

during spikes

• Reduced operating costs by

$200,000 per year

Page 14: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices in motion: Challenges

• How to handle constrained resources?

• How to manage millions of things?

• How to communicate securely?

• How to deal with unreliable connections?

• How to handle geo-location?

• How to deal with map data?

?

Page 15: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices in motion: Challenges

• How to handle constrained resources?

• How to manage millions of things?

• How to communicate securely?

• How to deal with unreliable connections?

• How to handle Geo-Location?

• How to deal with map data?

?

Page 16: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

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 17: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices in motion: Challenges

• How to handle constrained resources?

• How to manage millions of things?

• How to communicate securely?

• How to deal with unreliable connections?

• How to handle Geo-Location?

• How to deal with map data?

?✔

Page 18: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Highly scalable

Pub/Sub broker

MQTT

Subscribers

Publishers

Secure by defaultConnect securely via X509 certs and

TLS v1.2 client mutual auth

Multi-protocol message gatewayMillions of devices and apps can connect

over MQTT or HTTP

topicElastic Pub/Sub brokerGo from 1 to 1 billion long-lived, bi-directional

connections with zero provisioning

AWS IoT: Securely connect devices

Page 19: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices

Apps

Secure

Pub/Sub

broker

AWS IoT Pub/Sub broker

Page 20: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

1. AWS services

(direct integration)

Rules Engine

Actions

AWS IoT Rules Engine

LambdaSNS SQS

S3 Amazon KinesisDDB RDS

Amazon Redshift

Amazon

Glacier

EC2

3. External endpoints

(via Lambda and SNS)

Rules Engine connects AWS

IoT to external endpoints and

AWS services.

2. Rest of AWS(via Amazon Kinesis, Lambda,

S3, and more)

Page 21: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices in motion: Challenges

• How to handle constrained resources?

• How to manage millions of things?

• How to communicate securely?

• How to deal with unreliable connections?

• How to handle Geo-Location?

• How to deal with map data?

?✔✔

Page 22: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

AWS IoT security

Authentication Authorization

MQTT/HTTP over TLS v1.2

(X.509 certs) cipher suites

TLS mutual auth:

(Client/server certificates for things)

HTTPS over sigv4 (for apps)

Amazon Cognito/IAM (for mobile apps)

Certificates are attached to policies

Policies (JSON) give granular access

to AWS IoT control and data plane

Policies allow and deny permissions on

specific resources

(rules, shadows, topics)

Page 23: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices

Apps

Secure

Pub/Sub

broker

AWS IoT Pub/Sub broker

MQTT/TLSMQTT/TLS

Page 24: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices in motion: Challenges

• How to handle constrained resources?

• How to manage millions of things?

• How to communicate securely?

• How to deal with unreliable connections?

• How to handle Geo-Location?

• How to deal with map data?

?✔✔✔

Page 25: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

AppsShadow

Secure

Pub/Sub

broker

Thing SDK

AWS IoT Device Shadows

Page 26: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

AWS IoT Device Shadows flow

Shadow

Thing

SDK

1. Device publishes current state

2. Persist JSON data store

3. App requests device’s current state

4. App requests change the state5. Device Shadow syncs

updated state

6. Device publishes current state7. Device Shadow confirms state change

Page 27: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices in motion: Challenges

• How to handle constrained resources?

• How to manage millions of things?

• How to communicate securely?

• How to deal with unreliable connections?

• How to handle geo-location?

• How to deal with map data?

?✔✔✔✔

Page 28: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Geo-location and mapping use cases

• Tracking

• Geo-fencing

• Find nearby objects

• Alert nearby things

• Map matching

• Routing

Page 29: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Geohashing

• Easy to compute

• Arbitrary precision

• Similar positions yield

similar prefixes

• Removing characters reduces

precision

• Simple way to look up and manage

geo objects

Picture: https://github.com/stephenlb/geohash-chat-by-proximity

Page 30: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Distribute messages to geo-located things with

topic tiles

• One topic per geohash

• Things subscribe to their

current geohash tile’s topic

as they move

• Send messages to tile topics

• Use geohash lengths to

change area impact of

message

Page 31: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Geo library for Amazon DynamoDB

• Ready-to-use Java JAR

• Library and sample apps

available on GitHub

• Supports GeoJSON

• Uses geohashes for

DynamoDB local

secondary indexes

• Simplifies box and radius

queries

Page 32: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

AWS IoT Service and DynamoDB with

Geohashing Architecture

Rules Engine

Send

lat/lon AWS Lambda +

Geo library for

Amazon DynamoDB

Look up

geohash

Moving

thing

Amazon

DynamoDB

Return

matches

1 2

34

5

Page 33: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Amazon RDS for PostgreSQL with PostGIS

• Powerful support for:

• Geo data formats

• Geometric projections

• Transform operations

• Query functions

• Well understood, easy

to use

• Supported on Amazon

RDS for PostgreSQL

Page 34: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

AWS IoT and Amazon RDS for PostgreSQL

Rules Engine

Send

lat/lon AWS Lambda

Geo-

queries

Moving

thing

Amazon RDS

for PostgreSQL

Return

matches

1 2

34

5

Page 35: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Processing map graphs with TitanDB

• Scalable graph database

• Import maps as graphs

• Supports routing and

other complex map

queries

• Amazon DynamoDB

storage back end for

TitanDB available

Page 36: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

AWS IoT and

Amazon DynamoDB for TitanDB

Rules Engine

Send

lat/lon AWS Lambda

Map

queries

Moving

thing

Amazon

DynamoDB

Return

matches

1 2

34

5

TitanDB +

Amazon DynamoDB

back end

Page 37: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Amazon Elasticsearch Service

• Powerful, real-time, distributed, open-source

• Supports geolocation searches:

• Geo-points, geohashes, geo-aggregations, geoshapes

Amazon Elasticsearch Service

• Managed service

• Easy to set up, scale, operate

Page 38: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

AWS IoT and Amazon Elasticsearch Service

architecture

Rules Engine

Send

lat/lon AWS Lambda

Run

queries

Moving

thing

Amazon

Elasticsearch

Service

Return

matches

1 2

34

5

Page 39: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Devices in motion: Challenges

• How to handle constrained resources?

• How to manage millions of things?

• How to communicate securely?

• How to deal with unreliable connections?

• How to handle geo-location?

• How to deal with map data?

✔✔✔✔✔✔

Page 40: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Summary

• Use AWS IoT to manage and communicate with your

things

• Scalable, easy to use MQTT pub/sub message broker

• Powerful AWS IoT Rules Engine

• Use AWS IoT Device Shadows for unreliable connections

• Take advantage of AWS Lambda to connect to geo-aware

services:

• Amazon DynamoDB with geohash and/or TitanDB support

• Amazon RDS for PostgreSQL with PostGIS

• Amazon Elasticsearch Service

Page 41: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Demo: Connected car safetyRicardo DeMatos, AWS

Page 42: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

http://www.iteris.com/cvria/html/applications/app74.html#tab-3

Page 43: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

https://github.com/smartdevicelink

Page 44: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

OBE

Vehicle

RSE

Notification

function

DMS

Vehicle

GIS

Rules engineRules engineNotification

topic

Traffic information center

Partner notification

Shadow

Reported

state

Reported

state

Desired

state

Environment

situation

stream

Traffic incident

service

OBE

Prediction API

Reported

state

Desired

state

Desired

state

Page 45: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Don’t Miss These Other AWS IoT Deep Dive Talks!

• MBL203 State of the Union – San Polo 3501B 11:00 AM

• MBL203 Everything about AWS IoT – Venetian H 12:15 PM

• MBL311 AWS IoT Security – Palazzo A 1:30 PM

• MBL312 Rules and Shadow – Palazzo A 2:45 PM

• MBL313 Devices SDK and Kits – Palazzo A 4:15 PM

• MBL303 Mobile Devices and IoT – Delfino 4005 4:15 PM

• MBL305 IoT Data and Analytics – Delfino 4005 11:30 AM

Page 46: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Remember to complete

your evaluations!

Page 47: (MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud

Thank you!