https://www.youtube.com/watch?v=iDbyYGrswtg (00:00 - 00:44)
http://www.cs.uregina.ca/Links/class-info/215/deng_webpage/Picts/Request_Response.gif
Developers
are the new King Makers
… if you don’t believe me, read this book ;) http://thenewkingmakers.com/
https://flic.kr/p/dA2SMG + made transparent
Things
• constrained ressources
• unreliable network connection
• no power - only battery
• “out-in-the-field”
2020
20,000,000,000 things
250 newbies every second
every person owns ≈ 7 devices
http://blogs.cisco.com/news/cisco-connections-counter/!http://www.cisco.com/web/about/ac79/docs/innov/IoT_IBSG_0411FINAL.pdf
https://flic.kr/p/dA2SMG + made transparent
Things want
• Small & simple protocols
• Little overhead
• Avoid duplicate messages
• Not care about data consumers
temperature sensor
MQTT-Broker
laptop
mobile device
publish: “21°C“publish: “21°C“
publish: “21°C“
subscribe
subscribe
Publish/Subscribe
temperature sensor
MQTT-Broker
laptop
mobile device
publish: “21°C“publish: “21°C“
publish: “21°C“
subscribe
subscribe
At the end of the talk we will have this working, live
MQTT Pub/Sub
• Open TCP Connection
• Binary
• Data-agnostic
• Real Push
• All “online” clients
• Topics with wildcards
History
1999 2010 2013 2014
Arlen Nipper & Andy Stanford-Clark
invent MQTT
royalty free
OASIS TC formed
MQTT Standard
• Open Source
• “Reference Implementation”
• Many languages: Java, Javascript, Lua, C, C++, Go, Python
• Active Community
Eclipse Paho
+ other clients
MqttClient client = new MqttClient ("tcp://localhost:1883", "myclient1");
client.connect();
Client Connect
String message = “Hello World!”;
client.publish("topic", message.getBytes(), 2, false);
Client Publish
MqttCallback mqttCallback = new MqttCallback() {
public void connectionLost(Throwable throwable) {}
public void messageArrived(String s, MqttMessage msg) { ACTION } public void deliveryComplete(IMqttDeliveryToken token) { }
};
client.setCallback(mqttCallback);client.connect();client.subscribe(“topic”);
Client Subscribe
MqttConnectOptions options = new MqttConnectOptions();
options.setCleanSession(true);
client.connect(options);
Persistent Session
MqttConnectOptions options = new MqttConnectOptions();
options.setWill("willtopic","message".getBytes(), 2, true);
client.connect(options);
LWT
MqttConnectOptions options = new MqttConnectOptions();
options.setKeepAliveInterval(1);
client.connect(options);
Heartbeat
temperature sensor
MQTT-Broker
laptop
mobile device
publish: “21°C“publish: “21°C“
publish: “21°C“
subscribe
subscribe
Achievement Unlocked: Built MQTT Client
High performance
Open Plugin System for Java
Clustering
Bridging Highly Scalable
Native Websocket support
HiveMQ
Protocol
Username/Password
Transport
TLS, client certificate authentication
Broker
fine-grained authentication, 3rd party integration
Securing MQTT
dc-square
Create building blocks for the IoT
Develop the Broker
Custom Plugin Development
Consulting for MQTT & IoT
More about MQTT & HiveMQ:www.hivemq.com/blog
@HiveMQ @dcsquare
All rights for IT Crowd video (YouTube) & photo belong to Channel4 !Raspberry Pi by inrepose from Flickr !“we are all makers” rights belong to MakerMedia !Client/Server Image from University of Regina !Other photos are from depositphotos.com
Credits