From sensors and gateways to user applications, edge devices, databases and more, an IoT network can be complex, and connecting it all can be daunting. Node-RED is an open-source, flow-based programming tool developed by IBM to interconnect physical I/O, cloud-based systems, databases and application program interfaces (APIs). Node-RED provides an easy, visual tool for converging and controlling IoT interfaces.
What is Flow-Based Programming?
Flow-based programming functions within a network of black boxes, called nodes. Nodes primarily serve three functions – data output, data input, and data processing. The flow of data as it travels between nodes can be easily visualized in a flowchart. This makes the program easy to work with, even for someone with limited coding experience.
How Do You Use Node-RED?
Node-RED operates in a web browser and utilizes a drag-and-drop interface. Users can select from hundreds of pre-set nodes (or, with programming knowledge, write their own) and drag them onto the workspace. Nodes can perform many actions including analyzing texts, running commands, receiving requests, queuing messages and processing files.
For example, a non-programmer wants to perform analysis on a Twitter feed. A node can be placed in the workspace to represent the feed and set to output results. Another node is added to represent an analytical program and set to process data. A third node represents a specific email inbox and is set to receive data. “Wires” are placed to connect each node and represent the flow of data. The last step is to run the program to begin receiving results.
Perhaps one day, the user wants to analyze their Facebook feed instead of Twitter. The Twitter node could be edited or deleted and exchanged. Then the wire could be reconnected and the program run anew.
Why Use Node-RED?
Node-RED speeds up the process of connecting IoT networks. Even for expert coders, Node-RED streamlines the connection process, making it quicker and less repetitive. Node-RED also expands the talent pool, allowing for easier implementation of connected IoT without the need for expert knowledge or expensive software.
Node-RED has a multitude of applications from industrial IoT (IIoT) to home use to education. Sensors can be connected to monitor factory production lines and send data to the cloud along with text message alerts. At home, lights can be set to turn on and off in response to the time of day. Node-RED can be used as a teaching tool for basic coding and hardware hacking.
Node-RED Technical Requirements
Node-RED runs on node.js. To run devices or services with Node-RED, a user needs a node.js library that can communicate with them. Node.js allows Node-RED to run on less powerful devices, such as smart phones.