How to Deploy Pareto Anywhere on Robustel EG5120 & Integrate with E2C Factory Web Scada

How to Deploy Pareto Anywhere on Robustel EG5120 & Integrate with E2C Factory Web Scada

Overview

In industrial IoT environments, capturing Bluetooth Low Energy (BLE) data typically requires complex integration between hardware drivers and application software. This solution utilizes Pareto Anywhere on the Robustel EG5120 gateway to parse raw HCI events into structured JSON data. It then leverages Node-RED to bridge this data into the E2C Factory platform for professional SCADA visualization.

What You'll Need

  • Hardware:
    • 1 x Robustel EG5120 gateway (RobustOS Pro).
    • 1 x BLE sensor or tracker (e.g., leak detector).
    • 1 x Work computer with SSH access.
  • Software Dependencies:
    • Node.js (v18.x recommended) and PM2 process manager.
    • Bluetooth tools: bluez and libcap2-bin.
    • E2C Factory access (built-in or cloud-based).
  • Knowledge: Basic Linux command-line and Node-RED experience.

Step-by-Step Configuration Guide

Step 1: System Environment Preparation

Ensure the gateway has the latest packages and the required runtime environment.

  1. Update package lists and install base tools:
  • sudo apt-get update
  • sudo apt-get install -y build-essential bluetooth bluez libcap2-bin

  1. Install Node.js 18.x and PM2:

Step 2: Grant Hardware Access Privileges

Install the core middleware and grant the necessary permissions for hardware access.

  1. Install NPM packages globally:
  • sudo npm install -g pareto-anywhere
  • sudo npm install -g barnowl-hci

  1. Set hardware privileges:
  • Navigate to the directory: cd /usr/local/.npm-global/lib/node_modules/barnowl-hci
  • Run the privilege script: sudo npm run privileges

Step 3: Configure the Forwarder Service

Use PM2 to run the barnowl-hci-forwarder as a persistent service using absolute paths.

  1. Start the Forwarder:
  • pm2 start /usr/local/.npm-global/lib/node_modules/barnowl-hci/bin/barnowl-hci-forwarder --name "barnowl-hci-forwarder" --restart-delay 5000

Note: The 5000ms delay prevents service flapping during hardware resets.


2. Start the Pareto Anywhere Engine:

  • pm2 start /usr/local/.npm-global/lib/node_modules/pareto-anywhere/bin/pareto-anywhere --name "pareto-anywhere"

Step 4: Drive Persistent Bluetooth Scanning

The EG5120 requires a background loop to maintain active scanning for data capture.

  1. Reset Bluetooth status:
  • sudo hciattach /dev/ttymxc3 any 115200 flow
  • hciconfig hci0 up

  1. Start the scanning loop:
  • pm2 start "while true; do btmgmt --index 0 find -l > /dev/null 2>&1; sleep 5; done" --name "ble-scanner"
  • pm2 save

Step 5: Finalize Middleware Engine

Ensure the engine is running and will persist through reboots.

  1. Restart and persist services:
  • pm2 restart pareto-anywhere
  • pm2 save
  • pm2 startup (Follow the on-screen instructions to enable auto-start).

Step 6: Node-RED & E2C Factory Integration

