Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
MQTT and SensorThings API MQTT
Extension
sensorweb.geomatics.ucalgary.ca
www.sensorup.com
0.23 litre/minute
0.25 litre/min...
About Dr. Steve Liang
๏ Associate Professor, Geomatics Engineering, Uni. Calgary
๏ AITF-Microsoft Industry Research Chair ...
About SensorUp
๏ We are a leader in Sensor Web and
IoT Platforms
๏ We are leading several international
IoT standard devel...
News - 

Whiskers
๏ Whiskers, a new Eclipse
open source project
proposal for OGC
SensorThings API
๏ will includes MQTT sup...
News - Whiskers
๏ Whisker is
๏ a Javascript Client Library for SensorThings
๏ a light-weight SensorThings Server for IoT
g...
What will be covered
๏ MQTT
๏ SensorThings API MQTT Extension
Why isn’t HTTP enough?
๏ HTTP: send a request, receive a response
๏ IoT has fundamentally different challenges
๏ IoT needs ...
Why isn’t HTTP enough - 2?
๏ IoT has fundamentally different challenges
๏ power consumption is a major concern
(battery-pow...
MQTT is…
๏ an ISO standard (ISO/IEC 20922)
๏ an OASIS standard
๏ probably the most popular IoT messaging
protocol (more in...
Messaging Protocols for IoT
1.1%
5.4%
6.8%
8.2%
11.1%
11.5%
18.6%
21.5%
53.0%
63.1%
0.0% 10.0% 20.0% 30.0% 40.0% 50.0% 60....
MQTT vs HTTPS (power consumption)
http://stephendnicholas.com/posts/power-profiling-mqtt-vs-https
MQTT vs HTTPS (power consumption)
http://stephendnicholas.com/posts/power-profiling-mqtt-vs-https
What MQTT is not…
๏ use MQTT doesn’t mean IoT interoperability
๏ It’s part of the interoperability solution
๏ It still nee...
MQTT Topics
๏ the central concept in MQTT to dispatch messages
are topics
๏ a topic is a simple string that can have more
...
MQTT in a nutshell
MQTT
Broker
Publisher Subscribers
Subscribers
Subscribers
Instead of client/server, MQTT has the
roles ...
MQTT in a nutshell
MQTT
Broker
Publisher
Subscribers
Subscribers
Publish to: topic1

body
msg
Instead of client/server, MQ...
MQTT Methods (verbs)
๏ Connect: client request a connection with the
MQTT broker
๏ Disconnect: disconnect notification
๏ Su...
Let’s try
๏ HiveMQ provides a nice web socket-based client
๏ http://www.hivemq.com/demos/websocket-
client/
๏ Today I’m go...
MQTT Topics cont.
๏ plus sign (+) is the single level wild card
๏ e.g., a subscription of house/+/temperature will
receive...
MQTT wildcard
MQTT
Broker
Publisher Subscribers
Subscribers
Subscribers
Instead of client/server, MQTT has the
roles of pu...
MQTT wildcard
MQTT
Broker
Publisher Subscribers
Subscribers
Subscribers
Instead of client/server, MQTT has the
roles of pu...
MQTT wildcard
MQTT
Broker
Publisher Subscribers
Subscribers
Subscribers
Instead of client/server, MQTT has the
roles of pu...
MQTT QoS
๏ QoS-0: fire-and-forget
๏ QoS-1: deliver at least once
๏ the broker stores messages on disk and retries until cli...
MQTT Retain Flag
๏ Second, messages have a ‘retain’ flag, indicating
that they should be stored for delivery to new
subscri...
What not included in MQTT?
๏ What does the topic mean?
๏ h/p/t ??
๏ How to interpret the data pushed to you??
SensorThings...
๏ MQTT Subscribe 



v1.0/Datastreams(id)/Observations
SensorThings MQTT Extension
MQTT + OData URL Pattern + O&M
URL path...
Receive Observations via MQTT
Get Notified when new a THING was created
Demo - Client received notifications when
new THINGS join a SensorThings server
Summary
๏ MQTT is very suitable for IoT!!
๏ SensorThings API provides the greatness of
both HTTP and MQTT.
๏ SensorThings ...
References
๏ Introduction to MQTT
๏ https://www.oasis-open.org/committees/download.php/49205/
MQTT-OASIS-Webinar.pdf
๏ Ecl...
See you next week!
Upcoming SlideShare
Loading in …5
×

MQTT and SensorThings API MQTT Extension

1,907 views

Published on

This webinar introduce two important Internet of Things standards: ISO/OASIS MQTT and OGC SensorThings API. MQTT provides an interoperable messaging protocol for IoT, and SensorThings provides an interoperable data model and API for IoT. The combination of the two international standards offers the best IoT interoperability that is open, interoperable, scalable, and rich in features. Recording of the webinar is available here: https://www.youtube.com/playlist?list=PLUSJC5mjKZ9SIASpVJNWKWCSS9hVzjiFA

Published in: Internet
  • Be the first to comment

MQTT and SensorThings API MQTT Extension

  1. 1. MQTT and SensorThings API MQTT Extension sensorweb.geomatics.ucalgary.ca www.sensorup.com 0.23 litre/minute 0.25 litre/minute 0.27 litre/minuteRH: 85 % Temp: 18 Celsius Dr. Steve Liang, Ph.D., P.Eng. Associate Professor, University of Calgary Founder and CEO, SensorUp Inc.
  2. 2. About Dr. Steve Liang ๏ Associate Professor, Geomatics Engineering, Uni. Calgary ๏ AITF-Microsoft Industry Research Chair on Open Sensor Web (2011~2014) ๏ Chair OGC SensorThings API Standard Working Group ๏ Rapporteur, ITU-T SG12/11 on Internet of Things Test Specifications ๏ Founder and CEO, SensorUp Inc ๏ Calgary’s Top 40 Under 40
  3. 3. About SensorUp ๏ We are a leader in Sensor Web and IoT Platforms ๏ We are leading several international IoT standard development efforts (OGC and ITU-T) ๏ We are proud member of Eclipse and Open Geospatial Consortium
  4. 4. News - 
 Whiskers ๏ Whiskers, a new Eclipse open source project proposal for OGC SensorThings API ๏ will includes MQTT support
  5. 5. News - Whiskers ๏ Whisker is ๏ a Javascript Client Library for SensorThings ๏ a light-weight SensorThings Server for IoT gateways (e.g., Raspberry Pi) ๏ First release - 2016 Q2 or Q3
  6. 6. What will be covered ๏ MQTT ๏ SensorThings API MQTT Extension
  7. 7. Why isn’t HTTP enough? ๏ HTTP: send a request, receive a response ๏ IoT has fundamentally different challenges ๏ IoT needs a event-oriented paradigm ๏ distribute information from 1 to many ๏ get notifications whenever they happen ๏ distributing minimal packets of data in huge volumes ๏ pushing information over unreliable networks
  8. 8. Why isn’t HTTP enough - 2? ๏ IoT has fundamentally different challenges ๏ power consumption is a major concern (battery-powered devices) ๏ responsiveness (near real-time applications) ๏ scalability (50 billion devices!!)
  9. 9. MQTT is… ๏ an ISO standard (ISO/IEC 20922) ๏ an OASIS standard ๏ probably the most popular IoT messaging protocol (more in next slide) ๏ efficient and scalable
  10. 10. Messaging Protocols for IoT 1.1% 5.4% 6.8% 8.2% 11.1% 11.5% 18.6% 21.5% 53.0% 63.1% 0.0% 10.0% 20.0% 30.0% 40.0% 50.0% 60.0% 70.0% None DDS Don’t)know Proprietary AMQP XMPP In7house CoAP MQTT HTTP What)general)messaging)protocols)do)you)use)in)your)IoT)solution? Eclipse IoT Developer Survey 2015
  11. 11. MQTT vs HTTPS (power consumption) http://stephendnicholas.com/posts/power-profiling-mqtt-vs-https
  12. 12. MQTT vs HTTPS (power consumption) http://stephendnicholas.com/posts/power-profiling-mqtt-vs-https
  13. 13. What MQTT is not… ๏ use MQTT doesn’t mean IoT interoperability ๏ It’s part of the interoperability solution ๏ It still needs a data model standard, such as SensorThings API to enable data interoperability
  14. 14. MQTT Topics ๏ the central concept in MQTT to dispatch messages are topics ๏ a topic is a simple string that can have more hierarchy levels, which are separated by a slash (/), ๏ e.g., house/living-room/temperature ๏ topics are the routing information for the MQTT broker
  15. 15. MQTT in a nutshell MQTT Broker Publisher Subscribers Subscribers Subscribers Instead of client/server, MQTT has the roles of publisher/subscriber subscribe: topic1 subscribe: topic1 subscribe: topic1
  16. 16. MQTT in a nutshell MQTT Broker Publisher Subscribers Subscribers Publish to: topic1
 body msg Instead of client/server, MQTT has the roles of publisher/subscriber msg msg msg Subscribers
  17. 17. MQTT Methods (verbs) ๏ Connect: client request a connection with the MQTT broker ๏ Disconnect: disconnect notification ๏ Subscribe: subscribe to topics ๏ UnSubscribe: unsubscribe from topics ๏ Publish: Publish message
  18. 18. Let’s try ๏ HiveMQ provides a nice web socket-based client ๏ http://www.hivemq.com/demos/websocket- client/ ๏ Today I’m gonna use an Eclipse open source tool called mosquitto ๏ GIST here: http://gist.github.com/liangsteve/ bb7468fb9e97060f4676d3e544c11a77
  19. 19. MQTT Topics cont. ๏ plus sign (+) is the single level wild card ๏ e.g., a subscription of house/+/temperature will receive messages published to both house/ living-room/temperature and house/bed- room/temperature ๏ # is multi-level wildcard ๏ e.g., house/# is subscribing to all topics begins with house
  20. 20. MQTT wildcard MQTT Broker Publisher Subscribers Subscribers Subscribers Instead of client/server, MQTT has the roles of publisher/subscriber subscribe to: 
 h/+/t subscribe to: house/b/+ subscribe to: h/b/t
  21. 21. MQTT wildcard MQTT Broker Publisher Subscribers Subscribers Subscribers Instead of client/server, MQTT has the roles of publisher/subscriber h/+/t h/b/+ h/b/s publish to topic: h/b/t
  22. 22. MQTT wildcard MQTT Broker Publisher Subscribers Subscribers Subscribers Instead of client/server, MQTT has the roles of publisher/subscriber h/+/t h/b/+ h/b/s publish to topic: h/a/t
  23. 23. MQTT QoS ๏ QoS-0: fire-and-forget ๏ QoS-1: deliver at least once ๏ the broker stores messages on disk and retries until clients have acknowledged their delivery. (Possibly with duplicates.) ๏ QoS-2: deliver exact once ๏ have a second acknowledgement round-trip, to ensure that non-idempotent messages can be delivered exactly once
  24. 24. MQTT Retain Flag ๏ Second, messages have a ‘retain’ flag, indicating that they should be stored for delivery to new subscribers. For topics that are infrequently updated, it’s often useful to give new subscribers the last-known message right away (with an indication that it isn’t fresh). Newer retained messages replace previously ones.
  25. 25. What not included in MQTT? ๏ What does the topic mean? ๏ h/p/t ?? ๏ How to interpret the data pushed to you?? SensorThings API MQTT Extension!!
  26. 26. ๏ MQTT Subscribe 
 
 v1.0/Datastreams(id)/Observations SensorThings MQTT Extension MQTT + OData URL Pattern + O&M URL path tells you how to find metadata, entity name tells you how to interpret the data
  27. 27. Receive Observations via MQTT
  28. 28. Get Notified when new a THING was created
  29. 29. Demo - Client received notifications when new THINGS join a SensorThings server
  30. 30. Summary ๏ MQTT is very suitable for IoT!! ๏ SensorThings API provides the greatness of both HTTP and MQTT. ๏ SensorThings HTTP REST is suitable for historical data and analytics. ๏ SensorThings MQTT is suitable for real-time applications.
  31. 31. References ๏ Introduction to MQTT ๏ https://www.oasis-open.org/committees/download.php/49205/ MQTT-OASIS-Webinar.pdf ๏ Eclipse IoT Survey 2015 ๏ http://www.slideshare.net/IanSkerrett/iot-developer-survey-2015
  32. 32. See you next week!

×