54
Building the Internet of Things with Eclipse IoT Benjamin Cabé Eclipse Foundation @kartben IoT Breakfast Madrid - May 21, 2015

SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Embed Size (px)

Citation preview

Page 1: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Building the Internet of Things with Eclipse IoTBenjamin Cabé – Eclipse Foundation@kartben

IoT Breakfast Madrid - May 21, 2015

Page 2: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT
Page 3: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT
Page 4: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT
Page 5: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT
Page 6: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT
Page 7: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT
Page 8: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT
Page 9: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

● 18 open-source projects*● Java – but also C, C++,

Python, etc.

* and counting!

→ IoT Standards→ Services & Frameworks

Page 10: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Java for IoT?● 9+ million Java developers● Java 8 & embedded are fun● Lots of IoT devices running on ARM● Tooling

Page 11: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

End-to-end IoT?

Page 12: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

End-to-end IoT?

Page 13: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

End-to-end IoT?

Page 14: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

End-to-end IoT?

Page 15: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Gateway

Page 16: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Gateway

Page 17: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Gateway

Page 18: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Gateway

Connectsensors to the world

Manage the hardware and software running

at the edge

Page 19: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Connect?● CoAP

○ « HTTP over UDP »

○ Expose your device as a resource to the Internet of Things

● MQTT○ Publish/Subscribe model○ More room for local processing

Page 20: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

CoAP: The web-of-things

/walk/hand/left/raise/eye/picture

/on/red/green/blue/mtbf

/on

/on

/buttons/buttons/1/push/bat-level

/engine/status/position/fuel /CO2

/noise/lights/on

Page 21: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Eclipse Californium● Focus on scalability and usability

● To be used in IoT cloud servers or M2M/IoT devices running Java

● Includes DTLS implementation (Scandium),HTTP/CoAP bridge, Plugtests, …

http://eclipse.org/californium

Page 22: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

import static org.eclipse.californium.core.coap.CoAP.ResponseCode.*;

public class MyResource extends CoapResource {

@Override

public void handleGET(CoapExchange exchange) {

exchange.respond("hello world"); // reply with 2.05 payload (text/plain)

}

@Override

public void handlePOST(CoapExchange exchange) {

exchange.accept(); // make it a separate response

if (exchange.getRequestOptions() ...) {

// do something specific to the request options

}

exchange.respond(CREATED); // reply with response code only (shortcut)

}

}

Page 23: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

MQTT: Publish & Subscribe

Sub KETTLE232/#Pub KETTLE232/temp

Payload: 21°C

Pub KETTLE232/temp

Payload: 21°CBROKER

Page 24: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Eclipse Paho● Open-source MQTT clients

● Pick your language!○ Java○ JavaScript○ C/C++, Objective C○ Go, Lua, Python, .NET, WinRT, …

http://eclipse.org/paho

Page 25: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

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

MqttClient.generateClientId());

mqttClient.setCallback(new MqttCallback() {

@Override

public void messageArrived(String topic, MqttMessage message)

throws Exception {

// process received message

// ...

}

});

mqttClient.connect();

mqttClient.subscribe("mygateway/#");

Page 26: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

MQTT brokers● Eclipse Mosquitto

○ C implementation

○ Scalable (1000 clients == 3MB RAM)

● Moquette○ Java implementation○ Based on Netty and LMAX disruptor

Page 27: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Manage?● Gateway itself

○ wireless modem, firewall, …

● Applications○ Install/Uninstall software packages○ Start/Stop applications

● Sensors○ H/W abstraction layer

Page 28: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Java VMOSGi Application Container

Device Abstraction

Gateway Basic Services

Network ConfigurationNetwork Management Field Protocols

Connectivity and Delivery

Adm

inis

trat

ion

GUI

Ope

ratio

n &

Man

agem

ent

LinuxHardware

App 1 App 2 App n. . . . Applications

Eclipse Kura

Page 29: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Installing Kura

cd ~

sudo apt-get update

wget https://s3.amazonaws.com/kura_downloads/raspbian/release/ \ 1.1.0/kura_1.1.0_raspberry-pi_armv6.deb

sudo dpkg -i kura_1.1.0_raspberry-pi_armv6.deb

sudo apt-get install -f

sudo reboot

Page 30: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

First steps with Kura● Network management

○ Cellular Modem, WiFi○ Firewall○ NAT

● OSGi and system administration

● IoT server communication settings

Page 31: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

First steps with Kura

Page 32: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

First steps with Kura

Page 33: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

First steps with Kura

Page 34: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

First steps with Kura

Page 35: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

First steps with Kura

Page 36: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

First steps with Kura

Page 37: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

First steps with Kura

Page 38: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

First steps with Kura

Page 39: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Kura API● OSGi services that you can re-use in your own

components○ o Se e○ Da aSe e, oudSe e○ p oSe e (AES, base64, SHA-1)○ Pos onSe e (geolocation)○ … and many others

● And of course you can leverage a huge ecosystem of Java and OSGi libraries

Page 40: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Your typical Kura component● Uses Modbus, CAN-Bus, etc. built-in device

abstraction services○ Or implement your own service

Page 41: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Your typical Kura component (2)• Uses Kura built-in transport services to talk to

the cloud– TransportService – « raw » protocol– DataService – local storage, auto reconnect– CloudService – optimized binary payload, advanced

device management

Page 42: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Your typical Kura component (3)• Implements ConfigurableComponent

– Enables configuration from the UI– … as well as from the cloud

Page 43: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Your typical Kura component (4)• Bundled with other bundles/components in a

deployment package– Zip file containing a Manifest & OSGi bundles

• Can be deployed from Kura Web UI or over the air

Read more: http://eclipse.github.io/kura/doc/kura-setup

Page 44: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

End-user interaction

● JavaFX Charts

● Eclipse BIRT

● Smartphone app (e.g Android)○ https://www.eclipse.org/paho/clients/android

● MQTT + WebSockets = ♡○ https://www.eclipse.org/paho/clients/js

Page 45: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Eclipse IoT is also… Industrial IoT

● Open source implementations of IEC standards● Eclipse SCADA, 4DIAC, Rise V2G, ...

Page 46: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Eclipse IoT is also...Device Management

● LwM2M is an Open Mobile Alliance Standard● Device Management on top of CoAP● Eclipse Leshan and Wakaama are two

implementations

Page 47: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Eclipse IoT is also…

● Flexible Framework● Based on Java and OSGi

● Huge number of “bindings”:KNX, Nest, Philips HUE, …

Page 48: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Kura is awesome!Go download it now!

http://eclipse.org/kura

If you had to remember only 3 things...

#1

Page 49: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Build your own greenhouse &follow the tutorial

http://iot.eclipse.org/java/tutorial

If you had to remember only 3 things...

#2

Page 50: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Eclipse IoT is much more thanKura and Java!

http://iot.eclipse.org/

If you had to remember only 3 things...

#3

Page 51: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Get Involved!

● Open bugs / fix bugs● Request new features● Write articles, tutorials● Participate on the mailing

lists● Propose your project!

Page 52: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Coming next?

Page 53: SQS IoT Breakfast Madrid -Building the Internet of Things with Eclipse IoT

Coming next?● Device Management

○ LwM2M, LwM2M over MQTT, IPSO Smart Objects

● Security○ TinyDTLS

● Open-source IoT server○ Several members interested in defining and

implementing the OpenStack for IoT

○ See https://wiki.eclipse.org/IoT/IoTServerPlatform