This step bridges the parsed Pareto data to the E2C Factory platform for visualization.

  1. Install Node-RED Plugin:
  • Navigate to the Node-RED directory: cd /app/node-red/origin/backend
  • Install the plugin:npm install @reelyactive/node-red-pareto-anywhere --save --unsafe-perm
  • Restart the service: pm2 restart node-red-app

  1. E2C Factory Base Configuration:
  • In Data Collection, create a new device and add Virtual Tags to it.


  • In Data Management, create a Data Table for BLE signals to enable historical data referencing in the SCADA dashboard.

  1. Node-RED Logic Configuration:
    Add a pareto-anywhere-socketio node (Server: http://localhost:3001) and connect it to a function node with the following code:
// 1. Safety Check: Ensure payload exists and contains isLiquidDetected array
if (!msg.payload || !Array.isArray(msg.payload.isLiquidDetected) || msg.payload.isLiquidDetected.length === 0) {
return null; // Silent drop if not water leak sensor data
}

try {
const data = msg.payload;

// 2. Extraction and String Conversion (for E2C PRO compatibility)
const mac = String(data.deviceId || "unknown");
const battery = String(data.batteryPercentage || "0");

// Safely extract leak boolean and convert to status string
const isLeaking = data.isLiquidDetected[0];
const leakStatus = isLeaking ? "Warning" : "Normal";

// 3. Construct Payload for E2C Mapping
// Ensure keys (e.g., BLE_RSSI) match the "Identifiers" in E2C Variable Management
msg.payload = {
"BLE_MAC": mac,
"BLE_BATTERY": battery,
"BLE_LEAK_STATUS": leakStatus,
"BLE_UPDATE_TIME": new Date().toLocaleString()
};

return msg;
} catch (e) {
node.error("Pareto logic parsing error: " + e.message);
return null;
}

  1. Variable Mapping:
  • Drag in the Update Device Data node.

  • Click Add Variables and map the virtual variables defined in Data Collection to the data points from the function node.

  • Deploy the flow and verify that BLE sensor data is being written to the E2C device.

  1. SCADA Dashboard Design:
  • Go to the Data Analysis page and create a new Scada Dashboard.

  • Bind UI components (gauges, charts, indicators) to the BLE sensor variables.
  • Save and view the final real-time SCADA dashboard in your browser.


Verification & Testing

  1. Check Service Status: Run pm2 status. All services (barnowl-hci-forwarder, pareto-anywhere, ble-scanner) should be online.

  1. Verify API Data: Run curl -s http://localhost:3001/devices/. It should return a JSON object with discovered device IDs.

  1. Scada Display: Confirm the dashboard widgets are updating with live values.


Troubleshooting / FAQ

Q1: Why is my E2C Dashboard not updating even though Node-RED shows "Data Sent"?

A: This is most commonly caused by a Variable Identifier mismatch. Ensure that the keys defined in your Node-RED msg.payload (e.g., BLE_LEAK_STATUS) match the Identifier (Tag name) configured in the E2C Data Collection settings exactly—including case sensitivity and underscores.

Q2: Why is BLE telemetry, though verified via the local APIcurl, failing to populate within the E2C Factory SCADA interface?

A: The provided Node-RED function node includes a safety pre-check for the isLiquidDetected property. This logic is designed to filter out general BLE traffic and only process specific water-leak sensors. If you are using a different type of sensor (e.g., temperature), you must update the pre-check logic in the function node to match your sensor's data properties.

Q3: Node-RED displays "Connected" but no data appears in the debug panel.

A: Verify that the HCI Scanning Loop (ble-scanner) is running. On the EG5120, the Bluetooth radio may stop discovering new advertisements if the active search command is interrupted. Run pm2 status to ensure ble-scanner is online; if it is, try running hciconfig hci0 up manually to ensure the hardware interface is active.

Q4: Services fail to start automatically after the EG5120 reboots.

A: PM2 requires a saved process list and a registered startup script. After all services are running, you must execute pm2 save. Then, run pm2 startup and follow the instructions to copy/paste the generated command into your terminal to enable the boot-time service.

Revision History

Version

Date

Author

Changes

1.0

2026-02-03

Steven Lin

Initial document.


    • Related Articles

    • How to Reset Robustel EG Series Gateways to Factory Defaults?

      Overview This guide provides instructions for resetting a Robustel EG series gateway (e.g., EG5120, EG5200) running RobustOS Pro to its factory default state. A factory reset is a powerful troubleshooting step used when a device is inaccessible ...
    • How to Deploy Zabbix for SNMP to MQTT Data Forwarding on EG/MG Series

      Overview This guide describes how to manually configure a Robustel EG/MG series gateway (running RobustOS Pro) to act as an SNMP collector and MQTT forwarder. By deploying Zabbix Server and Agent 2 via Docker, the gateway can poll data from local ...
    • How to Deploy Ignition Edge on Robustel EG5120

      1. Overview This manual provides a detailed, professional guide for technical engineers on how to securely and reliably deploy Inductive Automation's Ignition Edge software on the Robustel EG5120 industrial edge gateway (running RobustOS Pro). By ...
    • How to Install CODESYS Control on a Robustel EG Series Gateway

      Overview This guide explains how to install the CODESYS Control runtime on a Robustel EG series gateway (such as the EG5120 or EG5200). By installing this runtime, you can transform your Robustel gateway into a powerful, industrial-grade PLC ...
    • How to Install Telit deviceWISE Asset Gateway on Robustel EG Series Gateways?

      Overview This guide provides step-by-step instructions for installing the Telit deviceWISE Asset Gateway software on a Robustel EG series gateway (e.g., EG5120). This installation allows you to leverage the powerful edge computing and Industrial IoT ...