Reader small image

You're reading from  Internet of Things from Scratch

Product typeBook
Published inFeb 2024
PublisherPackt
ISBN-139781837638543
Edition1st Edition
Right arrow
Author (1)
Renaldi Gondosubroto
Renaldi Gondosubroto
author image
Renaldi Gondosubroto

Renaldi Gondosubroto is an accomplished software engineer and developer advocate in the tech community. With a wealth of experience in developing proprietary and open-source solutions, he has made significant contributions to numerous organizations and communities. Currently, he holds all 12 AWS certifications, along with 20 Microsoft Azure certifications. He has a Bachelor of Science in Computing and Software Systems from the University of Melbourne and a Master of Science in Computer Science from Columbia University. Outside of the industry, he is active in the academic community, with his research focused on IoT and Artificial Intelligence. Having spoken at over 40 events, conferences, and workshops, he has been an international speaker for the past six years, sharing his experiences and projects. He aims to build open-source solutions and deliver content that can help people achieve more value in what they do and promote best practices for practitioners.
Read more about Renaldi Gondosubroto

Right arrow

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 page is locked
Previous PageNext Page
You have been reading a chapter from
Internet of Things from Scratch
Published in: Feb 2024Publisher: PacktISBN-13: 9781837638543

Author (1)

author image
Renaldi Gondosubroto

Renaldi Gondosubroto is an accomplished software engineer and developer advocate in the tech community. With a wealth of experience in developing proprietary and open-source solutions, he has made significant contributions to numerous organizations and communities. Currently, he holds all 12 AWS certifications, along with 20 Microsoft Azure certifications. He has a Bachelor of Science in Computing and Software Systems from the University of Melbourne and a Master of Science in Computer Science from Columbia University. Outside of the industry, he is active in the academic community, with his research focused on IoT and Artificial Intelligence. Having spoken at over 40 events, conferences, and workshops, he has been an international speaker for the past six years, sharing his experiences and projects. He aims to build open-source solutions and deliver content that can help people achieve more value in what they do and promote best practices for practitioners.
Read more about Renaldi Gondosubroto