SlideShare a Scribd company logo
Understanding IoT Data Protocol
Tegar Imansyah - 4 November 2018
About
● Backend Engineer for Ngabarin IoT Platform
● Surabaya.py Organizer
● Mechatronics Engineering from PENS
● Interested in: Microcontroller, Raspberry Pi, Linux, Web, Data
Get in touch:
http://github.com/tegarimansyah
http://t.me/tegarimansyah
http://linked.in/tegarimansyah
Agenda
● Understanding IoT
● HTTP Request
● WebSocket
● MQTT
● Conclusion
Are you familiar with...
Web framework Microcontroller
WebSocket
Communication Protocol
What is IoT
IoT = Internet of Things, a fancy buzzword when we talk
about Industry 4.0
The Internet of things is the network of physical devices.
Combination from electronics, software, sensors,
actuators, and connectivity which enables these things to
connect, collect and exchange data. - Wikipedia, with
adjustments.
Electronics Software
Sensors Actuators Connectivity
Light Sensor
Humidity Sensor
Water Pump
Microcontroller Server
Sensor
Actuator
Microcontroller
Gateway
(Microcontroller)
Sensor
Actuator
Microcontroller
Sensor
Actuator
Microcontroller
Server
Gateway
(Microcontroller)
Gateway
(Microcontroller)
Connectivity
Why IoT Device Different With Computer
Google Cloud F1-micro (Smallest)
● 0.2 vCPU Intel Xeon E5
● Memory: 0.6 GB = 588 MiB
ESP32 (Popular Powerful Microcontroller)
● CPU : Dual Core 240 Mhz
● Memory: 520 KiB
Arduino Uno (ATmega328) - (Most Popular dev board)
● CPU : 20 Mhz
● Memory: 2048 B = 2 KiB
What to discuss
● HTTP
● Websocket
● MQTT
HTTP
HTTP is a request–response protocol in the
client–server computing model.
Request is usually using REST -
GET, POST, PUT, DELETE
Response with status code:
200 - OK
201 - Created
400 - Bad Request
etc….
Test HTTP
Server Side
Client Side
Light Sensor
Humidity Sensor
Water Pump
Microcontroller Server
Problem: How to send data to Microcontroller in Real
Time?
WebSocket
Websockets allows persistent
connections with simultaneous
bi-directional communication.
They come with all the benefits of
HTTP since websockets initially
start off as an HTTP handshake,
before getting elevated to
continue the rest of the
communication in websockets.
Test WebSocket
Callback Function
MQTT
MQTT is a publish-subscribe-based messaging protocol.
It works on top of the TCP/IP protocol.
It is designed for connections with remote locations where a "small code footprint"
is required or the network bandwidth is limited.
The publish-subscribe messaging pattern requires a message broker.
MQTT
16
Brokertable-lamp
room-lamp
subscribe
table-lamp
subscribe
room-lamp
subscribe table-lamp
subscribe room-lamp
subscribe table-lamp
subscribe room-lamp
MQTT
17
Brokertable-lamp
room-lamp
publish table-lamp (255,0,0)
receive table-lamp (255,0,0)
receive table-lamp (255,0,0)
Who is Broker?
Adafruit.io
Google
Cloud IoT Core
Test MQTT
Publisher Subscriber
What to learn about MQTT
● Topic
○ Wildcart = home/+/lamp
○ Wildcart = home/bedroom/#
● User & Access Control List (ACL)
○ %u/home/bedroom => for user == tegar, only able to access tegar/home/bedroom
● Quality of Service (QoS)
○ 0
○ 1
○ 2
● Broker Bridging
MQTT over WebSocket (?)
=> HTTP, HTTPS, FTP, FILE
MQTT <> HTTP, HTTPS
WebSocket == HTTP (HTTPS via wss)
MQTT over WebSocket
TCP/IP
Physical Layer
:
HTTP WebSocket MQTT
Browser
HTTP vs MQTT performance tests
Credit to: https://flespi.com/blog/http-vs-mqtt-performance-tests
1K Messages Bytes Transmitted Mosquitto MQTT
Client
MQTT over SSL
1 Publish per msg
283.743 5.911
HTTPS
1 POST per msg
15.373.263 115.669
HTTPS
1 POST with 1000
msg
20.515 0.307
Conclusion: MQTTS is 20 times faster and requires 50 times less traffic on the task of
posting consistent time-valuable data.
Conclusion
● Be wise to choose your protocol, there is no One Size Fits All
● HTTP best for one way transmission (client-to-server)
Websocket best for full-duplex persistent connection in browser
MQTT best for persistent connection in IoT
● Many other message broker you can try: AMQP, Kafka, etc.
They best on their own purpose.
Ready to Play with IoT?
● No Undo
● Unseen
● Broken = Start
from Beginning
● Very Fun!
Thanks!
Any questions?
You can find me at @tegarimansyah
Get slide and code:
https://github.com/tegarimansyah/presentation/tree/PyCon-ID-2018

More Related Content

PDF
Walkthrough google cloud platform
PDF
Building Open Source IoT Cloud
PDF
Building Applications with Eclipse IoT, Block by Block
PPTX
Drone data sync
PDF
The Bitreactive Case
PPTX
ThingStudio_persys17
PDF
DevOps: Coding Defines Monitoring
PPTX
FIWARE Developers Week_IoT basic exercises
Walkthrough google cloud platform
Building Open Source IoT Cloud
Building Applications with Eclipse IoT, Block by Block
Drone data sync
The Bitreactive Case
ThingStudio_persys17
DevOps: Coding Defines Monitoring
FIWARE Developers Week_IoT basic exercises

What's hot (20)

PDF
IoT with Google ecosystem
PDF
Demystifying IoT : Bringing the cloud to connected devices with IoT Station
PPTX
IoT Agents (Introduction)
PDF
FIWARE Global Summit - How IoT Companies and Startups are Using FIWARE as the...
PDF
Gobot Meets IoT : Using the Go Programming Language to Control The “Things” A...
PPTX
FIWARE IoT Introduction 1
PDF
Building an IOT app using MQTT
PDF
[APIdays INTERFACE 2021] Now that we have K8s, can we stop re-inventing API p...
PDF
Xamarin and azure iot
PDF
Beacosystem Talk @ MongoDB User Group Dublin @sos100
PDF
FIWARE Global Summit - Professional Dashboards for Dummies - Build Your Smart...
PDF
FIWARE Wednesday Webinars - Short Term History within Smart Systems
PPTX
PDF
ITCamp 2018 - Gunnar Peipman - Multi-tenant web applications with ASP.NET Core
PPTX
Multi-tenant web applications with ASP.NET Core
PDF
From localhost to the cloud: A Journey of Deployments
PPTX
FIWARE Wednesday Webinars - FIWARE Overview
PPTX
FIWARE Wednesday Webinars - How to Debug IoT Agents
PDF
FIWARE Tech Summit - FIWARE NGSIv2 Introduction
PDF
Introduction to Filecoin
IoT with Google ecosystem
Demystifying IoT : Bringing the cloud to connected devices with IoT Station
IoT Agents (Introduction)
FIWARE Global Summit - How IoT Companies and Startups are Using FIWARE as the...
Gobot Meets IoT : Using the Go Programming Language to Control The “Things” A...
FIWARE IoT Introduction 1
Building an IOT app using MQTT
[APIdays INTERFACE 2021] Now that we have K8s, can we stop re-inventing API p...
Xamarin and azure iot
Beacosystem Talk @ MongoDB User Group Dublin @sos100
FIWARE Global Summit - Professional Dashboards for Dummies - Build Your Smart...
FIWARE Wednesday Webinars - Short Term History within Smart Systems
ITCamp 2018 - Gunnar Peipman - Multi-tenant web applications with ASP.NET Core
Multi-tenant web applications with ASP.NET Core
From localhost to the cloud: A Journey of Deployments
FIWARE Wednesday Webinars - FIWARE Overview
FIWARE Wednesday Webinars - How to Debug IoT Agents
FIWARE Tech Summit - FIWARE NGSIv2 Introduction
Introduction to Filecoin
Ad

Similar to Understanding IoT Data Protocol - PyCon ID 2018 (20)

PDF
MQTT - A practical protocol for the Internet of Things
PDF
MQTT: A lightweight messaging platform for IoT
PDF
MQTT and SensorThings API MQTT Extension
PDF
Mqtt overview (iot)
ODP
Mqtt
PDF
MQTT – protocol for yours IoT
PDF
A Short Report on MQTT protocol for Internet of Things(IoT)
PDF
fajfkljflafjflkflkajflajflkfkjaslfkfljjaf
PDF
IRJET- MQTT in Internet of Things
PPTX
03_MQTT_Introduction.pptx
PPTX
Understanding of MQTT for IoT Projects
PDF
Messaging for the Internet of Awesome Things
PDF
Protocols for IoT
PDF
MQTT 101 - Getting started with the lightweight IoT Protocol
PPT
UNIT2_PPT.ppt
PDF
Mqtt – a protocol for the internet of things
PDF
Internet of Things (IoT) protocols COAP MQTT OSCON2014
PDF
Introducing MQTT
MQTT - A practical protocol for the Internet of Things
MQTT: A lightweight messaging platform for IoT
MQTT and SensorThings API MQTT Extension
Mqtt overview (iot)
Mqtt
MQTT – protocol for yours IoT
A Short Report on MQTT protocol for Internet of Things(IoT)
fajfkljflafjflkflkajflajflkfkjaslfkfljjaf
IRJET- MQTT in Internet of Things
03_MQTT_Introduction.pptx
Understanding of MQTT for IoT Projects
Messaging for the Internet of Awesome Things
Protocols for IoT
MQTT 101 - Getting started with the lightweight IoT Protocol
UNIT2_PPT.ppt
Mqtt – a protocol for the internet of things
Internet of Things (IoT) protocols COAP MQTT OSCON2014
Introducing MQTT
Ad

More from Tegar Imansyah (6)

PDF
Lessons Learned for Internet of Things for Students
PDF
Lessons learned for internet of things
PDF
Technology for Your Business
PDF
Understanding IoT with Cloud IoT Core
PDF
Google Assistant - GDG Surabaya DevFest 2018
PDF
DIY Home Smart Lighting System with Micropython - PyCon MY 2018
Lessons Learned for Internet of Things for Students
Lessons learned for internet of things
Technology for Your Business
Understanding IoT with Cloud IoT Core
Google Assistant - GDG Surabaya DevFest 2018
DIY Home Smart Lighting System with Micropython - PyCon MY 2018

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Cloud computing and distributed systems.
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
Teaching material agriculture food technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Assigned Numbers - 2025 - Bluetooth® Document
MYSQL Presentation for SQL database connectivity
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
“AI and Expert System Decision Support & Business Intelligence Systems”
Cloud computing and distributed systems.
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Teaching material agriculture food technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
A comparative analysis of optical character recognition models for extracting...
Chapter 3 Spatial Domain Image Processing.pdf
Advanced methodologies resolving dimensionality complications for autism neur...

Understanding IoT Data Protocol - PyCon ID 2018