Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Raspberry Pi and MQTT Essentials

You're reading from  Raspberry Pi and MQTT Essentials

Product type Book
Published in Sep 2022
Publisher Packt
ISBN-13 9781803244488
Pages 272 pages
Edition 1st Edition
Languages
Author (1):
Dhairya Parikh Dhairya Parikh
Profile icon Dhairya Parikh

Table of Contents (14) Chapters

Preface 1. Part 1:Covering the Basics
2. Chapter 1: Introduction to Raspberry Pi and MQTT 3. Chapter 2: MQTT in Detail 4. Chapter 3: Introduction to ESP Development Boards 5. Chapter 4: Node-RED on Raspberry Pi 6. Part 2: Practical Implementation – Building Two Full-Scale Projects
7. Chapter 5: Major Project 1: IoT Weather Station 8. Chapter 6: Major Project 2: Smart Home Control Relay System 9. Part 3: How to Take Things Further – What Next?
10. Chapter 7: Taking Your MQTT Broker Global 11. Chapter 8: Project Prototype to Product – How? 12. Index 13. Other Books You May Enjoy

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 chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}