Making your washing machine talk with a power plant

42
@matteocollina Making your Washing Machine Talk with a Power Plant

Transcript of Making your washing machine talk with a power plant

Page 1: Making your washing machine talk with a power plant

@matteocollina

Making your Washing Machine Talk with a

Power Plant

Page 2: Making your washing machine talk with a power plant
Page 3: Making your washing machine talk with a power plant

What was the greatest invention of the Industrial

Revolution?

Page 4: Making your washing machine talk with a power plant

Washing Machines

http://www.flickr.com/photos/gnarlsmonkey/260809150

Page 5: Making your washing machine talk with a power plant

• We all need laundry

• 10% jobs destroyed

• Women were freed from their laundry, and can now have a job

• Watch this awesome TED talk by Hans Rosling.

Page 6: Making your washing machine talk with a power plant

What form of energy would you choose?

http://www.flickr.com/photos/tommy-ironic/3437613067

http://www.flickr.com/photos/jalte/1687116108

http://www.flickr.com/photos/mikeweston/1462086624

Page 7: Making your washing machine talk with a power plant

Would you postpone your laundry to use a different energy source?

http://500px.com/photo/47496528

Page 8: Making your washing machine talk with a power plant

How

Page 9: Making your washing machine talk with a power plant

Let’s connect all the things!!

Page 10: Making your washing machine talk with a power plant

Pidgeons are not a communication protocol

See RFC1149http://500px.com/photo/32895129

Page 11: Making your washing machine talk with a power plant
Page 12: Making your washing machine talk with a power plant

Pop-up Dialog

OK

This message come from the thing!

Cancel

!???

"#

$%

We code a program that reacts to real-world events

A new communication paradigm

Page 13: Making your washing machine talk with a power plant

Pop-up Dialog

OK

This message come from the thing!

Cancel

!???

"#

$%

We want to receive live data from the things

A new communication paradigm

Page 14: Making your washing machine talk with a power plant

Pop-up Dialog

OK

This message come from the thing!

Cancel

!???

"#

$%

Publish

Publish !

How can we know which user should be notified?

A new communication paradigm

Page 15: Making your washing machine talk with a power plant

A new communication paradigm

Pop-up Dialog

OK

This message come from the thing!

Cancel

!???

"#

$% Publish

Publish

Tap Subscribe

Page 16: Making your washing machine talk with a power plant

Problems

1. Application Protocols

2. Data Formats

3. Device Identification and Privacy

Developing IoT applications is hard for the developer. Why?

Page 17: Making your washing machine talk with a power plant

Application Open Protocols

Pattern Live Updates Format Transport

HTTP REST with custom protocol over Websocket

textual with binary support TCP

CoAP REST with observe spec binary UDP

MQTT Pub/Sub Yes binary TCP

Problems

Page 18: Making your washing machine talk with a power plant

.ORG CoAP

• Developed by IBM, in standardization at OASIS

• In standardization by the IETF as Constrained Application Protocol (CoAP)

• Various levels of QoS 0, 1, 2 • Optional confirmable messages

• Offline support • Partial offline support through a proxy

• Retained Messages • Multicast support

Page 19: Making your washing machine talk with a power plant

.ORG CoAP

Client/Server Architecture P2P Architecture

Page 20: Making your washing machine talk with a power plant

Data FormatsEncdoding Tipology

XML textual Tree-Based, values as strings

EXI binary Tree-Based, different data types

N3/RDF textual Graph-Based, values as strings

JSON textual Object-Oriented, values as strings

MsgPack binary Object-Oriented, different data types

ProtoBuf binary Object-Oriented, different data types

Bysant binary Object-Oriented, different data types

BSON binary Object-Oriented, different data types

Problems

Page 21: Making your washing machine talk with a power plant

Device Identification & Privacy

• What devices can a user monitor?

• What devices can 'listen' to the state of other devices?

• Who can access the devices state?

• Is the communication secure?

Problems

Page 22: Making your washing machine talk with a power plant

http://eclipse.org/ponte

Page 23: Making your washing machine talk with a power plant

http://500px.com/photo/26425201

We want to bring developers to the

(real) world.

Page 24: Making your washing machine talk with a power plant
Page 25: Making your washing machine talk with a power plant

API

http(s)://<your ponte>/resources/<your thing> !coap://<your ponte>/r/<your thing> !mqtt(s)://<your ponte>/<your thing>

Use retained messages in MQTT

Page 26: Making your washing machine talk with a power plant

1. key-value store for latest data lookup

2. publish-subscribe with wildcards

3. storing and forwarding offline updates

Internals

Page 27: Making your washing machine talk with a power plant

Data Formats

• Binary

• Textual

• Semantic

Automatic conversion

with semantic

How?

Page 28: Making your washing machine talk with a power plant

One format to rule them all

Page 29: Making your washing machine talk with a power plant

JSON-LD• Full support for RDF and graph data

• Developer friendly

• Convertible to XML, MsgPack, Bysant, BSON.

• schema.org initiative for the IoT?

Page 30: Making your washing machine talk with a power plant

ponte’s pillars•

• Ascoltatori, the pub/sub library for node backed by every broker out there! npm.im/ascoltatori

• Mosca, the multi-transport MQTT broker for node.js. npm.im/mosca

• MQTT.js, the MQTT library for node: npm.im/mqtt

• Node-CoAP, the CoAP library for node: npm.im/coap

Page 31: Making your washing machine talk with a power plant

One to 10k clients

0 2000 4000 6000 8000 10000

01000

2000

3000

4000

5000

6000

clients

milliseconds

CoAP.to.CoAPHTTP.to.CoAPMQTT.to.CoAP

0 2000 4000 6000 8000 10000

01000

2000

3000

4000

5000

6000

clients

milliseconds

CoAP.to.MQTTHTTP.to.MQTTMQTT.to.MQTTMosquitto

Page 32: Making your washing machine talk with a power plant

10k clients to One

0 2000 4000 6000 8000 10000

05000

10000

15000

messages

milliseconds

CoAP.to.CoAPHTTP.to.CoAPMQTT.to.CoAP

0 2000 4000 6000 8000 10000

05000

10000

15000

messages

milliseconds

CoAP.to.MQTTHTTP.to.MQTTMQTT.to.MQTTMosquitto

Page 33: Making your washing machine talk with a power plant

Todo List• Develop a multiprocol broker

and bridge

• Official Eclipse Release

• JSON-LD based data format

• Device Identification & Privacy

Page 34: Making your washing machine talk with a power plant

http://www.flickr.com/photos/oneaustin/1261907803

DEMO!

Page 35: Making your washing machine talk with a power plant

http://eclipse.org/ponte

Page 36: Making your washing machine talk with a power plant

Install it: !

$ npm install ponte bunyan -g

Run it: !

$ ponte -v | bunyan

Page 37: Making your washing machine talk with a power plant

…but why?

Page 38: Making your washing machine talk with a power plant

IoT development happens in silos

http://www.flickr.com/photos/10775233@N00/4370646/

Page 39: Making your washing machine talk with a power plant

http://500px.com/photo/31083423

Build a Ponte between them!(Ponte means Bridge in Italian :))

Page 40: Making your washing machine talk with a power plant
Page 41: Making your washing machine talk with a power plant
Page 42: Making your washing machine talk with a power plant