Overview of Node-RED
  • 19 Sep 2024
  • 2 Minutes to read
  • Contributors

Overview of Node-RED


Article summary

This article will summarize and explain Node-RED and how it's commonly used to add custom functionality to Tulip Edge Devices.

What is Node-RED?

Node-RED is an open-source software, originally developed by IBM's Emerging Technology Services team. It's a flow-based programming tool, meaning users modify code by interacting with a visual, low-code interface to create Flows. A sample Flow can be found below:

Messages are passed from one Node to the next as JSON Objects. Many nodes may be connected in sequence to complete advanced logic, branching paths, or parallel operations.

As part of its open-source nature, any user can create and submit Nodes and Flows to the online Node-RED Library. Frequently, manufacturers and integrators will submit Nodes to the Library to interface with their devices - for example, Tulip has written and published nodes for interfacing with the Tulip Machine and Tables APIs.

Node-RED and Tulip

All Tulip Edge Devices come with Node-RED pre-installed. Access Node-RED either via the Node-RED Editor link on the Configuration Portal (accessible at the device's IP Address), or directly at port 1880 (i.e. navigate to <your device's IP address>:1880)

Use Node-RED to configure advanced logic, interface with complex systems, or connect to unique devices from Edge Devices.

On an Edge Device, it is helpful to consider Node-RED as a 'sandboxed' software, completely independent from any Tulip operations. As such, communication 'in' and 'out' of Node-RED takes a few different forms:

Communicating 'In' To Node-RED

  1. Messages 'into' Node-RED from Tulip (e.g. user inputs from a Tulip App Trigger) must be completed via a Connector Function. In this method, a Tulip Connector Function is initiated on the Edge Device, which sends the message locally from Tulip OS to Node-RED. Consult Sending Messages from Tulip to Node-RED for an in-depth walkthrough on this method.
  2. Any device (e.g. USB or GPIO) or networked data source (e.g. web API, LAN devices) can send data 'into' Node-RED through use of its relevant Node-RED Nodes. Most commonly, this is over a standard industrial protocol like RS-232, Modbus, or MQTT.
  3. Inject Nodes can 'start' flows by sending messages with a user input (a click).

Communicating 'Out' of Node-RED

  1. To communicate data 'out' to Tulip from Node-RED, it is recommended to use a Tulip Node to send data over either the Machine Attributes or Tables API. Read Sending Data from Node-RED to Tulip with Tulip Nodes for more information.
  2. Node-RED can also be used to send messages out of ports present on the device, such as sending RS-232 or Modbus commands, or polling an external API or MQTT Broker.

Was this article helpful?