Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Raspberry Pi and MQTT Essentials
  • Table Of Contents Toc
Raspberry Pi and MQTT Essentials

Raspberry Pi and MQTT Essentials

By : Dhairya Parikh
5 (1)
close
close
Raspberry Pi and MQTT Essentials

Raspberry Pi and MQTT Essentials

5 (1)
By: Dhairya Parikh

Overview of this book

The future of IoT has the potential to be limitless. Wouldn’t it be great if you could add it to your own technological stacks? But where to start? With the basics, of course. In this book, you will start by learning about the most popular hardware and communication protocol, Raspberry Pi and MQTT. You will see how to use them together by setting up your own MQTT server on Raspberry Pi and understand how it works. This book explores MQTT in detail, including the clients and devices that you can connect to your server. You will discover two very popular IoT development boards among project developers: the ESP8266 and ESP32 development boards. Then, you will learn how to build interactive dashboards on your Pi and monitor your client devices. The book also shows you how to build a dashboard using another popular software – Node-RED. You will be able to put your skills to the test by creating two full-scale projects. That’s not all: you will also learn how to host your own MQTT server on a virtual cloud service. Finally, you will be guided on how to move forward from here, what technologies to learn, and some project recommendations to polish or test your knowledge. By the end of this book, you will be able to build meaningful projects using Raspberry Pi and MQTT and create dashboards for your projects on Node-RED.
Table of Contents (14 chapters)
close
close
1
Part 1:Covering the Basics
6
Part 2: Practical Implementation – Building Two Full-Scale Projects
9
Part 3: How to Take Things Further – What Next?

A gentle introduction to Raspberry Pi

This section will introduce you to the Raspberry Pi, the world’s most affordable credit card-sized computer.

There is a wide range of available Raspberry Pi development boards available. They are primarily available in four formats:

  • Model B: These are full-size boards equipped with Ethernet and USB ports.
  • Model A: These are square-shaped boards, considered light models of Raspberry Pi. They are different from the Model B because of the absence of an Ethernet port, fewer USB ports, and a slightly less powerful processor chip. They come at a lower price due to these cuts.
  • Zero: This is the cheapest and smallest Raspberry Pi available. It is equipped with a significantly less powerful and low-power processor, includes no USB or Ethernet port, and is equipped with a mini-HDMI port instead of a full-size HDMI.
  • Compute: This is Raspberry Pi 4 in a compact package for embedded applications. Additional RAM and eMMC Flash customizations are available (32 different variant configurations are listed on the official Raspberry Pi website).

The latest models of the Pi available are as follows:

  • Raspberry Pi Model 4B
  • Raspberry Pi Model 3 (B+, B, and A)
  • Raspberry Pi Zero W
  • Raspberry Pi 400 (a personal computer kit)
  • Raspberry Pi 4 Compute Module

We will cover the Raspberry Pi Model 4B in depth as it is the latest variant available and is the model we will be using throughout the book.

Raspberry Pi Model 4B

This is the latest development board from Raspberry Pi (Figure 1.2). It has several new and improved features that make it an incredible upgrade over the older models. The most significant change is the support of two 4K displays, which is an astonishing feat on hardware that costs 35 dollars.

Another distinctive feature is the upgraded CPU and RAM options. The latest board is powered by a new 1.5 GHz quad-core CPU, almost three times faster than the previous-generation processor. Moreover, the boards are available in 2 GB, 4 GB, and 8 GB LPDDR4 RAM configurations.

It also has USB C support, USB 3.0 support, and Gigabit Ethernet. The Raspberry Pi 4 is a viable dual-display desktop computer with these new hardware capabilities.

Figure 1.2 – Raspberry Pi Model 4B+: the latest Raspberry Pi development board

Figure 1.2 – Raspberry Pi Model 4B+: the latest Raspberry Pi development board

Now, we will dig a bit deeper and cover the hardware specifications of this development board in detail followed by a brief discussion of some popular operating systems that are available for this board.

Hardware specifications

The hardware specifications of the Raspberry Pi model 4 are as follows, as mentioned on the official Raspberry Pi 4 product page:

  • Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
  • 2 GB, 4 GB, or 8 GB LPDDR4-3200 SDRAM (depending on model)
  • 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE
  • Gigabit Ethernet
  • Two USB 3.0 ports; two USB 2.0 ports
  • Raspberry Pi standard 40-pin GPIO header (fully backward compatible with previous boards)
  • Two micro-HDMI ports (up to 4kp60 supported)
  • Two-lane MIPI DSI display port
  • Two-lane MIPI CSI camera port
  • Four-pole stereo audio and composite video port
  • H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode)
  • OpenGL ES 3.0 graphics
  • microSD card slot for loading operating system and data storage
  • 5V DC via USB-C connector (minimum 3A*)
  • 5V DC via GPIO header (minimum 3A*)
  • Power over Ethernet (PoE) enabled (requires separate PoE HAT)
  • Operating temperature: 0–50 degrees °C ambient

The following figure shows the available ports and some technical specifications of the Raspberry Pi 4:

Figure 1.3 – Raspberry Pi 4 ports and hardware specifications

Figure 1.3 – Raspberry Pi 4 ports and hardware specifications

Now that we are done with the hardware specifications, let’s move toward the available software options. As the Pi is a full-blown computer, it will run an operating system of its own. Hence, we will look at some popular operating systems available for the Raspberry Pi.

Operating systems

There are several operating systems available for the Raspberry Pi. We will look at some of the most popular operating systems listed on their official website:

  • Raspberry Pi OS (previously known as Raspbian OS).
  • Ubuntu Core: Ubuntu operating system developed explicitly for embedded boards, with optimizations focused on security and reliability.
  • LibreELEC: A distribution for multimedia applications based on the Kodi entertainment center.
  • Ubuntu Desktop: This is the desktop version of Ubuntu supported on Raspberry Pi Model 3B+ and above. One of the most popular Linux operating systems used worldwide focused on daily applications for home, school, and work.

Now that we have some knowledge about Raspberry Pi and MQTT, the next step is to learn how to setup our Raspberry Pi so that we can use it as a MQTT broker. That is exactly what the next section is about!

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Raspberry Pi and MQTT Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon