Book Image

Practical Node-RED Programming

By : Taiji Hagino
5 (1)
Book Image

Practical Node-RED Programming

5 (1)
By: Taiji Hagino

Overview of this book

Node-RED is a free and open source flow-based programming tool used to handle IoT data that allows programmers of any level to interconnect physical I/O, cloud-based systems, databases, and APIs to build web applications without code. Practical Node-RED Programming is a comprehensive introduction for anyone looking to get up to speed with the Node-RED ecosystem in no time. Complete with hands-on tutorials, projects, and self-assessment questions, this easy-to-follow guide will help you to become well versed in the foundations of Node-RED. You’ll learn how to use Node-RED to handle IoT data and build web applications without having to write complex code. Once you’ve covered the basics, you’ll explore various visual programming techniques and find out how to make sample flows as you cover web development, IoT development, and cloud service connections, and finally build useful real-world applications. By the end of this book, you’ll have learned how to use Node-RED to develop a real-world application from scratch, which can then be implemented in your business.
Table of Contents (19 chapters)
1
Section 1: Node-RED Basics
6
Section 2: Mastering Node-RED
11
Section 3: Practical Matters

Making a sample flow

In this section, we will create these two sensor data output flows in the Node-RED flow editor.

You will use the sensor modules you have prepared to collect data and create a sample flow to visualize it on Node-RED. By using two different sensor modules, we can learn the basics of data handling in Node-RED.

Use case 1 – light sensor

The first is a light sensor. Let's create a flow (application) that detects light and outputs the value detected by a fixed-point observation to a log:

Figure 5.13 – Use case 1 – getting light sensor data

Connect the light sensor module to the Raspberry Pi and use the Node-RED flow editor on the Raspberry Pi to output the data obtained as a standard output.

Use case 2 – temperature/humidity sensor

The second one is a temperature/humidity sensor. Let's create an application (flow) that detects temperature and humidity and outputs the value detected by a fixed...