Transcript
Page 1: Exposing M2M to the REST of us

Exposing M2Mto the REST of us

@matteocollina

Page 2: Exposing M2M to the REST of us

Matteo Collina

Ph.D. Student @ University of Bologna

@matteocollina matteocollina.com

Page 3: Exposing M2M to the REST of us

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

We are #coders

Page 4: Exposing M2M to the REST of us

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

We are no Jedi

Page 5: Exposing M2M to the REST of us

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

We #code apps

Page 6: Exposing M2M to the REST of us

Did you see it coming

http://www.flickr.com/photos/12738000@N00/360231193/

Page 7: Exposing M2M to the REST of us

Stevedid.

http://www.flickr.com/photos/noppyfoto/6216399465/

Page 8: Exposing M2M to the REST of us

Thanks.

http://www.flickr.com/photos/noppyfoto/6216399465/

Page 9: Exposing M2M to the REST of us

They didn’t!

...

Page 10: Exposing M2M to the REST of us

We don’t #code for this phone anymore!

Page 11: Exposing M2M to the REST of us

7:11 PMiPad

How do we #code an App?

Page 12: Exposing M2M to the REST of us

7:11 PMiPad

We #code a response to some kind of user action

Page 13: Exposing M2M to the REST of us

Pop-up Dialog

OK

This message comefrom the server!

Cancel

Web ServerTap

We #code a remote web server

Page 14: Exposing M2M to the REST of us

Web and Mobile apps are based on

HTTP

REST

Page 15: Exposing M2M to the REST of us

REpresentationalState Tranfer = REST

Page 16: Exposing M2M to the REST of us

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

Things are different

Page 17: Exposing M2M to the REST of us

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

In the future, this chain will be connected to the Internet

Page 18: Exposing M2M to the REST of us

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

We want to #code the (real) world.

Page 19: Exposing M2M to the REST of us

Arduino is an open source microcontroller that you can use to hack things

http://www.flickr.com/photos/mattrichardson/5029708468/

Page 20: Exposing M2M to the REST of us

The Internet is our pillar

Page 21: Exposing M2M to the REST of us

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

we want to monitor the seating of this room?

What if

Page 22: Exposing M2M to the REST of us

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

we measure people’s emotions?

Can

Page 23: Exposing M2M to the REST of us

When you sit,we can receive

an event

Page 24: Exposing M2M to the REST of us

The world is event based!

Page 25: Exposing M2M to the REST of us

Our controlroom is in the Cloud

Page 26: Exposing M2M to the REST of us

How can we make Things talk?

http://www.flickr.com/photos/iboy_daniel/77412822/in/photostream/

Page 27: Exposing M2M to the REST of us

Pidgeons are not a communication protocol

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

Page 29: Exposing M2M to the REST of us

We need a fast, binary protocol

http://www.flickr.com/photos/grrphoto/305649629

Page 30: Exposing M2M to the REST of us
Page 31: Exposing M2M to the REST of us

• Binary

• Publish/Subscribe

• Free

• Standard (in a few months)

Page 32: Exposing M2M to the REST of us

How to use

on

Page 33: Exposing M2M to the REST of us

Download PubSubClient, the library for

Page 34: Exposing M2M to the REST of us

on Arduino: Setup

String server = String("qest.me");

PubSubClient client = PubSubClient(server, 1883, callback);

Page 35: Exposing M2M to the REST of us

if (!client.connected()) { client.connect("arduino");}client.loop();

char s[10];itoa(get_temperature(), s, 10);client.publish("temp", s);

on Arduino: publishing

Page 36: Exposing M2M to the REST of us

if (!client.connected()) { client.connect("arduino");}client.loop();

char s[10];itoa(get_temperature(), s, 10);client.publish("temp", s);

This is called a topic, and it is where we publish

data on MQTT.

on Arduino: publishing

Page 37: Exposing M2M to the REST of us

Your app cannot serve two masters.

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

Page 39: Exposing M2M to the REST of us

• MQTT broker

• REST interface

• can be deployed on top of very pub/sub systems

• built in node.js

QEST

REST Server

Redis

MQTT Server

QEST

Data Layer

HTTP Clients MQTT Clients

Page 40: Exposing M2M to the REST of us

• Ascoltatori: the pub/sub library for node backed by Redis, MongoDB, AMQP (RabbitMQ), ZeroMQ, MQTT (Mosquitto) or just plain node: https://github.com/mcollina/ascoltatori

• Mosca, the multi-transport MQTT broker for node.js. It supports AMQP, Redis, ZeroMQ or just MQTT: https://github.com/mcollina/mosca

• MQTT.js, the MQTT library for node: https://github.com/adamvr/MQTT.js

QEST’s pillars

Page 41: Exposing M2M to the REST of us

Strings are the most common data format.

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

Page 42: Exposing M2M to the REST of us

Not these strings.

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

Page 43: Exposing M2M to the REST of us

Strings are not the better way of sending data

What else

Page 44: Exposing M2M to the REST of us

There are LOTs of choices

• JSON

• MessagePack

• BSON

• Bysant

• Protobuf

Size matters if we pay for every byte sent!

Page 45: Exposing M2M to the REST of us

There are LOTs of choices

Page 46: Exposing M2M to the REST of us

There are LOTs of choices

Developers think in Lists and Maps, not in nodes and children.

XML will not play a major role in the Internet of

Things

Page 47: Exposing M2M to the REST of us

• 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?

Security Issues

Page 48: Exposing M2M to the REST of us

We need to interconnect UsersSocial profiles tothe Devices!

Page 49: Exposing M2M to the REST of us

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

We need a Bridge between the REST and the

“Things” world

Page 50: Exposing M2M to the REST of us

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

• Multiple communication protocols

• Data representation

• Security and provisioning

We need to address:

From an end-user perspective

Page 51: Exposing M2M to the REST of us

(bridge in Italian)

Page 53: Exposing M2M to the REST of us

The initial contribution is QEST

Page 54: Exposing M2M to the REST of us

will play well with the others

Page 56: Exposing M2M to the REST of us

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

Ruby on Rails has drastically changed how web apps are

built

A 10-minutes blog video changed everything

Page 57: Exposing M2M to the REST of us

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

We aim to a Rails-like

experience for the IoT

Our goal is to deliver a10-minutes M2M app video

Page 58: Exposing M2M to the REST of us

Credits• Font Awesome for the

Icons.

• Flickr and 500px for LOTS of CC images :).

• Keynotopia for the iPad mockups

Page 59: Exposing M2M to the REST of us

Matteo Collina ([email protected])

Thank You!

@matteocollina

http://www.flickr.com/photos/axel-d/479627824/

Page 60: Exposing M2M to the REST of us

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

Bridging two worlds

http://eclipse.org/proposals/technology.ponte/


Recommended