Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Internet of Things from Scratch

You're reading from  Internet of Things from Scratch

Product type Book
Published in Feb 2024
Publisher Packt
ISBN-13 9781837638543
Pages 438 pages
Edition 1st Edition
Languages
Author (1):
Renaldi Gondosubroto Renaldi Gondosubroto
Profile icon Renaldi Gondosubroto

Table of Contents (22) Chapters

Preface Part 1: Getting Started with the Internet of Things
Chapter 1: An Introduction to IoT Architecture, Hardware, and Real-Life Applications Chapter 2: Understanding and Designing IoT Networks Chapter 3: Integrating Application Protocols Chapter 4: Examining Communication and Connectivity Technologies Part 2: Developing and Optimizing IoT Systems for Smart Environments
Chapter 5: Realizing Wireless Sensor Networks within Smart Spaces Chapter 6: Creating Applications on the Edge Chapter 7: Working with Cloud Computing to Power IoT Solutions Chapter 8: Designing for Interoperability Part 3: Operating, Maintaining, and Securing IoT Networks
Chapter 9: Operating and Monitoring IoT Networks Chapter 10: Working with Data and Analytics Chapter 11: Examining Security and Privacy in IoT Chapter 12: Exploring and Innovating with Open Source IoT Part 4: Delving into Complex Systems and the Future of IoT
Chapter 13: Developing IoT Solutions for Digital Transformation within Industry 4.0 Chapter 14: Architecting Complex, Holistic IoT Environments Chapter 15: Looking Ahead into the Future of IoT Index Other Books You May Enjoy

Practical – creating an MQTT pub and sub communication between an ESP32 and a Raspberry Pi

One of the best ways to see MQTT in action is to create a pub/sub model based on communication between two devices. In this case, we will be using the ESP32 and the Raspberry Pi, where the ESP32 will serve as the publisher and subscriber while the Pi serves as the MQTT broker. Here is a breakdown of the roles of all three in this practical:

  • Publisher: The ESP32 publishes messages to the MQTT broker. It sends messages to the /topic/test1 topic when there is user input from the serial monitor, and it also periodically sends Hello World messages to the /topic/test3 topic every 15 seconds.
  • Subscriber: The ESP32 is also a subscriber, as it listens for messages on the /topic/test1 and /topic/test2 topics. When it receives a message on one of these topics, it processes the message in the callback function, which in this case prints the received message to the Serial Monitor.
  • Broker...
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}