< All Topics

12. OPC UA

An OPC UA (Open Platform Communications Unified Architecture) server implements the OPC UA protocol to provide data and services to OPC UA clients. It serves as a central hub for accessing real-time and historical data and executing operations within industrial automation systems. OPC UA servers facilitate secure and reliable communication between industrial devices, sensors, and software applications, enabling remote monitoring, control, and diagnostics. The 5G-IIoT gateway can host an OPC UA server to transmit sensor information.

Setting up an OPC UA server

To configure an 5G-IoT OPC UA server navigate to IIoT -> OPC UA, configure and Enable it, and press Save & Apply. Wait approximately 30 s for the server to start up.

man opcua


  • Enable: Enable/Disable the OPC UA server.
  • End point: Network address through which OPC UA clients can establish connections to OPC UA servers. Formatted as opc.tcp://SERVER_ADDRESS:SERVER_PORT/PATH
    • SERVER_ADDRESS: Address of the server interface. Set it to the address of the interface (LAN, WAN, 5G) from which the server should be accessed, or set it to to be accessible from all interfaces.
    • SERVER_PORT: The communication port on which the OPC UA server is listening for incoming connections. OPC UA servers commonly use port 4840, although other ports can be configured.
    • PATH: Optionally, the endpoint URL may include a path component, which further identifies the specific endpoint within the server.
  • Root object name: Name of the object containing the sensor data. It can be set arbitrarily, but it’s recommended to choose it so it identifies the device when collecting data from multiple servers.
  • EM count: Number of connected Energy Meter units.

Connecting to OPC UA from WAN/WWAN(5G)

The OPC UA port can not be accessed from the WAN/WWAN(5G) by default. A new firewall rule must be created to allow access.  To do this, navigate to the firewall rules under Network -> Firewall -> Traffic Rules and Add a new rule. Set the rule to accept traffic from the source zone WAN to the destination zone Device (input) and the desired OPC UA server port’s destination port, as shown in the following image.

man opcua rule

To finish, save the new rule and push the Save & Apply button to apply your changes. For more information on traffic rules, check out the chapter on firewall rules.


OPC UA sensor data structure

Sensor data is transmitted under Objects/Root object name/EM_ID_x, where x identifies the Energy Meter unit in the range one to EM count. See the following image for an example.

man opcua msg struct 1

Online True/False Indication if the main unit detects the connected unit.
Type Type of the connected unit: 16 (0x10) indicates a EM unit.
Vrms Measured root-mean-square (RMS) voltage in volts (V) for each phase.
Irms Measured RMS current in ampere (A) for each phase.
Wat Measured power in kW/h, for each phase.


Table of Contents