Collect OPC UA Data with N3uron

Last updated:

Introduction

This tutorial continues Install N3uron. Use the OpcUaClient module on a reComputer RK Series device to connect to N3uron's public DataSim server, import simulated photovoltaic-site variables as Tags, and view their values in WebUI. No additional PLC or sensor is required.

text
N3uron DataSim OPC UA Server
opc.tcp://datasim.n3uron.com:4840
             |
             | OPC UA over TCP
             v
reComputer RK Series (N3uron)
     OpcUaClient / DataSim
             |
             v
       N3uron Tags
             |
             v
     Data -> Realtime

Prerequisites

ItemRequirement
HardwareA reComputer RK Series device
Operating systemA compatible ARM64 Debian-based Linux system; Debian/Armbian was used in the test
SoftwareN3uron installed, with the OpcUaClient module available
NetworkOutbound TCP port 4840 to the public DataSim server; browser access to the RK device's WebUI
Client PCA computer with a modern browser on a network that can reach the RK device

For another RK model, confirm its Linux architecture and N3uron requirements using the installation tutorial before proceeding.

Step 1: Check the device and N3uron service

Run the following commands in a terminal or SSH session on the RK device:

bash
cat /etc/os-release
uname -m
hostname -I
sudo systemctl status n3uron --no-pager

For ARM64 Linux, uname -m typically prints aarch64. Note the device's LAN IP address. The N3uron service should report active (running).

If the service is installed but stopped, start it:

bash
sudo systemctl start n3uron

If N3uron is not installed, complete Install N3uron first.

Step 2: Open N3uron WebUI

Open the following address in the client computer's browser:

text
http://<RK_DEVICE_IP>:8003

Replace <RK_DEVICE_IP> with the RK device's IP address. The default HTTPS port is 8443 when HTTPS is configured.

Log in with the administrator account configured during installation. The navigation panel includes Data, System, and User.

Step 3: Create the OPC UA Client module

  1. Go to System → Config → Modules.
  2. Open the Modules menu and select New Module.
  3. Set the name to OpcUaClient.
  4. Set Module type to OpcUaClient, then click Save.

Select OpcUaClient as the module type

The screenshot shows the type menu before the selection is applied. Select the highlighted OpcUaClient entry instead of retaining ModbusServer. The module name alone does not determine its type.

Expand the saved module in Explorer. It should contain Certificates, OPC Browser, and Logger.

Step 4: Configure the DataSim client

Select OpcUaClient, open the Model panel menu, and choose New Client. Name the client DataSim.

Create a new OPC UA client

Configure the following connection settings. The public endpoint and demo account are also documented in the Seeed N3uron example.

SettingValue
Client nameDataSim
Enable data collectionYes
Endpoint URLopc.tcp://datasim.n3uron.com:4840
Discovery URL, if configuredopc.tcp://datasim.n3uron.com:4840
Security modeNone
Security policyNone / None (Insecure)
Authentication → EnabledYes
Authentication → Usersunn3rgy
Authentication → Passwordn3uron

DataSim endpoint, security and authentication settings

Click Save and allow the module to connect. If the server uses the same discovery and endpoint URL, use the endpoint address in both fields; see N3uron's client configuration documentation.

Step 5: Browse OPC UA nodes

Expand System → Config → Modules → OpcUaClient and select OPC Browser. Choose DataSim from the Client drop-down list.

Select DataSim in OPC Browser

Click Rebrowse if needed. Once browsing succeeds, the server's top-level nodes appear.

DataSim address space in OPC Browser

Expand the following path:

text
Objects
└── PVSIM
    └── BLUELAKE
        └── PVG001
            └── WST
                ├── HEIGHT_SUN
                ├── HUMIDITY
                ├── POA_IRRADIANCE
                ├── PRESSURE
                ├── TEMPERATURE_2M
                └── WIND_SPEED_10M

The server can also expose forecast variables and other branches. The account name sunn3rgy is not necessarily a folder name; follow the current node tree.

Step 6: Import variables as Tags

Use four variables from the WST branch:

OPC UA nodeDescription
HUMIDITYRelative humidity
POA_IRRADIANCEPlane-of-array solar irradiance
TEMPERATURE_2MAmbient temperature at 2 m
WIND_SPEED_10MWind speed at 10 m
  1. In OPC Browser, expand Objects → PVSIM → BLUELAKE → PVG001 → WST.
  2. Drag HUMIDITY into the Model panel's root folder /.
  3. Repeat for POA_IRRADIANCE, TEMPERATURE_2M, and WIND_SPEED_10M.
  4. Confirm that all four Tags appear in the Model tree. Save any pending changes.
  5. If you inspect a Tag's source settings, Source → Enabled should be Yes, with its source module referencing OpcUaClient.

Four OPC UA variables imported into the N3uron Model

Step 7: Check real-time values

Go to Data → Realtime in the navigation panel. Some versions label this page Real Time. Select / in Tag groups to view the four Tags, including their Value, Quality, and Timestamp.

Four Tags with Good quality in N3uron Realtime

The RK3576 example shows the following sample readings:

TagSample valueQuality
HUMIDITYApproximately 71.82Good
POA_IRRADIANCE0Good
TEMPERATURE_2M13.96Good
WIND_SPEED_10M0.76Good

These are sample readings, not fixed expected values. Good indicates a usable reading at the displayed time. Watch the value and timestamp of a changing variable across several refresh cycles to confirm updates. A value of 0 alone does not indicate a connection problem.

The four Tags are now available in N3uron for further processing, MQTT publishing, or WebVision dashboards.

Troubleshooting

SymptomWhat to check
OPC Browser is missingExpand OpcUaClient in Explorer and confirm that Module type is OpcUaClient.
Settings show Channel, Modbus TCP, or port 502The module type may be wrong. Create an OpcUaClient module instead of ModbusServer.
DataSim does not connectCheck the endpoint, demo credentials, DNS, Internet access, and outbound TCP port 4840.
There is no SUNN3RGY folderBrowse PVSIM → BLUELAKE → PVG001 → WST; the node tree may differ from older examples.
Tags show no dataCheck Source Enabled, the OPC UA Node ID, client diagnostics, and Quality.
Values do not changeCheck Timestamp and the simulator's update behavior.
Collection stops after a whileCheck the module's license status; unlicensed modules can be limited to a two-hour demo session.

Check service status and recent logs:

bash
sudo systemctl status n3uron --no-pager
sudo journalctl -u n3uron -n 80 --no-pager

For a TCP connectivity check:

bash
python3 - <<'PY'
import socket
host, port = 'datasim.n3uron.com', 4840
try:
    with socket.create_connection((host, port), timeout=8):
        print('TCP 4840 reachable')
except Exception as exc:
    print('Connection failed:', exc)
PY

A successful TCP connection alone does not verify OPC UA authentication. Check client diagnostics and values in Data → Realtime as well.