leveraging android for the internet of things with eclipse m2m

74
Leveraging Android for the Internet of Things with Eclipse M2M Droidcon London 24-27th October 2013 Benjamin Cabé | Sierra Wireless

Upload: benjamin-cabe

Post on 08-Sep-2014

7.103 views

Category:

Technology


1 download

DESCRIPTION

The Eclipse M2M (Machine-to-Machine) open source initiative delivers a stack of open source building blocks that accelerate the development of connected solutions. In this session, you’ll be briefly introduced to the Eclipse M2M projects and discover cool end-to-end examples (Augmented Reality anyone?) combining the use of Android API with Open Hardware platforms (Arduino, Raspberry Pi…) for doing fleet tracking, remote monitoring, home automation, and much more.

TRANSCRIPT

Page 1: Leveraging Android for the Internet of Things with Eclipse M2M

Leveraging Android for the Internet of Things with Eclipse M2M

Droidcon London 24-27th October 2013 Benjamin Cabé | Sierra Wireless

Page 2: Leveraging Android for the Internet of Things with Eclipse M2M

Who I am

•  Benjamin Cabé •  Open Source M2M

Evangelist at Sierra Wireless •  Eclipse M2M WG chairperson

Page 3: Leveraging Android for the Internet of Things with Eclipse M2M

M2M?

Page 4: Leveraging Android for the Internet of Things with Eclipse M2M

M2M? IoT?

Page 5: Leveraging Android for the Internet of Things with Eclipse M2M

❝ Technology that supports wired or wireless communication between devices

Page 6: Leveraging Android for the Internet of Things with Eclipse M2M
Page 7: Leveraging Android for the Internet of Things with Eclipse M2M
Page 8: Leveraging Android for the Internet of Things with Eclipse M2M
Page 9: Leveraging Android for the Internet of Things with Eclipse M2M
Page 10: Leveraging Android for the Internet of Things with Eclipse M2M

Typical architecture Healthcare example

Page 11: Leveraging Android for the Internet of Things with Eclipse M2M
Page 12: Leveraging Android for the Internet of Things with Eclipse M2M

IOT

Page 13: Leveraging Android for the Internet of Things with Eclipse M2M
Page 14: Leveraging Android for the Internet of Things with Eclipse M2M

IOT

Page 15: Leveraging Android for the Internet of Things with Eclipse M2M

However… It’s not as easy as it looks

Page 16: Leveraging Android for the Internet of Things with Eclipse M2M

Network is unreliable

Page 17: Leveraging Android for the Internet of Things with Eclipse M2M

Network is unreliable

Objects need to be ID’d

Page 18: Leveraging Android for the Internet of Things with Eclipse M2M

Network is unreliable

Objects need to be ID’d

Embedded is complex

Page 19: Leveraging Android for the Internet of Things with Eclipse M2M

When all you want to do…

Page 20: Leveraging Android for the Internet of Things with Eclipse M2M

POST /turnOn

GET /temperature

Page 21: Leveraging Android for the Internet of Things with Eclipse M2M

Eclipse M2M building blocks

Page 22: Leveraging Android for the Internet of Things with Eclipse M2M

protocols

frameworks

tools

Eclipse M2M building blocks

Page 23: Leveraging Android for the Internet of Things with Eclipse M2M

Network is unreliable

Page 24: Leveraging Android for the Internet of Things with Eclipse M2M

MQTT

Page 25: Leveraging Android for the Internet of Things with Eclipse M2M

MQTT?

Page 26: Leveraging Android for the Internet of Things with Eclipse M2M

MQTT? M = Messaging

Page 27: Leveraging Android for the Internet of Things with Eclipse M2M

MQTT? M = Messaging

Publish/subscribe protocol

Page 28: Leveraging Android for the Internet of Things with Eclipse M2M

MQTT? M = Messaging

Publish/subscribe protocol

Lightweight (bandwidth, battery, …)

Page 29: Leveraging Android for the Internet of Things with Eclipse M2M

72.2

72.2

Page 30: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code! embedded device

Page 31: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

var mqtt = require('mqtt');var c = mqtt.createClient(1883, 'm2m.eclipse.org');

client.on('message’, cb);client.subscribe('/kettle232/switch');client.publish('/kettle232/temp’, '72.2');var cb = function(topic, message) {// turn the kettle on/off

}

Page 32: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

var mqtt = require('mqtt');var c = mqtt.createClient(1883, 'm2m.eclipse.org');

client.on('message’, cb);client.subscribe('/kettle232/switch');client.publish('/kettle232/temp’, '72.2');var cb = function(topic, message) {// turn the kettle on/off

}

Page 33: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

var mqtt = require('mqtt');var c = mqtt.createClient(1883, 'm2m.eclipse.org');

client.on('message’, cb);client.subscribe('/kettle232/switch');client.publish('/kettle232/temp’, '72.2');var cb = function(topic, message) {// turn the kettle on/off

}

Page 34: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

var mqtt = require('mqtt');var c = mqtt.createClient(1883, 'm2m.eclipse.org');

client.on('message’, cb);client.subscribe('/kettle232/switch');client.publish('/kettle232/temp’, '72.2');var cb = function(topic, message) {// turn the kettle on/off

}

Page 35: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code! Android device

Page 36: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

MqttClient c = new MqttClient ( "tcp://m2m.eclipse.org:1883", MqttClient.generateClientId() );

mqttClient.setCallback(…);mqttClient.connect();mqttClient.subscribe("/teapot24232/#");// the rest of your app

