Node-Red Admin Interface, Node and Flow Basics

To administer node-red you will need to go the admin url.

The admin url is the machine name or IP address followed by the port number. e.g

  •  127.0.0.1:1880/ if you are running the browser on the same machines as node-red.
  • localhost:1880/
  • steve-laptop:1880/ when running node-red on a remote machine
  • 192.168.1.154:1880/

I currently run node-red on a Raspberry Pi and use a second machine (windows 10) to create flows.

node-red-browser

 

Using The Node Red Admin User Interface (UI)

When you open the node-red admin screen for the first time you should start with an empty work space as shown in the earlier screen shot above.



The default view is a three column layout with nodes on the left ,the flows work space in the middle and a third column on the right.

The third column or output pane has two or three tabs – info, debug and dashboard ( if installed).

node-red-screen.jpg

Node-Red Nodes

The nodes on the left are arranged in categories.

A node-red installation will contain core nodes and the nodes are organized into groups

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.

You can install additional nodes using either the npm package manager or using the Admin Interface.

Frequently Used Nodes

There are two nodes that you will find yourself using quite often.

They are the debug node and the inject node.

Inject Node

Node-Red is an event based system and something must happen to create an event.

The inject nodes will fire a message ( msg) into the next node and is used to trigger a flow.

Debug Node

The debug node is used for displaying output for debugging purposes.

By default it will display the message payload but can be configured to display the entire message object.

Node Properties

If you double click on the node on the canvas then you can edit the node properties.

All Nodes have a name property. This is the name that is displayed on the canvas.

node-properties

A Basic Flow

You can wire the inject node into the debug node to create a basic flow as shown below.

Basic-Flow-node-red

The above flow will inject a unix timestamp into the debug node which can be viewed in the debug tab in the far right pane.

Deploying Flows

When you start node red then all currently enabled flows are automatically started.

If you edit or create a new flow you will need to deploy it using the deploy button.

The Deploy button on the top right change from grey to maroon when changes have been made to a flow to indicate that in it needs to be deployed.

node-red-deploy

 

You can choose to deploy all flows in the workspace, modified flows or modified nodes as shown below:

Deploy-flows

Working With Flows

The workspace consists of all of your flows.

Along the top of the workspace pane are tabs that are used to open previously created flows.

You can create new Flows by clicking on the Plus button on the top right.

create-new-flow

When you create a new empty Flow it is given a default name and is enabled by default.

Generally a new flow is created when the flow needs to do a distinct task.

To add nodes to a flow drag them from the node palette on the left into the active flow in the middle pane.

You can link the nodes together by dragging a wire between them.

A collection of nodes is called a flow.

Note: All flows in the workspace share the same node.js event loop.

Renaming, Deleting Disabling Flows

A flow called Flow1 is pretty meaningless and so you should rename it to something more meaningful.

You can access the flow properties from the settings tab.

You need to select the flow in the workspace and then. to open the flow go to the menu (top right) node-menu and select flows> rename flow, delete, add. node-delete-flow

If you select rename then a window opens that displays the flow properties .

You can rename the flow, and there is also a toggle to enable/disable it and also a button to delete it.

There is also a delete button to delete the flow on the top left.

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:

disable-node-red-flow

You should notice the icon in the flow tab that indicates that the flow is disabled.

=====>Understanding the Message object



Related Tutorials and resources:

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *