Building Arduino Projects for the Internet of Things

(Steven Felgate) #1
CHAPTER 3 ■ COMMUNICATION PROTOCOLS

MQTT


MQTT is a lightweight machine-to-machine protocol. It follows the publisher-subscriber
model, whereby a publisher publishes data to a server (a.k.a., a broker) and subscribers
receive the data. Publishers and subscribers do not know each other; they connect to
the broker, which makes this communication asynchronous. The broker notifies all
subscribers that relevant data has been published using the concept of topics. A topic
is similar to a newsfeed, in that you subscribe to certain topics you want to receive
news about. Publishers and subscribers could be sensors, machines, and mobile apps.
Figure  3-4 provides a high-level overview of the MQTT protocol.


Figure 3-3. HTTP request: POST method

Free download pdf