Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Building the Internet of Things with Eclipse IoT - IoTBE meetup
1. BUILDING
THE INTERNET OF THINGS
WITH ECLIPSE IOT
Benjamin Cabé, Eclipse Foundation
@kartben
"Kortrijk Begijnhof and Our Lady's" by Michael O'Donnabhain
13. Hand
by
Castor
&
Pollux
from
The
Noun
Project
AT FIRST THEY WERE THREE…
14. Hand
by
Castor
&
Pollux
from
The
Noun
Project
AT FIRST THEY WERE THREE…
15. Hand
by
Castor
&
Pollux
from
The
Noun
Project
AT FIRST THEY WERE THREE…
16. Hand
by
Castor
&
Pollux
from
The
Noun
Project
AT FIRST THEY WERE THREE…
17. Paho provides client implementations
of the MQTT protocol.
Mihini is an embedded Lua runtime
providing HW abstraction and other
services.
Koneki provides tools for embedded
Lua developers.
18. Eclipse SCADA is a complete Java/
OSGi-based SCADA system
(communication, monitoring, GUI, …)
Kura is a Java/OSGi-based M2M
container for gateways. Has support
for Modbus, CANbus, MQTT, …
Mosquitto is a lightweight server
implementation of the MQTT and
MQTT-SN protocols, written in C.
19. Ponte bridges M2M/IoT (MQTT,
CoAP) protocols to the Web.
SmartHome provides a complete set
of services for home automation
gateways.
OM2M implements the ETSI M2M
standard.
(code pending)
20. Californium is an implementation
of the CoAP protocol written in
Java. Includes DTLS for security.
Wakaama is an implementation of
LWM2M written in C.
Krikkit is a rules system for
programming edge devices just like
you’d configure a router
Wakaama
Krikkit
(code pending)
(code pending)
(code pending)
21. Concierge is a lightweight
implementation of OSGi Core R5.
Your project?
J
Concierge
We need to talk! ;-)
23. WHAT IS ZE BEST
LANGUAGE FOR
IOT?!?
I often get asked…
24. ANSWER: It depends! J
For embedded systems…
Codevs.Configuration
Constrained micro-controllers vs. Smart gateways
C
Javascript
Lua
Java/OSGi
25. ANSWER: It depends! J
Infrastructurevs.App.development
Communication enablement vs. Information systems
On the server side…
C
Javascript
Java/OSGi
28. Cloud
by
Andrew
Lynne
from
The
Noun
Project
Thermometer
by
Lemon
Liu
from
The
Noun
Project
Fluorescent
Light
Bulb
by
Dmitriy
Lagunov
from
The
Noun
Project
Water
by
Gilad
Fried
from
The
Noun
Project
MQTT Network
Mosquitto broker
Building… SENSOR NETWORKS
33. MQTT history
• … it’s not new!
• Invented in 1999 (Andy Stanford-
Clark, Arlen Nipper)
• Royalty-free since 2010
• Being standardized at OASIS since
2013
34. Neat MQTT features
• Wildcards
• Quality of Service
• Last Will & Testament
• Retained Messages
35. MQTT Features | Wildcards
• The number sign (#) is a wildcard character
that matches any number of levels within a
topic.
• The plus sign (+) is a wildcard character
that matches only one topic level
Examples
mygreenhouse/sensors/#
+/sensors/temperature
36. MQTT Features | QoS
• QoS flag allows to control the level of
assurance for delivery you want when
publishing a message to the broker
37. MQTT Features | QoS 0
• QoS flag allows to control the level of
assurance for delivery you want when
publishing a message to the broker
• A message published with QoS=0 will
be received at most once (“fire &
forget”) by subscribed clients
38. MQTT Features | QoS 1
• QoS flag allows to control the level of
assurance for delivery you want when
publishing a message to the broker
• A message published with QoS=1 will
be received at least once
(acknowledged delivery) by subscribed
clients
39. MQTT Features | QoS 2
• QoS flag allows to control the level of
assurance for delivery you want when
publishing a message to the broker
• A message published with QoS=2 will
be received exactly once (assured
delivery) by subscribed clients
40. MQTT Features | Last Will & Testament
• IoT devices can come & go on the
network quite often and in a very
unpredictable way
• Last Will & Testament allows to notify
interested parties to an abnormal
disconnection of a client
• The Last Will & Testament (if any) is
part of the initial connection message
41. MQTT Features | Retained messages
• The Retained flag allows a published
message to be stored on the broker, so
as possible receivers can subscribe
later and still receive the message
45. Is the MQTT API that simple?
MqttClient mqttClient = new MqttClient
(
"tcp://iot.eclipse.org:1883",
MqttClient.generateClientId()
);
mqttClient.setCallback(…);
mqttClient.connect();
mqttClient.subscribe("myGreenhouse/#");
// the rest of your app
46. Is the MQTT API that simple?
mqttClient.setCallback(new MqttCallback() {
@Override
public void messageArrived(String topic,
MqttMessage message)
throws Exception {
// process received message
// e.g. display temperature value
}
// ...
});
Callback code:
47. Data viz. w/ MQTT over Websockets
• Rickshaw is a JavaScript toolkit for
creating interactive time series graphs
• It’s built on top of d3.js
• MQTT over Websockets makes it very
easy to feed data into Rickshaw
datasets… perfect for IoT!
– More at http://code.shutterstock.com/rickshaw,
lots of examples to get started
48. Cloud
by
Andrew
Lynne
from
The
Noun
Project
Thermometer
by
Lemon
Liu
from
The
Noun
Project
Fluorescent
Light
Bulb
by
Dmitriy
Lagunov
from
The
Noun
Project
Water
by
Gilad
Fried
from
The
Noun
Project
MQTT Network
Ponte broker
CoAP Network
Building… SENSOR NETWORKS (2)
49. CoAP: Constrained Application Protocol
• Internet Eng. Task Force standard for
the Internet of Things.
• Started in 2010!
• Draft-18 is the final one.
50. Co: Constrained
• Simple to encode: targets 8 bits MCU.
• UDP based, targets low power IP
networks.
• Two level of QoS: confirmable message
or not.
• Simple observation mechanism.
51. CoAP: RESTful things!
• REST paradigm for things:
– URI: coap://hostname/lamps/12/status
• HTTP like verbs:
– GET for reads
– POST, PUT, DELETE for mutation
– … but in a compact binary datagram.
62. DEMO
• Copper, a Firefox plug-in for CoAP
• Eclipse Wakaama, a LWM2M client
• Leshan, a LWM2M server
63. Cloud
by
Andrew
Lynne
from
The
Noun
Project
Thermometer
by
Lemon
Liu
from
The
Noun
Project
Fluorescent
Light
Bulb
by
Dmitriy
Lagunov
from
The
Noun
Project
Water
by
Gilad
Fried
from
The
Noun
Project
CoAP Network
LWM2M server
(e.g. Leshan)
wakaama
wakaama
wakaama
Building… DEVICE MANAGEMENT
battery level
avail. memory
…
firmware
reboot
…
65. In a nutshell
• MQTT is a very versatile protocol for
building your IoT solution from the
ground up. You should try it!
• Eclipse IoT has lots of projects, from
basic building blocks to more complete
solutions
• We have cool Java projects… among
many others! J
66. Join us at EclipseCon France!
http://eclipsecon.org/france2014