Node-RED is a programming software tool for wiring together hardware devices, APIs and online services in new and interesting ways. Node-RED is a flow-based software development tool developed originally by IBM for wiring together hardware devices, APIs and online services as part of the IoT.
In 2016, IBM company contributed Node-RED as an open source JS Foundation project
Node-RED Developers: IBM Emerging Technology, Nick O’Leary, Dave Conway-Jones
Node-RED is a powerful software tool for building IoT applications with a focus on simplifying the ‘wiring together’ of code blocks to carry out tasks. It uses a visual programming approach that allows developers to connect predefined code blocks, known as ‘nodes’, together to perform a task. The connected nodes, usually a combination of input nodes, processing nodes and output nodes, when wired together, make up a ‘flows’.
Originally developed as an open source project at IBM in late 2013, to meet their need to quickly connect hardware and devices to web services and other software – as a sort of glue for the IoT – it has quickly evolved to be a general purpose IoT programming tool. Importantly, Node-RED has rapidly developed a significant and growing user base and an active developer community who are contributing new nodes that allow programmers to reuse Node-RED code for a wide variety of tasks.
Although Node-RED software tool was originally designed to work with the Internet of Things, i.e. devices that interact and control the real world, as it has evolved, it has become useful for a range of applications.
Node-RED is a visual software tool for wiring the Internet of Things, but it can also be used for other types of applications to quickly assemble flows of services. The name is not the most intuitive name. The reason why ‘Node’ is in the name is because the tool is implemented as Node application but from a consumer point of view that’s really only an internal implementation detail. Node-RED is available as open source and has been implemented by the IBM Emerging Technology organization.
Node-RED is included in the IBM Bluemix Internet of Things starter application, but you can also deploy it as Node.js application separately. To use Node-RED for Internet of Things scenarios you need to add the Internet of Things Foundation service to your Bluemix application. The IoT service allows to register and connect different types of devices. After this you can use the incoming and outgoing MQTT nodes in your flows.
Node-RED can not only be used for IoT applications, but it is a generic event-processing engine. For example you can use it to listen to events from http, websockets, tcp, Twitter and more and store this data in databases without having to program much if at all. You can also use it for example to implement simple REST APIs.
If you are IoT Developer then you might get multiple questions like, How to manage heterogeneous hardware and software environments? How to stay away from the cloud and use a local server? Node-RED provides an elegant solution to merge different IoT devices and services, and stay within a local area network.
Node-RED software tool is based on a graphical interface and rely on three main concepts:
- A project is called a flow, and consists of data and functions linked together.
- The messages carry data from one node to another.
- The nodes are functions that generate, transform or use messages.
The Node-RED tool GUI consists on three parts, from left to right:
- The left pane lists all the nodes, grouped by categories.
- The centre pane corresponds to the working area, where the flow is going to be designed.
- The right pane provides useful tools as documentation, a console for debugging, and the organisation for the dashboard.
Node-RED Flow-based Programming:
Invented by J. Paul Morrison in the 1970s, flow-based programming is a way of describing an application’s behavior as a network of black-boxes, or “nodes” as they are called in Node-RED. Each node has a well-defined purpose; it is given some data, it does something with that data and then it passes that data on. The network is responsible for the flow of data between the nodes.
Node-RED consists of a Node.js-based runtime that you point a web browser at to access the flow editor. Within the browser you create your application by dragging nodes from your palette into a workspace and start to wire them together. With a single click, the application is deployed back to the runtime where it is run.
The palette of nodes can be easily extended by installing new nodes created by the community and the flows you create can be easily shared as JSON files.
History of Node-RED software tool:
Node-RED started life in early 2013 as a side-project by Nick O’Leary and Dave Conway-Jones of IBM’s Emerging Technology Services group.
What began as a proof-of-concept for visualising and manipulating mappings between MQTT topics, quickly became a much more general tool that could be easily extended in any direction.
It was open-sourced in September 2013 and has been developed in the open ever since, culminating in it being one of the founding projects of the JS Foundation in October 2016.
It is a model that lends itself very well to a visual representation and makes it more accessible to a wider range of users. If someone can break down a problem into discrete steps they can look at a flow and get a sense of what it is doing; without having to understand the individual lines of code within each node.
It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
Node-RED IoT Platform’s key features:
Browser-based flow editing:
Node-RED provides a browser-based flow editor that makes it easy to wire together flows using the wide range of nodes in the palette. Flows can be then deployed to the runtime in a single-click.
A built-in library allows you to save useful functions, templates or flows for re-use.
Built on Node.js:
The light-weight runtime is built on Node.js, taking full advantage of its event-driven, non-blocking model. This makes it ideal to run at the edge of the network on low-cost hardware such as the Raspberry Pi as well as in the cloud.
With over 225,000 modules in Node’s package repository, it is easy to extend the range of palette nodes to add new capabilities.
The flows created in Node-RED are stored using JSON which can be easily imported and exported for sharing with others.
An online flow library allows you to share your best flows with the world.
Node-RED Installation Steps:
Before you can install Node-RED, you must have a working install of Node.js. We recommend the use of Node.js LTS 8.x. Users of Node.js 6.x and 4.x should ensure they have the latest updates. Node-RED no longer supports Node.js 0.12.x or 0.10.x.
We have specific instructions available for certain hardware platforms and operating systems:
- Raspberry Pi
- BeagleBone Black
Linux and OSX users should install the packaged version of Node.js for your specific operating system, or get the latest Long Term Support (LTS) version from the download site.
To check your version of Node.js
The easiest way to install Node-RED is to use the node package manager, npm, that comes with Node.js. Installing as a global module adds the command node-red to your system path:
sudo npm install -g –unsafe-perm node-red
How to run Node-RED?
If you have installed Node-RED as a global npm package, you can use the node-red command:
MeenaG IoT team really like the way Node-RED manages heterogenous hardware and software environments, and offers great flexibility.
The same laptop runs the server and displays the dashboard, or separate BeagleBone Green Wireless runs the server and an independent tablet displays the dashboard.
Link to Node-RED Platform – http://nodered.org/
If you want to try other open source IoT platforms then here is the list – Link
If you have any questions on Node-RED IoT Platform then feel free to get quick answers from our IoT Developers Community – Link