What is Node Red? –Node red is a flow based tool and IOT Dashboard developed by IBM and written in Node.js.It is an Open Source project
Node red lets you easily create program flows by joining together black box functions using a web interface.
In this tutorial you will learn
- How to install Node red on Windows and Linux
- How to start Node-red.
- How to Install the Node red Dashboard
- How to create,rename,delete ,disable,export and import flows Flows.
- How to create an IOT dashboard.
Installing Node Red
Before you Install node red you will need to install node.
Note: In response to a comment from Julian I have removed the instruction to update the package manager before installing.
Install node red using these instructions
Starting Node Red
To start node red on Windows go to a command prompt and type:
Note: you may need to change into the node directory.
Firstly running node by typing node may not work as apparently node is a shortcut to nodejs and the shortcut may not be present.
In addition there appears to be a naming conflict with another package. see this explanation
The screen shot show how to create the symbolic link
Now that node is working you can run node-red
Type node-red at the command prompt. If that doesn’t work it’s probable because the link isn’t configured as shown above. You can try the alternative.
As shown below
At the bottom of the screen it tells you the url to use to access the node-red web interface to create your flows
This consoles stays open and you will find it useful as when you start creating flows you will see log information appearing there.
You can also start node-red using the
which starts node-red as daemon.
to stop it use:
Connecting to The Admin Interface
To administer node web you will need to to the admin url which is 127.0.0.1:1880 if you are running the browser on the same machines as node-red.
I prefer to run node-red on a LInux machine and use a second machine to access it
You should start with an empty work space as shown above.
Installing The Node-Red Dashboard
The node red dashboard is an add-on module that lets you create live dashboards and is optional but recommended.
Here are the install instructions and a brief description.
- On Linux you need to have created the link to node or the install fails.
- You get a series of warnings at the end as shown belowThe warnings are nothing to worry about.
- You need to go to the ~/.node-red folder (Linux) to do the install otherwise when you open the node-red interface the dashboard icons will be missing.
The Node_red dashboard files are stored in a folder called node-red-dashboard in the node-modules folder.
Using The Node Red Admin Interface
You should start with an empty work space as shown in the screen shot below.
The default view is a three column layout with nodes on the left ,the flows work space in the middle and a third column with three tabs( info, debug and dashboard) on the right.
The nodes on the left are arranged in categories.
There is a input group, output group,functional nodes,dashboard or display nodes etc.
Here is a very good overview video.
Each node has a well defined function and contains its own data.
To add nodes to a flow drag them from the node palette on the left into the main workspace in the middle pane.
You can link the flows together by dragging a wire between them.
A collection of nodes in a workspace is called a flow.
The dashboard or display nodes appear on the User Interface (UI) dashboard.
To access this dashboard use the url – host:1800/ui or in my example: steve-laptop:1880/ui
An example UI dashboard is shown below:
The layout of the UI screen can be controlled in the dashboard tab (third column main screen) .
Node Red Demo Videos
The following videos shows you how to use the web interface to create a basic flows.
In this video tutorial I use Node-red to subscribe to an MQTT broker and display messages on a topic.
This video follows on from the first and in it we create an MQTT dashboard to control and display two MQTT sensors as well as learning more about using node-red..
Renaming and Disabling Flows
I couldn’t find this setting but a reader pointed it out.
Open the flow go to the menu (top right) and select flows> rename flow. You can rename the flow and and there is a toggle to enable/disable it.
You need then to redeploy for the setting to take effect.
You can also access this setting by double clicking on the flow name tab:
You can export a flow to install on another system.To do this you need to highlight each node in the flow and then click on Menu>export>clipboard.
The contents of the export file will be displayed click on export to clipboard.
You then need to open a file editor and paste the contents into the file using CTRL+V. Give the file a name and save it.
Deleting a Flow
To delete the flow click menu select flow and delete.
Importing a Flow
To import a flow you need to open it with a text editor and copy it then go to menu>import>clipboard
and paste in the flow.
Other Node-Red Tutorials
- Node-Red Setup and Admin Notes
- Configuring the MQTT Publish Node in Node-Red
- Understanding the Node-Red Message Object
- Storing Data in Node-Red Variables
- Securing Node-Red with SSL and Username Authentication