I’m asked to learn MQTT, and write some notes down through the process, so here I am. Glad to say that actually I do have some interest in IoT so it would be less boring, I guess.
Also, this is the first technical article of mine written in English, hope you’ll understand me if there is any error.
So, let’s go straight to the point, what is MQTT?
MQTT is an instant messaging protocol developed by IBM in 1999. It is a lightweight, publish/subscribe model-based messaging protocol designed specifically for resource-constrained devices, so that even if a device is running in a low-bandwidth, high-latency, unstable network, a certain level of reliable communication service can still be obtained through MQTT.
- The primary task of IoT is to complete device-to-device communication, and it is not only one-to-one but also many-to-many communication. MQTT is based on publish/subscribe mode and natively supports many-to-many communication, which is very much in line with the communication requirements of IoT.
- Compare to HTTP, MQTT is a lightweight protocol, which takes little data, making it ideal for low-bandwidth, resource-constrained IoT devices.
Both lightweight and fast, I guess Golang is more suitable to work with MQTT rather than Python, so I’ll just use Golang.
文章默认使用 CC BY-NC-SA 4.0 协议进行许可，使用时请注意遵守协议。