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

Mini-project 1: NodeMCU as an MQTT client

This is the first project we will be doing related to MQTT and our Raspberry Pi broker.

First, we will start by setting up the NodeMCU board. No external connections need to be made as we are only controlling the on-chip LED. This will be divided into two parts:

  • Node MCU setup and code explanation
  • Raspberry Pi setup and project demonstration

We will first set up our NodeMCU development board for this project.

Part 1 – NodeMCU development board setup

In this section, we will program our NodeMCU board to act as an MQTT client and control its onboard LED using an external device (your home computer, in this case).

For this, we will write a sketch that gives us access to the features we need. We will be using the pubsub library for this purpose. The code we will be using will do the following:

  1. First, it will connect to an MQTT server.
  2. Once the connection has been established, it will publish "...
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