Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical Node-RED Programming

You're reading from   Practical Node-RED Programming Learn powerful visual programming techniques and best practices for the web and IoT

Arrow left icon
Product type Paperback
Published in Mar 2021
Publisher Packt
ISBN-13 9781800201590
Length 326 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Taiji Hagino Taiji Hagino
Author Profile Icon Taiji Hagino
Taiji Hagino
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Node-RED Basics
2. Chapter 1: Introducing Node-RED and Flow-Based Programming FREE CHAPTER 3. Chapter 2: Setting Up the Development Environment 4. Chapter 3: Understanding Node-RED Characteristics by Creating Basic Flows 5. Chapter 4: Learning the Major Nodes 6. Section 2: Mastering Node-RED
7. Chapter 5: Implementing Node-RED Locally 8. Chapter 6: Implementing Node-RED in the Cloud 9. Chapter 7: Calling a Web API from Node-RED 10. Chapter 8: Using the Project Feature with Git 11. Section 3: Practical Matters
12. Chapter 9: Creating a ToDo Application with Node-RED 13. Chapter 10: Handling Sensor Data on the Raspberry Pi 14. Chapter 11: Visualize Data by Creating a Server-Side Application in the IBM Cloud 15. Chapter 12: Developing a Chatbot Application Using Slack and IBM Watson 16. Chapter 13: Creating and Publishing Your Own Node on the Node-RED Library 17. Other Books You May Enjoy Appendix: Node-RED User Community

What is Node-RED?

Node-RED is one of the FBP tools that we have described so far. Developed by IBM's Emerging Technology Services team, Node-RED is now under the OpenJS Foundation.

Overview

FBP was invented by J. Paul Morrison in the 1970s. As we mentioned earlier, FBP describes the behavior of the application as a black box network, which in Node-RED is described as a "node." Processing is defined in each node; data is given to it, processing is performed using that data, and that data is passed to the next node. The network plays the role of allowing data to flow between the nodes.

This kind of programming method is very easy to use to make a model visually and makes it easy to access for several layer users. Anybody can understand what the flow is doing if a problem is broken down into each step. That's why you don't need to the code inside the nodes:

Figure 1.3 – Node-RED Flow Editor as an FBP tool

Figure 1.3 – Node-RED Flow Editor as an FBP tool

Flow editor and runtime

Node-RED is not only a programming tool but also an execution platform that wraps up the Node.js runtime for applications that are built using Node-RED.

We need to use the flow editor to make Node-RED applications for IoT, web services, and more. The flow editor is also a Node.js web application. We will tell you how to use flow editor clearly in Chapter 3, Understanding Node-RED Characteristics by Creating Basic Flows.

The flow editor, which is the core function of Node-RED, is actually a web application made with Node.js. It works with the Node.js runtime. This flow editor operates within the browser. You must select the node you want to use from the various nodes in the palette and drag it to the workspace. Wiring is the process of connecting the nodes to each other, which creates an application. The user (developer) can deploy the application to the target runtime with just one click.

The palette that contains various nodes can easily be expanded as you can install new nodes created by developers, meaning you can easily share the flow you created as a JSON file to the world. Before we explore the benefits of Node-RED, let's look at the brief history behind its creation.

History and origin of Node-RED

In early 2013, Nick-O'Leary and Dave Conway-Jones from IBM UK's Emerging Technology Services Team created Node-RED.

Originally, it was a just proof of concept (PoC) to help visualize and understand the mapping between Message Queue Telemetry Transport (MQTT) topics, but soon, it became a very popular tool that could be easily extended to various uses.

Node-RED became open source in September 2013 and remains to be developed as open source now. It became one of the founding projects of the JS Foundation in October 2016, which has since merged with the Node.js Foundation to create the OpenJS Foundation, doing so in March 2019.

The OpenJS Foundation supports the growth of JavaScript and web technologies as a neutral organization to lead and keep any projects and fund activities jointly, which is beneficial to the whole of the ecosystem. The OpenJS Foundation currently hosts over 30 open source JavaScript projects, including Appium, Dojo, jQuery, Node.js, and webpack.

Node-RED has been made available under the Apache 2 license, which makes it favorable to use in a wide range of settings, both personal and commercial:

Figure 1.4 – Dave Conway-Jones and Nick O'Leary

Figure 1.4 – Dave Conway-Jones and Nick O'Leary

Why is it Called Node-RED?

The official documentation (https://nodered.org/about/ states that the name was an easy play on words that sounded like "Code Red." This was a dead end, and Node-RED was a big improvement on what it was called in its first few days of conception. The "Node" part reflects both the flow/node programming model, as well as the underlying Node.js runtime.

Nick and Dave never did come to a conclusion on what the "RED" part stands for. "Rapid Event Developer" was one suggestion, but it's never been compelled to formalize anything. And so, the name "Node-RED" came to life.

You have been reading a chapter from
Practical Node-RED Programming
Published in: Mar 2021
Publisher: Packt
ISBN-13: 9781800201590
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime