Getting Started with Node-RED

Last updated:

Introduction

Node-RED is an open-source, flow-based development tool for connecting devices, APIs, and online services. Its browser-based editor allows you to build data-processing and automation workflows by wiring nodes together, making it useful for IoT and industrial edge applications.

In this tutorial, we will install Node-RED on a reComputer RK Series device, complete its initial configuration, open the web editor, and deploy a simple test flow.

Hardware and Software Requirements

ItemRequirement
Edge devicereComputer RK Series device
Operating system64-bit Debian-based Linux, such as Debian or Armbian
NetworkInternet access for installation; local network access to the device
AccessTerminal or SSH access with sudo privileges
ClientA computer with a modern web browser

Step 1: Connect to the reComputer RK Device

Connect to the board through a terminal or SSH. For example:

bash
ssh seeed@<DEVICE_IP>

Replace <DEVICE_IP> with the IP address of your board and seeed with the actual login username if different.

Check the system architecture and Linux distribution:

bash
uname -m
cat /etc/os-release

On a 64-bit RK system, the architecture should be aarch64.

Step 2: Install Node-RED

Install the packages required by the official installer:

bash
sudo apt update
sudo apt install -y curl git build-essential ca-certificates

Run the official Node-RED Debian installer:

bash
bash <(curl -fsSL https://github.com/node-red/linux-installers/releases/latest/download/install-update-nodered-deb) --node22 --skip-pi

The --node22 option installs Node.js 22, and --skip-pi skips Raspberry Pi-specific nodes that are not needed for the RK Series. The installer installs Node-RED and configures its system service.

Run the installer as your regular Linux user with sudo privileges, rather than prefixing the command with sudo. Confirm installation when prompted and follow the on-screen instructions.

Step 3: Complete the Initial Configuration

On a fresh installation, complete the Node-RED settings initialization prompts when they appear. If initialization was skipped and no settings file exists yet, run the following command as the same user who installed Node-RED:

bash
node-red admin init

Node-RED settings initialization

The configuration is stored in the Node-RED user directory. For a Linux user named seeed, the default path is:

text
/home/seeed/.node-red/settings.js

For security, keep the editor on a trusted network and do not expose port 1880 directly to the public internet. The administrator password is configured for the web editor.

Step 4: Verify the Installation and Start Node-RED

Check the installed versions:

bash
node -v
npm -v
node-red --version

Start the Node-RED service:

bash
node-red-start

This command starts the background service and follows its logs. Press Ctrl+C to leave the log view; the service keeps running.

In the same terminal after leaving the log view, or in another terminal, confirm that the service is running:

bash
sudo systemctl status nodered.service --no-pager

The service should report active (running).

Enable automatic startup after a reboot:

bash
sudo systemctl enable nodered.service

Step 5: Access the Node-RED Web Editor

Find the IP address of your reComputer RK device:

bash
hostname -I

From a computer on the same network, open:

text
http://<DEVICE_IP>:1880

Node-RED uses port 1880 by default. If user security was enabled in the initialization step, log in with the account you created.

The Node-RED flow editor will appear, with a node palette on the left, a workspace in the center, and sidebar panels on the right.

Node-RED flow editor

Step 6: Create and Run Your First Flow

We will create a simple flow using the built-in Inject and Debug nodes.

  1. Find the inject node in the left palette and drag it onto the workspace.

  2. Double-click the Inject node. Set msg.payload to a string with the value Hello from reComputer RK Series!, then click Done.

    Configure the Inject node payload

  3. Drag a debug node onto the workspace.

  4. Connect the Inject node's output to the Debug node's input.

  5. Click Deploy in the upper-right corner to deploy the flow.

  6. Open the Debug messages sidebar and click the small button on the left of the Inject node.

The Debug sidebar should display:

text
Hello from reComputer RK Series!

Inject-to-Debug flow and message output

This confirms that the Node-RED editor can deploy and execute a flow on the RK device.

Step 7: Useful Node-RED Service Commands

ActionCommand
Start Node-REDnode-red-start
Stop Node-REDnode-red-stop
Restart Node-REDnode-red-restart
View logsnode-red-log
Check service statussudo systemctl status nodered.service --no-pager
Enable startup on bootsudo systemctl enable nodered.service

Conclusion

You have installed Node-RED on a reComputer RK Series device, configured the editor, enabled its background service, and deployed a simple flow. Node-RED can now serve as a foundation for edge IoT applications using protocols such as MQTT and Modbus TCP, which can be covered in separate tutorials.

References