Setting up Node-RED on Opto-22 Groov Rio R7

The Opto-22 Groov Rio R7 is a rugged edge I/O module designed for industrial applications. Equipped with a powerful ARM Cortex-A8 processor, versatile I/O channels, and various connectivity options, it’s an ideal solution for edge computing and industrial IoT.
# Prerequisites
Before proceeding with the installation, ensure you have the following:
- Opto-22 Groov Rio R7 – A functioning device with internet access.
- FlowFuse Account - You need an active FlowFuse account to access the platform and configure your instance. If you do not have one, please visit the FlowFuse website and sign up for a new account before proceeding.
- Sudo Privileges – Administrator access to install required packages.
# Getting Started
This guide will walk you through setting up Node-RED on the Groov Rio R7 using the FlowFuse Device Agent, allowing you to manage, scale, and secure your remote instances effectively.
# Installing FlowFuse Device Agent
Before starting the installation, it is recommended to update your system to ensure that all your packages are up to date. You can use groov manage, which acts as the command central for your groov RIO devices. For detailed instructions on how to update the system, watch this video.
To install the FlowFuse Device Agent and run Node-RED, Node.js is required. Opto 22 devices typically come with Node.js v14 preinstalled. You can verify the installed version by running:
node -v
The result will show the currently installed Nodejs version. For example:
v14.20.0
The latest versions of the FlowFuse Device Agent require Node.js v18 or later. However, if your device only supports Node.js v14 or v16, you can install Device Agent version 2.8, which is compatible with those versions.
In this guide, we will proceed with installing Device Agent v2.8:
sudo npm install -g @flowfuse/device-agent@2.8
# Registering the Device to Connect to FlowFuse
Once you have installed the FlowFuse Device Agent, you need to register the hardware to connect it to your FlowFuse team.
For instructions on how to register the hardware with your FlowFuse team, follow the documentation: Register your Remote Instance.
When registering your hardware, you will be presented with a dialog containing a one-time passcode command that the Device Agent uses to retrieve its configuration. Make sure to copy it.
# Connecting Device
Execute the command you have copied with sudo as shown below
sudo flowfuse-device-agent -o <insert-your-three-word-token> https://app.flowfuse.com
Once executed, you should see an output similar to the one below, indicating that the FlowFuse Device Agent has been successfully configured:
[AGENT] 3/21/2025 7:09:25 PM [info] Entering Device setup...
[AGENT] 3/21/2025 7:09:27 PM [info] Device setup was successful
[AGENT] 3/21/2025 7:09:27 PM [info] To start the Device Agent with the new configuration, run the following command:
[AGENT] 3/21/2025 7:09:27 PM [info] flowfuse-device-agent
Now, you can check the remote instance in the FlowFuse platform, where its status should be displayed as "running.".
# Configuring FlowFuse Device Agent to use the older Node-RED version
Since our device uses an older version of Node.js, we need to ensure that a well-supported version of Node-RED is running on our device. By default, the device agent installs the latest Node-RED version, which we need to configure and update to a compatible version. According to the official Node-RED documentation, if the device uses Node.js 14, it will support Node-RED version 3.x well.
-
To configure your device to use a compatible version of Node-RED:
-
Open the FlowFuse platform and navigate to the groov RIO 7 remote instance that you added.
-
Switch to the Settings tab and then to the Editor section.
-
Enter "3.1.15" in the Node-RED Version field, click Save Settings, and restart the device.
# Starting the FlowFuse Device Agent as a Service
The system on this device typically utilizes SysVinit as its service management framework, responsible for starting, stopping, and managing background services during system boot and shutdown. On SysVinit-based systems, the FlowFuse Device Agent can be configured to run as a service at system startup by creating and enabling a custom init script.
Create a script file named flowfuse-device-agent-init with the following content:
#!/bin/sh
### BEGIN INIT INFO
# Provides: flowfuse-device-agent
# Required-Start: $network SoftPAC
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the FlowFuse Device Agent at boot
# Description: Allow FlowFuse to manage Node-RED on this device
### END INIT INFO
PROGRAM="/usr/bin/flowfuse-device-agent"
PIDFILE="/var/run/flowfuse-device-agent.pid"
start() {
echo "Starting flowfuse-device-agent..."
$PROGRAM &
echo $! > $PIDFILE
echo "flowfuse-device-agent started."
}
stop() {
echo "Stopping flowfuse-device-agent..."
kill $(cat $PIDFILE)
rm -f $PIDFILE
echo "flowfuse-device-agent stopped."
}
status() {
if [ -f $PIDFILE ]; then
PID=$(cat $PIDFILE)
if ps -p $PID > /dev/null; then
echo "flowfuse-device-agent is running (PID: $PID)."
else
echo "flowfuse-device-agent is not running."
fi
else
echo "flowfuse-device-agent is not running."
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "Usage: /etc/init.d/flowfuse-device-agent {start|stop|restart|status}"
exit 1
;;
esac
exit 0
Run the following commands to install and enable the service:
sudo cp flowfuse-device-agent-init /etc/init.d/flowfuse-device-agent
sudo chmod +x /etc/init.d/flowfuse-device-agent
sudo update-rc.d flowfuse-device-agent defaults
This will register the script to start the FlowFuse Device Agent automatically at boot.
# Accessing Node-RED Editor.
- Login into your FlowFuse account.
- Click on the remote instances option in the left sidebar.
- Click on the device and enable the developer mode by clicking on the top right-corner switch.
- Once Developer Mode is enabled, click on the Open Editor option located next to the that switch.
For more information refer to FlowFuse documentation
- Model: GRV-R7-MM2001-10
- RAM: 1024 MB MB
- Processor: ARM Cortex-A8, 1 GHz
- I/O Channels: 10 multi-signal, multifunction channels (analog I/O, temperature, discrete I/O, mechanical relays)
- Connectivity:
- Dual switched Gigabit Ethernet
- USB 2.0 (host)
- Power over Ethernet (PoE)
- 10–32 VDC power input
- Clock Speed: 1 GHz
- Storage:
- 4 GB eMMC (internal)
- USB memory stick support (up to 32 GB)