What this book covers
Chapter 1, Introduction to Raspberry PI and MQTT, provides an introduction to the hardware we will be using, the Raspberry Pi. Moreover, it will also cover the basics of MQTT and how the communication protocol actually works. Next, we will learn to set up the Raspberry Pi. This includes installing the popular Debian-based Raspberry Pi OS on our Raspberry Pi. After that, we will install the necessary libraries and packages to make our device a local MQTT broker.
Chapter 2, MQTT in Detail, covers how exactly MQTT works. This includes a gentle introduction to MQTT brokers and clients, and different MQTT control packets will be covered in detail. Finally, we will see a demonstration of how a client connects and communicates with a broker.
Chapter 3, Introduction to ESP Development Boards, is all about implementing what we learned in the previous chapter. It will first introduce you to the popular ESP development boards – NodeMCU and ESP32. After covering the specifications of each board, we will move on to learn how to set up the boards as an MQTT client. Finally, we will create our first project wherein we will connect to our Raspberry Pi’s MQTT broker and control the onboard LED through MQTT.
Chapter 4, Node-RED on Raspberry Pi, gets you acquainted with very popular software for the Raspberry Pi – Node-RED. It is divided into four sections. First is an introduction to Node-RED, followed by a guide to installing and setting up Node-RED on Raspberry Pi. After that, we will cover the Node-RED MQTT and dashboard components, and then create a simple project to implement everything we have learned.
Chapter 5, Major Project 1: IoT Weather Station, is where, now that we have the knowledge from all the topics discussed in the previous chapters, we will be working on our first major project: making an IoT weather station. This chapter provides step-by-step instructions on how to build this.
Chapter 6, Major Project 2: Smart Home Control Relay System, helps you create a smart home device to control wall switches using the Node-RED dashboard hosted on the Raspberry Pi. The device will be based on the popular ESP32 development board. For this project, we will be preparing a PCB instead of creating the circuit on a breadboard for a more finished and professional look.
Chapter 7, Taking Your MQTT Broker Global, is where we will discuss the advantages of having an online MQTT broker further, and two major options that we currently have to achieve these advantages. We can still use the local broker on our Pi, but we can route all the data to any destination through the internet.
Chapter 8, Project Prototype to Product, How?, starts by exploring IoT services provided by some popular cloud services, such as AWS and GCP, now that the book has covered all the essentials required to get you familiar with all the concepts related to Raspberry Pi and MQTT. We will even create a project demo integrating our Node MCU board with AWS IoT.