Reader small image

You're reading from  Raspberry Pi and MQTT Essentials

Product typeBook
Published inSep 2022
PublisherPackt
ISBN-139781803244488
Edition1st Edition
Right arrow
Author (1)
Dhairya Parikh
Dhairya Parikh
author image
Dhairya Parikh

Dhairya Parikh is an Electronics Engineer who currently works as a Data Engineer at Accenture. He has a year’s experience in building and maintaining data pipelines for a huge amount of data. In his free time, he builds IoT and Machine Learning projects and even writes about them. He has written several project articles for Circuit Cellar, which is a monthly tech magazine. He makes projects which positively impacts the society, making people’s life easier.
Read more about Dhairya Parikh

Right arrow

Understanding the MQTT protocol packet structure

MQTT control packets are how the data is managed within an MQTT network. For instance, as discussed in the previous section, when a client wants to connect to a broker, it sends a connect packet and, in response, gets a connack packet from the broker.

Similarly, when a client wants to publish something on a given topic, it sends a publish packet. When a client wants all the data arriving on a particular topic, it achieves that by subscribing to the specific topic using the subscribe packet.

In this section, we will provide a detailed discussion of each of the packets. Please note that we will be discussing MQTT v3.1.

Connect packet

The previous section mentions that parameters need to be passed along with a connect packet. The attributes of this message are as follows.

  • Fixed headers:

The fixed headers only contain the MQTT control packet type (which is the code for CONNECT); the remaining length will have...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Raspberry Pi and MQTT Essentials
Published in: Sep 2022Publisher: PacktISBN-13: 9781803244488

Author (1)

author image
Dhairya Parikh

Dhairya Parikh is an Electronics Engineer who currently works as a Data Engineer at Accenture. He has a year’s experience in building and maintaining data pipelines for a huge amount of data. In his free time, he builds IoT and Machine Learning projects and even writes about them. He has written several project articles for Circuit Cellar, which is a monthly tech magazine. He makes projects which positively impacts the society, making people’s life easier.
Read more about Dhairya Parikh