Page 37: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

MqttClient c = new MqttClient ( "tcp://m2m.eclipse.org:1883", MqttClient.generateClientId() );

mqttClient.setCallback(…);mqttClient.connect();mqttClient.subscribe("/teapot24232/#");// the rest of your app

Page 38: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

MqttClient c = new MqttClient ( "tcp://m2m.eclipse.org:1883", MqttClient.generateClientId() );

mqttClient.setCallback(…);mqttClient.connect();mqttClient.subscribe("/teapot24232/#");// the rest of your app

Page 39: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

MqttClient c = new MqttClient ( "tcp://m2m.eclipse.org:1883", MqttClient.generateClientId() );

mqttClient.setCallback(…);mqttClient.connect();mqttClient.subscribe("/teapot24232/#");// the rest of your app

Page 40: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

mqttClient.setCallback(new MqttCallback() {@Overridepublic void messageArrived(String topic, MqttMessage message) throws Exception { // process received message // e.g. display temperature value}// ...

});

Callback code:

Page 41: Leveraging Android for the Internet of Things with Eclipse M2M

Show me the code!

mqttClient.setCallback(new MqttCallback() {@Overridepublic void messageArrived(String topic, MqttMessage message) throws Exception { // process received message // e.g. display temperature value}// ...

});

Callback code:

Page 42: Leveraging Android for the Internet of Things with Eclipse M2M

Simple but not Stupid

•  QoS – at most once, at least once, exactly once, …

•  “Last will & Testament” – automatically publish a message when a client

goes offline

Page 43: Leveraging Android for the Internet of Things with Eclipse M2M

More about MQTT

http://mqtt.org http://eclipse.org/paho

Page 44: Leveraging Android for the Internet of Things with Eclipse M2M

Network is unreliable

Objects need to be ID’d

Page 45: Leveraging Android for the Internet of Things with Eclipse M2M

So… now my objects talk … to me?

Page 46: Leveraging Android for the Internet of Things with Eclipse M2M

NFC RFID

Bluetooth LE QR Code

Page 47: Leveraging Android for the Internet of Things with Eclipse M2M

How about AR*? * Augmented Reality

Page 48: Leveraging Android for the Internet of Things with Eclipse M2M

Demo! Connected greenhouse

Page 49: Leveraging Android for the Internet of Things with Eclipse M2M
Page 50: Leveraging Android for the Internet of Things with Eclipse M2M

Raspberry Pi + NodeJS MQTT client

Page 51: Leveraging Android for the Internet of Things with Eclipse M2M

Raspberry Pi + NodeJS MQTT client

Page 52: Leveraging Android for the Internet of Things with Eclipse M2M

MQTT broker m2m.eclipse.org

Raspberry Pi + NodeJS MQTT client

Page 53: Leveraging Android for the Internet of Things with Eclipse M2M

MQTT broker m2m.eclipse.org

Raspberry Pi + NodeJS MQTT client

Page 54: Leveraging Android for the Internet of Things with Eclipse M2M

MQTT broker m2m.eclipse.org

Raspberry Pi + NodeJS MQTT client

Nexus 10 + Java MQTT client +

metaio SDK

Page 55: Leveraging Android for the Internet of Things with Eclipse M2M
Page 56: Leveraging Android for the Internet of Things with Eclipse M2M
Page 57: Leveraging Android for the Internet of Things with Eclipse M2M
Page 58: Leveraging Android for the Internet of Things with Eclipse M2M

Network is unreliable

Objects need to be ID’d

Embedded is complex

Page 59: Leveraging Android for the Internet of Things with Eclipse M2M

Simplifying embedded for home automation

with .

http://www.deviantart.com/art/Android-Version-Cupcake-150995350

Page 60: Leveraging Android for the Internet of Things with Eclipse M2M

Eclipse Smart Home

•  A flexible framework for smart home and ambient assisted living (AAL) solutions.

•  Easy to extend (based on OSGi)

•  Smooth Android integration

Page 61: Leveraging Android for the Internet of Things with Eclipse M2M
Page 62: Leveraging Android for the Internet of Things with Eclipse M2M

Ready to Play?

Page 63: Leveraging Android for the Internet of Things with Eclipse M2M

Data consolidation

Ready to Play?

Page 64: Leveraging Android for the Internet of Things with Eclipse M2M

Data consolidation

Alerting

Ready to Play?

Page 65: Leveraging Android for the Internet of Things with Eclipse M2M

Data consolidation

Alerting

User management

Ready to Play?

Page 66: Leveraging Android for the Internet of Things with Eclipse M2M

Data consolidation

Alerting

User management

etc.

Ready to Play?

Page 67: Leveraging Android for the Internet of Things with Eclipse M2M
Page 68: Leveraging Android for the Internet of Things with Eclipse M2M

Management dashboards

Page 69: Leveraging Android for the Internet of Things with Eclipse M2M

System diagnostics

Page 70: Leveraging Android for the Internet of Things with Eclipse M2M

(Big!) Data history

Page 71: Leveraging Android for the Internet of Things with Eclipse M2M

Register for a free trial!

http://airvantage.net

Page 72: Leveraging Android for the Internet of Things with Eclipse M2M

Get a greenhouse kit!

http://airvantage.github.io/devkit

Page 73: Leveraging Android for the Internet of Things with Eclipse M2M

http://m2m.eclipse.org

Page 74: Leveraging Android for the Internet of Things with Eclipse M2M

Thanks!

Liked it? … Share it!

Benjamin Cabé [email protected] | @kartben