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

Checking the status of data on the localhost

In this section, we will check whether the sensor data sent from your Raspberry Pi can be received by Mosquitto via Node-RED on your Raspberry Pi with the following steps:

  1. Run the flow you created in the previous section on the Node-RED instance on your Raspberry Pi.
  2. Click the switch of the inject node to run this flow and publish the Grove temperature and humidity sensor data:

    Figure 10.16 – Run the flow to publish the data

  3. Check that the data was subscribed.

    There are currently two flows in this Node-RED instance. One is the flow of publishing data to the Mosquitto MQTT broker, and the other is the flow of subscribing to data from that broker. The subscribed flow is normally in a standby state, so when the data is published, the subscribed data is automatically output to the debug tab.

  4. Check the debug tab. You should see the data you published:

Figure 10.17 – Check the result of...