Member-only story
MQTT Beginners Guide
The IoT protocol explained with Python

Why should you spend 5 minutes of your life reading this story? Because after reading this…
- …you have a basic understanding of the MQTT protocol
- …you know when to use MQTT
- …you have the practical experience and can follow along the provided examples using the free Mosquitto MQTT broker and Python MQTT client library Paho-MQTT.
I recommend also following along with this article with my video on YouTube, which explains some more details behind the theoretical concepts and technical implementation.
MQTT Basics
MQTT is not a new protocol. The first version was published back in 1999, but its popularity is dramatically increasing recently, especially in the Internet Of Things (IoT) context.
There are more and more devices, sensors, phones, embedded systems like connected cars or smart homes with the need to communicate with each other. With the rise of the IoT revolution, MQTT is experiencing a second spring.
MQTT is an open and simple client server publish/subscribe message transport protocol designed for machine-to-machine communication between different devices in environments of high latency and low network bandwidth. Alright — what the hell does this mean? Let’s break it down after a short overview picture.

- Machine-to-machine communication
This one is quite easy. One system needs to exchange information with other systems. In the IoT context, the need for communication between devices increases dramatically.
Everything is connected — in a smart home, your fridge can talk to your vacuum cleaner. You can switch on the lights with your smartphone and order new dog food with your voice over smart speakers.