Using the Node-Red Function Node- Beginners Guide

The function node is used to run JavaScript code against the msg object. The function node accepts a msg object as input and can return 0 or more message objects as output. This message object must have a payload property (msg.payload), and usually has other properties depending on the proceeding nodes.

Continue reading

Installing and Starting Node-Red

Installing Node Red Node-Red is a node application and before you Install node red you will need to first install node. Here are the instructions: Installing Node on Windows Installing Node on Linux Using a Package Manager Then you can Install node red on Windows and Linux (including raspberry pi) using:

Continue reading

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.   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

Continue reading

Configuring the MQTT Publish and Subscribe Nodes in Node-Red

Node-Red provides both an MQTT subscribe (input) and publish (output) node. The configuration for these nodes are almost Identical as the main part of the configuration concerns the actual client connection. Because of this it is useful to think of the publish and subscribe nodes as consisting of two components as shown in the schematic below: Before we look a the actual configuration we will look at MQTT client connections in general.

Continue reading

Node-Red Setup and Admin Notes

Note: Working Notes Node red uses a settings file called settings.js located in /usr/lib/node-modules/node-red/ folder by default. You can create your own settings file and customise it either by copying the existing file or using the file available from Github here. To use your own settings file use the -s switch when starting node-red e.g. node-red -s mysettingsfile.js If you place a settings.js in the .node-red folder that will be used by default.

Continue reading

Storing Data in Node-Red Variables

Node-red nodes pass the msg object between nodes. However this object is replaced by the next msg object. So how do you store data between node calls? Node-Red provides three mechanisms: The context object -stores data for a node The Flow object – stores data for a flow The global object -stores data for the canvas

Continue reading