MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol widely used in IoT systems. It allows devices like sensors, robots, and microcontrollers to communicate over the internet with low bandwidth and power usage.
🌐 What is MQTT?
MQTT is a publish-subscribe protocol. Instead of sending data directly between devices, all communication happens through a central broker (like a post office).
🧩 How MQTT Works
Broker: The central server that handles messages
Publisher: A device (e.g. ESP32) that sends data
Subscriber: A device or app that receives data
Topic: A channel or label used to organize messages (like /weather/temp)
Example: Your ESP32 publishes temperature data to the topic /robot/weather/temp. A mobile app subscribes to that topic and displays the latest temperature reading.
📦 Why Use MQTT?
Low bandwidth – ideal for IoT devices
Reliable – even over spotty Wi-Fi
Flexible – one message can be received by many devices
🔧 MQTT Terminology at a Glance
Term
Meaning
Broker
Server that manages all messages
Client
Any device connected to broker (ESP32, mobile app, etc.)