
How to Install and Use Node-RED on Your EG Series IoT Edge Gateway
|
|
Time to read 6 min
|
|
Time to read 6 min
Table of contents
Summary
This comprehensive guide explains how to install and utilize Node-RED on Robustel's EG Series IoT Edge Gateways to create powerful Industrial IoT applications. Readers will learn the step-by-step installation process for Node-RED on their gateway.
The article then explores essential Node-RED concepts, including an overview of basic nodes like Inject, Debug, Function, and MQTT for network communication. It further details how to expand Node-RED's capabilities by installing additional community nodes via the "Manage palette" feature.
Finally, practical industrial use cases are demonstrated, such as using Modbus nodes to interface with PLCs and sensors, and employing Dashboard nodes to build simple local HMIs for data visualization and control directly at the edge. The guide empowers users to leverage Node-RED for efficient edge computing, local data processing, and seamless cloud integration for their industrial solutions.
Node-RED is a powerful, low-code programming tool that empowers developers and operators to create IoT applications directly on an IoT Edge Gateway. Its visual, flow-based development environment makes it accessible for users of any background, perfect for tasks ranging from simple automation to complex industrial control systems running at the edge.
In the context of an IoT Edge Gateway, a Node-RED node is a self-contained block of code designed for a specific task, such as reading data from an industrial sensor, sending a message over MQTT, or controlling a piece of machinery. You can build a complete application by simply dragging and dropping these nodes into a workspace and connecting them to create a "flow". This workflow automates your industrial processes without requiring you to write extensive code.
This guide will walk you through installing Node-RED on your Robustel IoT Edge Gateway, understanding the basic nodes, and exploring examples for real-world Industrial IoT (IIoT) projects. Before we begin, ensure you have access to your gateway's web interface.
The Robustel EG5120 is an industrial-grade IoT edge gateway engineered to seamlessly bridge OT and IT networks.
By combining a high-performance quad-core ARM processor with our secure, Debian (LTS) -based RobustOS Pro, it provides a powerful platform for real-time data processing, analytics and control, empowering next-generation IoT applications in smart manufacturing, energy, and smart building.
1. Open a web browser (e.g., Microsoft Edge, Google Chrome, or Firefox) on a PC connected to the same network as your gateway.
2. Type the IP address of your IoT Edge Gateway into the address bar and press Enter. The default IP address is typically http://192.168.0.1/, but your actual address may vary.
3. On the login page, enter the username and password for your IoT Edge Gateway. This information can usually be found on the device's label. Click LOGIN.
4. Navigate to the System > App Center menu. Use the "App Install" feature to upload and install the Node-RED application file (e.g., node-red-app_2.0.1-1_arm64.deb) on your gateway.
5. After the installation is successful, go to the Development > NODE RED menu to access the application settings and open the editor.
6. This will launch the Node-RED workspace, where you can begin building your IoT flows directly on the IoT Edge Gateway.
In the Node-RED editor, the nodes are located in the palette on the left. You can drag any node from the palette into the central workspace to build your flow. A flow consists of various nodes connected together. Each node can receive a message from the previous one, perform its specific function, and pass the result to the next node.
Let's review some of the most important nodes for your IoT Edge Gateway projects.
These are the foundational nodes used in nearly every Node-RED project.
● Inject node: This node is used to manually trigger a flow or start it at regular intervals. It's essential for testing and debugging logic on your IoT Edge Gateway. Its message payload can be configured as a string, number, or JavaScript object.
● Debug node: This node is crucial for troubleshooting. It displays messages sent from other nodes in the debug sidebar, allowing you to inspect the data as it moves through your flow.
This simple example shows an Inject node sending a True value to a Debug node, which then displays the value in the sidebar.
Function nodes allow you to write custom JavaScript code to process and manipulate data as it passes through your IoT Edge Gateway. When a message arrives, the Function node executes your code on it, enabling complex data transformations, calculations, or logic right at the edge.
Network nodes are essential for enabling communication between your IoT Edge Gateway and other devices or cloud platforms.
● MQTT Nodes: MQTT is a standard messaging protocol for IIoT. It uses a central broker to manage messages between clients. The mqtt in node subscribes to topics from a broker, while the mqtt out node publishes messages to it, making it easy for your gateway to communicate data.
While Node-RED comes with a core set of nodes, its true power lies in the vast library of community-created nodes available for specific use cases. You can install them in two ways.
The easiest way to add new nodes to your IoT Edge Gateway's Node-RED instance is through the editor itself.
1. Click the main menu in the top-right corner and select Manage Palette.
2. Switch to the Install tab, search for the package you need (e.g., 'modbus'), and click the Install button.
3. The new nodes will automatically be added to your palette, ready to use.
For more advanced users, nodes can be installed via the command line.
1. Access the command line of your IoT Edge Gateway.
2. Navigate to your Node-RED user directory (by default, $HOME/.node-red).
3. Run the command: npm install
.
4. Restart the Node-RED application on your gateway to load the new nodes.
You can install nodes to interact with almost any industrial controller or sensor, such as WAGO and PLCnext PLCs. Let's look at two common examples for an IoT Edge Gateway.
Modbus is a critical protocol in industrial environments. By installing Modbus nodes in Node-RED, you can directly interact with Modbus sensors and devices, such as the Robustel S6000U. This allows your IoT Edge Gateway to read data from industrial equipment and use it in your flows.
The Robustel S6000U is a compact industrial sensor that integrates seven critical monitoring parameters into a single device.
Designed for seamless integration into new or existing industrial systems such as PLC, it provides reliable, real-time data for environmental control, safety monitoring, and predictive maintenance.
What if you want to create a simple user interface to visualize data or control a process on your IoT Edge Gateway? The node-red-dashboard library lets you build a web-based dashboard with gauges, charts, buttons, and more, directly from Node-RED. You can create multi-page visualizations to display any data processed by your gateway.
For more detailed information about Robustel's IoT Edge Gateway solutions or to download the latest Node-RED application files, please contact our support team.
A1: Once Node-RED is installed, you can perform many industrial tasks. For example, you can use Modbus nodes to read data from PLCs or industrial sensors. You can then process this data using Function nodes and use MQTT nodes to send it to a cloud platform for monitoring. Additionally, you can install Dashboard nodes to create a simple local Human-Machine Interface (HMI) to visualize data or control processes directly from the gateway.
A2: Node-RED has a vast library of community-contributed nodes that you can easily add. The simplest method is using the " Manage palette " option in the Node-RED editor's menu. From there, you can search for and install additional node packages (often called "node-red-contrib-*") directly onto your EG Series Gateway to extend its capabilities for specific databases, APIs, or communication protocols.
A3: Running Node-RED on an EG Series Gateway allows for edge computing . This means data from your industrial equipment can be collected, processed, filtered, and even acted upon locally before being sent to the cloud. This reduces the volume of data transmitted (saving costs), lowers latency for critical decisions, and enables continued operation even if the internet connection is temporarily lost. You can automate responses to sensor readings or machine states directly at the edge.