UA-Bridge Technical Documentation

UA-Bridge – Feature Guide

Version: 1.2.0


Table of Contents

  1. OPC-UA Client
  2. Data Subscriptions & Monitoring
  3. MQTT Output
  4. PostgreSQL Output
  5. Google Sheets Output
  6. Built-in SQLite Database
  7. Dashboard & Visualization
  8. Connection Logging
  9. Project File Management
  10. Auto-Reconnection
  11. Data Retention & Cleanup
  12. Theming
  13. Keyboard Shortcuts

1. OPC-UA Client

UA-Bridge includes a full-featured OPC-UA client supporting the OPC-UA binary protocol over TCP.

Connection Options

Setting Description Default
Connection Name A unique, human-readable name for the connection (required)
Endpoint URL Full OPC-UA endpoint, e.g. opc.tcp://192.168.1.10:4840 (required)
Security Mode None, Sign, or Sign & Encrypt None
Security Policy None, Basic256Sha256, Basic128Rsa15, Basic256, Basic128 None
Authentication Anonymous or Username/Password Anonymous
Session Timeout Time in milliseconds before the session expires if idle 60000 ms
Auto-Connect Automatically connect to this server on application startup false
Certificate File Path to the client X.509 certificate file (.pem, .crt, .der) (optional)
Private Key File Path to the client private key file (.pem) (optional)
Private Key Passphrase Passphrase to decrypt an encrypted private key (optional)
Accept Unknown Certs Automatically accept server certificates not in the trust store false

Endpoint Discovery

When connecting, UA-Bridge performs endpoint discovery to identify available security configurations on the server. It logs available security modes and policies to help diagnose connection issues.

Node Browsing

After connecting, you can interactively browse the server’s address space:

Node Reading


2. Data Subscriptions & Monitoring

Creating Subscriptions

Subscriptions allow you to monitor OPC-UA variables for real-time data changes.

Subscription Limits (Free Edition)

The Free Edition enforces a global limit of 100 subscribed variables across all connections. When the limit is reached, a warning message is displayed.

Live Data Feed

When a monitored item value changes, the following data is captured:

Field Description
connectionId Identifier of the OPC-UA connection
connectionName Human-readable connection name
nodeId OPC-UA Node ID (e.g., ns=2;s=Temperature)
displayName Display name of the variable
value Current value (number, string, boolean, or object)
serverTimestamp Timestamp assigned by the OPC-UA server
sourceTimestamp Timestamp assigned by the data source
statusCode OPC-UA status code (e.g., Good, Bad)

This data is simultaneously:

  1. Written to the built-in SQLite database
  2. Sent to the Renderer process for live UI updates
  3. Published to all active MQTT connections
  4. Inserted into all active PostgreSQL connections
  5. Published to all active Google Sheets connections

Subscription Editing

Modify subscription parameters on the fly:


3. MQTT Output

Publish OPC-UA data changes to one or more MQTT brokers in real time.

Features

Topic Structure

Published topics follow a hierarchical structure:

{baseTopic}/{connectionName}/{OPC browsePath...}/{displayName}

Example:

opcuadt/opcsrv1/Objects/Server/ServerStatus

Each message body is a JSON object with the full data change payload.

{
  "connectionId": 1766761871040,
  "connectionName": "test",
  "nodeId": "ns=0;i=2256",
  "displayName": "ServerStatus",
  "value": {
    "startTime": "2026-02-18T18:37:38.742Z",
    "currentTime": "2026-02-21T19:10:59.095Z",
    "state": "Running",
    "buildInfo": {
      "productUri": "https://github.com/riclolsen/json-scada/",
      "manufacturerName": "JSON-SCADA Project",
      "productName": "{json:scada} - OPC-UA Server",
      "softwareVersion": "0.1.3",
      "buildNumber": "0.1.3",
      "buildDate": "2020-02-01T00:00:00.000Z"
    },
    "secondsTillShutdown": 0,
    "shutdownReason": {}
  },
  "serverTimestamp": "2026-02-21T19:10:59.094Z",
  "sourceTimestamp": "2026-02-21T19:10:59.094Z",
  "statusCode": {
    "value": 0
  }
}

Reconnection Behavior

When a connection is lost:

  1. The old client is cleaned up
  2. A new connection attempt is scheduled with exponential backoff
  3. A 15-second timeout prevents hanging attempts
  4. The UI receives live status updates (connected, disconnected, reconnecting, error)

4. PostgreSQL Output

Store OPC-UA data changes in PostgreSQL databases for long-term historical analysis.

Features

Table Schema

The table name is configurable (default: opcua_data):

CREATE TABLE IF NOT EXISTS opcua_data (
  id SERIAL PRIMARY KEY,
  connection_id TEXT,
  node_id TEXT,
  display_name TEXT,
  value_jsonb JSONB,
  value_double DOUBLE PRECISION,
  value_string TEXT,
  server_timestamp TIMESTAMP,
  source_timestamp TIMESTAMP,
  status_code TEXT,
  created_at TIMESTAMP DEFAULT NOW()
);

Column Details

Column Type Description
id SERIAL Auto-incrementing primary key
connection_id TEXT The numeric ID of the source OPC-UA connection
node_id TEXT OPC-UA Node ID string (e.g., "ns=2;s=Temperature")
display_name TEXT Human-readable variable name as reported by the server
value_jsonb JSONB Full value as JSON. Supports arrays and complex objects
value_double DOUBLE Numeric representation; booleans as 1.0/0.0; NULL for non-numeric
value_string TEXT String representation of the value
server_timestamp TIMESTAMP Timestamp assigned by the OPC-UA server
source_timestamp TIMESTAMP Timestamp assigned by the data source (sensor/PLC)
status_code TEXT OPC-UA status code name (e.g., "Good", "BadNodeIdUnknown")
created_at TIMESTAMP Row insertion time

Example Data

The following example uses the SQL INSERT format as produced by the application:

INSERT INTO "public"."opcua_data"
  ("id", "connection_id", "node_id", "display_name",
   "value_jsonb", "value_double", "value_string",
   "server_timestamp", "source_timestamp", "status_code", "created_at")
VALUES
  ('1', '1040', 'ns=0;i=2254', 'ServerArray',
   '["urn:instance-20211207-0955:NodeOPCUA-Server"]', null,
   '["urn:instance-20211207-0955:NodeOPCUA-Server"]',
   '2026-02-21 18:53:03.724', '2026-02-19 09:11:59.729',
   'Good', '2026-02-21 17:53:03.929459');

Tabular view of typical rows collected from a running system:

connection_id node_id display_name value_jsonb value_double value_string server_timestamp status_code
1040 ns=2;i=3001 Temperature 23.5 23.5 23.5 2026-02-21 18:53:04.000 Good
1040 ns=2;i=3002 Pressure 101.325 101.325 101.325 2026-02-21 18:53:05.000 Good
1040 ns=2;i=3003 ValveOpen true 1.0 true 2026-02-21 18:53:06.000 Good
1040 ns=2;i=3004 AlarmState “Normal” NULL Normal 2026-02-21 18:53:07.000 Good

Note: The three value_* columns allow flexible querying – use value_double for numeric aggregations (WHERE value_double IS NOT NULL), value_string for text values, and value_jsonb for complex structured objects (e.g., arrays like ServerArray above). When a value is non-numeric (arrays, strings), value_double is NULL.


5. Google Sheets Output

Write OPC-UA data changes directly to Google Sheets spreadsheets.

Features

Row Format

Each row written to Google Sheets contains these columns:

Column Header Type Description
A Connection Name String Name of the source OPC-UA connection
B Display Name String Human-readable variable name from the OPC-UA server
C Node ID String OPC-UA Node ID (e.g., ns=2;s=Temperature)
D Timestamp String ISO 8601 timestamp of the value change (e.g., 2026-02-21T12:00:00.000Z)
E Value Mixed The value – numbers and booleans are written as-is; strings are written as text; objects are serialized to JSON (internal _ prefixed properties and functions are stripped)
F Status String OPC-UA status code (e.g., Good)

Example Data (in Google Sheets)

A B C D E F
1 Production Line A Temperature ns=2;s=Temperature 2026-02-21T12:00:00.000Z 23.5 Good
2 Production Line A Pressure ns=2;s=Pressure 2026-02-21T12:00:01.234Z 101.325 Good
3 Production Line A ValveOpen ns=2;s=ValveOpen 2026-02-21T12:00:02.567Z true Good
4 Production Line B MotorSpeed ns=3;s=MotorSpeed 2026-02-21T12:00:03.890Z 1480 Good
5 Production Line A AlarmState ns=2;s=AlarmState 2026-02-21T12:00:04.123Z Normal Good

Append mode: Each of these rows is added sequentially – the sheet grows over time as a time-series log.
Update mode: Row 1 and row 2 would be overwritten with new values on subsequent data changes (matched by Connection Name | Node ID).


6. Built-in SQLite Database

All data changes from all OPC-UA subscriptions are automatically stored in a local SQLite database.

Features

Table Schema

CREATE TABLE IF NOT EXISTS opc_data_changes (
  id              INTEGER PRIMARY KEY AUTOINCREMENT,
  connectionId    INTEGER,
  nodeId          TEXT,
  displayName     TEXT,
  value           REAL|TEXT,
  serverTimestamp  INTEGER,
  sourceTimestamp  INTEGER,
  statusCode      INTEGER
);

Column Details

Column Type Description
id INTEGER Auto-incrementing primary key
connectionId INTEGER Numeric ID of the source OPC-UA connection
nodeId TEXT OPC-UA Node ID string (e.g., ns=2;s=Temperature)
displayName TEXT Human-readable variable name
value REAL,TEXT Numeric values; non-numeric values are stored as a JSON string
serverTimestamp INTEGER Server-assigned timestamp in Unix epoch milliseconds
sourceTimestamp INTEGER Source-assigned timestamp in Unix epoch milliseconds
statusCode INTEGER OPC-UA status code numeric value (e.g., 0 for Good)

Example Data

id connId nodeId name value serverTimestamp sourceTimestamp code
1 1 ns=2;s=Temperature Temp 23.5 1740142800000 1740142800000 0
2 1 ns=2;s=Pressure Pres 101.325 1740142801000 1740142801000 0
3 1 ns=2;s=ValveOpen Valve 1.0 1740142802000 1740142801500 0
4 2 ns=3;s=MotorSpeed Speed 1480.0 1740142803000 1740142802800 0
5 1 ns=2;s=AlarmState Alarm “Normal” 1740142804000 1740142803900 0

Note: The value column stores numeric values as REAL. Non-numeric values (strings, objects) are stored as their JSON representation. Boolean true/false values are stored as 1.0/0.0. The Visualize page only charts rows where value is a number.

Querying the Database

You can query the SQLite database directly using the sqlite3 command-line tool:

sqlite3 "%APPDATA%\ua-bridge\opcua-data.sqlite"
-- View recent readings with human-readable timestamps
SELECT connectionId, nodeId, displayName, value,
       DATETIME(serverTimestamp/1000, 'unixepoch', 'localtime') AS time
FROM opc_data_changes
ORDER BY id DESC
LIMIT 20;

-- Compute average temperature over the last hour
SELECT AVG(value) AS avg_temp
FROM opc_data_changes
WHERE displayName = 'Temperature'
  AND typeof(value) = 'real'
  AND serverTimestamp >= (CAST((julianday('now') - 2440587.5)*86400000 AS INTEGER) - 3600000);

-- Count records per connection
SELECT connectionId, COUNT(*) AS record_count
FROM opc_data_changes
GROUP BY connectionId;

7. Dashboard & Visualization

Dashboard

The Dashboard page provides an at-a-glance overview:

Visualize / Explore Page

The Explore page (lazy-loaded for performance) provides:


8. Connection Logging

Each OPC-UA connection maintains its own log buffer (up to 10,000 entries).

Log Levels

Level Usage
info Successful operations, data changes, connections
warning Health check anomalies, session warnings
error Connection failures, subscription errors

Log Viewer


9. Project File Management

Save & Load Projects

UA-Bridge configurations can be saved to and loaded from JSON files.


10. Auto-Reconnection

All connection types feature robust auto-reconnection:

Connection Type Base Delay Max Delay
OPC-UA 2 s 60 s
MQTT 2 s 60 s
PostgreSQL 5 s 60 s

All reconnection logic respects manual disconnect flags – once a user explicitly disconnects, auto-reconnection is suppressed until they manually reconnect.


11. Data Retention & Cleanup


12. Theming


13. Keyboard Shortcuts

Shortcut Action
Ctrl+O Open Project
Ctrl+S Save Project As
F11 Toggle Fullscreen
Escape Close active modal dialog
Tab / Shift+Tab Navigate within modals (focus-trapped)

UA-Bridge – Configuration Guide

Version: 1.2.0


Table of Contents

  1. Application Settings
  2. OPC-UA Connection Configuration
  3. MQTT Output Configuration
  4. PostgreSQL Output Configuration
  5. Google Sheets Output Configuration
  6. Configuration File Reference
  7. Data Paths & Storage Locations

1. Application Settings

Application-wide settings are managed from the Settings page and stored in the appSettings section of config.json.

Available Settings

Setting Type Default Range Description
dataRetention Number 30 0 - 365 Number of days to retain historical data. Set to 0 to disable cleanup.
theme String light UI theme (light or dark). Stored separately in localStorage.

Changing Settings

  1. Navigate to the Settings page via the sidebar
  2. Modify the desired values
  3. Changes are automatically saved to config.json when modified

Note: The dataRetention value affects both the built-in SQLite database and all active PostgreSQL connections.


2. OPC-UA Connection Configuration

2.1. Adding a New Connection

  1. Go to the OPC-UA (Connections) page
  2. Click “Add Connection”
  3. Fill in the connection details (see table below)
  4. Click “Add Connection” to save

2.2. Connection Parameters

Parameter Required Type Default Description
Connection Name Yes String Unique name for this connection
Endpoint URL Yes String OPC-UA server endpoint (opc.tcp://host:port)
Security Mode Yes Select None None, Sign, or Sign & Encrypt
Security Policy Yes Select None None, Basic256Sha256, Basic128Rsa15, Basic256, Basic128
Authentication Method Yes Select Anonymous Anonymous or Username/Password
Username No String Required when auth method is Username/Password
Password No String Required when auth method is Username/Password
Auto-Connect No Boolean false Connect automatically on app startup
Session Timeout No Number 60000 Session timeout in milliseconds

2.3. Security Configuration

When Security Mode is set to Sign or Sign & Encrypt, additional fields appear:

Parameter Required Type Description
Client Certificate File No File Path Path to client X.509 certificate (.pem, .crt, .der)
Client Private Key File No File Path Path to client private key (.pem)
Private Key Passphrase No String Passphrase if the private key is encrypted
Automatically Accept Unknown Certificates No Boolean Skip server certificate validation (WARNING: insecure)

File Selection: Use the ... button to open a file browser dialog for selecting certificate and key files.

2.4. Endpoint URL Format

The endpoint URL must follow the OPC-UA TCP URI scheme:

opc.tcp://<hostname>:<port>[/<path>]

Valid examples:

opc.tcp://localhost:4840
opc.tcp://192.168.1.100:4840
opc.tcp://plc-server.local:4840/UAServer

2.5. Security Mode & Policy Combinations

Security Mode Compatible Policies Use Case
None None (only) Development, trusted networks
Sign Basic256Sha256, Basic128Rsa15, Basic256, Basic128 Message integrity
Sign & Encrypt Basic256Sha256, Basic128Rsa15, Basic256, Basic128 Full message confidentiality

Recommendation: For production environments, use Sign & Encrypt with Basic256Sha256.


3. MQTT Output Configuration

3.1. Adding an MQTT Output

  1. Navigate to the Output Destinations page
  2. In the MQTT section, click “Add MQTT Connection”
  3. Fill in the connection details
  4. Click “Save Connection”

3.2. Connection Parameters

Parameter Required Type Default Description
Connection Name Yes String Human-readable name
Host Yes String Broker hostname or IP address
Port Yes Number 1883 Broker port (1883 for MQTT, 8883 for MQTTS)
Protocol Yes Select mqtt mqtt, mqtts, ws, wss
Username No String Broker authentication username
Password No String Broker authentication password
Topic Yes String opcua/data Base topic for published messages
Retain No Boolean false Retain the last message for each topic on the broker

3.3. TLS/SSL Configuration

For mqtts or wss protocols:

Parameter Required Type Description
CA Certificate No File Path Path to Certificate Authority file for server verification
Client Certificate No File Path Path to client certificate for mutual TLS
Client Key No File Path Path to client private key for mutual TLS
Reject Unauthorized No Boolean Set to false for self-signed certificates (default: true)

3.4. Topic Hierarchy

The actual published topic for each data point is constructed as:

{baseTopic}/{connectionName}/{browsePath}/{displayName}

Where:


4. PostgreSQL Output Configuration

4.1. Adding a PostgreSQL Output

  1. Navigate to the Output Destinations page
  2. In the PostgreSQL section, click “Add PostgreSQL Connection”
  3. Fill in the database details
  4. Click “Save Connection”

4.2. Connection Parameters

Parameter Required Type Default Description
Connection Name Yes String Human-readable name
Host Yes String localhost Database server hostname or IP
Port Yes Number 5432 Database server port
Database Yes String Target database name
Username Yes String Database user
Password Yes String Database password
Table Name No String opcua_data Table to store data in

4.3. SSL/TLS Configuration

Parameter Required Type Description
Enable SSL No Boolean Enable SSL/TLS for the database connection
CA Certificate No File Path Path to CA certificate file
Client Certificate No File Path Path to client certificate for mutual TLS
Client Key No File Path Path to client private key for mutual TLS
Reject Unauthorized No Boolean Reject connections with invalid certificates (default: true)

4.4. Automatic Database & Table Setup

When connecting, UA-Bridge performs the following steps:

  1. Check Database Existence: Connects to the postgres system database and queries pg_catalog.pg_database
  2. Create Database (if needed): Runs CREATE DATABASE <name> if the target database doesn’t exist
  3. Connect to Target: Disconnects from postgres and connects to the target database
  4. Create Table (if needed): Runs CREATE TABLE IF NOT EXISTS with the configured or default table name

Note: The service user must have CREATEDB privilege or the target database must already exist.


5. Google Sheets Output Configuration

5.1. Prerequisites

Before configuring a Google Sheets output, you need:

  1. Google Cloud Project with the Google Sheets API enabled
  2. Service Account with a JSON key file
  3. Spreadsheet shared with the service account email (with Editor access)

5.2. Adding a Google Sheets Output

  1. Navigate to the Output Destinations page
  2. In the Google Sheets section, click “Add Google Sheets Connection”
  3. Fill in the spreadsheet details
  4. Click “Save Connection”

5.3. Connection Parameters

Parameter Required Type Default Description
Connection Name Yes String Human-readable name
Spreadsheet ID Yes String The ID from the Google Sheets URL
Sheet Name / Range Yes String Sheet1!A:A Target sheet name and column range
Write Mode Yes Select update append (add rows) or update (replace rows)
Key File Path Yes File Path Path to the Google service account JSON key file

5.4. Finding the Spreadsheet ID

The Spreadsheet ID is found in the URL of your Google Sheet:

https://docs.google.com/spreadsheets/d/{SPREADSHEET_ID}/edit

5.5. Write Modes Explained

Append Mode

Update Mode

5.6. Setting Up Google Cloud

  1. Go to Google Cloud Console
  2. Create or select a project
  3. Enable the Google Sheets API
  4. Go to IAM & Admin -> Service Accounts
  5. Create a service account
  6. Click the service account -> Keys -> Add Key -> Create new key -> JSON
  7. Download the JSON key file
  8. Open your Google Sheet -> Share -> Add the service account email as Editor

6. Configuration File Reference

6.1. File Location

Platform Path
Windows %APPDATA%\ua-bridge\config.json
Windows (UWP) %LOCALAPPDATA%\Packages\{pkg}\LocalCache\Roaming\ua-bridge\config.json

6.2. Complete Configuration Schema

{
  "opcuaConnections": [
    {
      "id": 1,
      "name": "Production Line PLC",
      "endpoint": "opc.tcp://192.168.1.100:4840",
      "securityMode": "None",
      "securityPolicy": "None",
      "authenticationMethod": "Anonymous",
      "username": "",
      "password": "",
      "autoConnect": true,
      "certificateFile": "",
      "privateKeyFile": "",
      "privateKeyPassphrase": "",
      "automaticallyAcceptUnknownCertificate": false,
      "sessionTimeout": 60000
    }
  ],
  "mqttConnections": [
    {
      "id": "uuid-1",
      "name": "Central MQTT Broker",
      "host": "broker.local",
      "port": 1883,
      "protocol": "mqtt",
      "username": "",
      "password": "",
      "topic": "factory/opcua",
      "retain": false,
      "caCert": "",
      "clientCert": "",
      "clientKey": "",
      "rejectUnauthorized": true
    }
  ],
  "postgresConnections": [
    {
      "id": "uuid-2",
      "name": "Historian Database",
      "host": "db.local",
      "port": 5432,
      "database": "process_data",
      "username": "opcua_writer",
      "password": "secret",
      "tableName": "opcua_data",
      "ssl": false,
      "sslCaCert": "",
      "sslClientCert": "",
      "sslClientKey": "",
      "sslRejectUnauthorized": true
    }
  ],
  "googlesheetsConnections": [
    {
      "id": "uuid-3",
      "name": "Monitoring Dashboard",
      "spreadsheetId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
      "range": "Sheet1!A:A",
      "writeMode": "update",
      "keyFilePath": "C:\\keys\\service-account.json"
    }
  ],
  "subscriptions": [],
  "appSettings": {
    "autoConnect": false,
    "logLevel": "info",
    "maxConnections": 10,
    "dataRetention": 30,
    "enableNotifications": true
  }
}

6.3. Saving and Loading Projects

Action Menu / Shortcut Description
Save Project As Ctrl+S Exports config.json to a user-chosen file location
Open Project Ctrl+O Imports a .json file, replaces config.json, restarts the app

Format: The project file is a standard JSON file with the same schema as config.json.


7. Data Paths & Storage Locations

7.1. Standard Paths

Resource Location
Configuration File {userData}/config.json
SQLite Database {userData}/opcua-data.sqlite
Application Logs In-memory only (per connection, 10,000 max)
Temporary Private Keys {os.tmpdir()}/opcua_pk_<random>.pem

7.2. Windows Paths

UA-Bridge automatically detects whether it’s running as a UWP app and uses the appropriate data path.

UA-Bridge – Usage Examples

Version: 1.2.0


Table of Contents

  1. Quick Start: First OPC-UA Connection
  2. Subscribing to Variables
  3. Setting Up MQTT Forwarding
  4. Connecting to a PostgreSQL Historian
  5. Publishing to Google Sheets
  6. Using Secure OPC-UA Connections
  7. Using MQTT with TLS
  8. Saving and Restoring Projects
  9. Setting Up Data Retention
  10. Viewing Historical Data
  11. Complete Industrial Setup Example

1. Quick Start: First OPC-UA Connection

This example walks through connecting to a local OPC-UA simulation server.

Step 1: Launch UA-Bridge

Start the application. You’ll land on the OPC-UA (Connections) page.

Step 2: Add a Connection

  1. Click “Add Connection”

  2. Enter the connection details:

    Field Value
    Connection Name Local Simulator
    Endpoint URL opc.tcp://localhost:4840
    Security Mode None
    Security Policy None
    Authentication Anonymous
  3. Click “Add Connection”

Step 3: Connect

Click the Connect button (plug icon) next to your new connection. The status indicator will turn green when connected. If it doesn’t turn green, check the logs for errors.

Step 4: Browse the Server

  1. Click the Browse button to open the address space browser
  2. Expand the tree: Root -> Objects -> etc.
  3. Select one object from the tree (left panel) or a variable node (middle panel)
  4. Click “Add to Subscription” or “Add Child Variables to Subscription” to start monitoring

You should now see live data values updating in the subscriptions panel.


2. Subscribing to Variables

Single Variable Subscription

  1. After connecting to an OPC-UA server, open the Browse dialog
  2. Navigate through the tree to find the variable of interest
  3. Select the variable node (checkbox)
  4. Click “Add to Subscription”

Batch Subscription

Select multiple variables by clicking a node in the browse tree, then click “Add Child Variables to Subscription”. All child nodes will be subscribed at once.

Subscription Configuration

The following defaults are used for new subscriptions:

Publishing Interval:   5,000 ms
Queue Size:            10
Discard Policy:        Discard Oldest
Timestamps:            Both (server + source)

Modifying a Subscription

Use the Edit Subscription option to change:

Data Flow

Once subscribed, every value change is automatically:

OPC-UA Server
    |
    v
UA-Bridge (Main Process)
    |
    +--+ SQLite DB (always)
    +--+ UI / Renderer (always)
    +--+ MQTT Brokers (if configured)
    +--+ PostgreSQL DBs (if configured)
    +--+ Google Sheets (if configured)

3. Setting Up MQTT Forwarding

Example: Forward to a Mosquitto Broker

Step 1: Configure the MQTT Output

  1. Go to the Output Destinations page

  2. Click “Add MQTT Connection”

  3. Enter:

    Field Value
    Connection Name Factory MQTT Broker
    Host mqtt-broker.factory.local
    Port 1883
    Protocol mqtt
    Topic factory/opcua/data
    Retain true
  4. Click “Save Connection”

Step 2: Connect

Click Connect on the MQTT connection. The status will update to “Connected”.

Step 3: Verify Data

Subscribe to topics on the MQTT broker using any MQTT client:

mosquitto_sub -h mqtt-broker.factory.local -t "factory/opcua/data/#" -v

You should see messages like:

factory/opcua/data/LocalSimulator/Objects/Simulation/Temperature
{
  "connectionId":1,
  "connectionName":"Local Simulator",
  "nodeId":"ns=2;s=Temperature",
  "displayName":"Temperature",
  "value":23.5,
  "serverTimestamp":"2026-02-21T12:00:00.000Z",
  "sourceTimestamp":"2026-02-21T12:00:00.000Z",
  "statusCode":"Good"
}

4. Connecting to a PostgreSQL Historian

Example: Store Process Data in PostgreSQL

Step 1: Prepare the Database Server

Ensure PostgreSQL is running and accessible. The database user needs either:

Step 2: Configure the PostgreSQL Output

  1. Go to Output Destinations

  2. Click “Add PostgreSQL Connection”

  3. Enter:

    Field Value
    Name Process Historian
    Host db-server.local
    Port 5432
    Database process_data
    Username opcua_writer
    Password secure_password
    Table Name opcua_data
  4. Click “Save Connection”

Step 3: Connect and Verify

After connecting, check the database:

SELECT * FROM opcua_data ORDER BY created_at DESC LIMIT 10;

Expected result:

id connection_id node_id display_name value_jsonb value_double value_string server_timestamp status_code
1 1 ns=2;s=Temp Temperature 23.5 23.5 23.5 2026-02-21 18:53:04.00 Good

Obs.: Not all columns are shown in the example table.


5. Publishing to Google Sheets

Example: Create a Live Monitoring Dashboard

Step 1: Set Up Google Cloud

  1. Create a Google Cloud project
  2. Enable the Google Sheets API
  3. Create a Service Account and download the JSON key
  4. Create a Google Sheet and share it with the service account email (Editor access)

Step 2: Configure the Google Sheets Output

  1. Go to Output Destinations

  2. Click “Add Google Sheets Connection”

  3. Enter:

    Field Value
    Connection Name Plant Dashboard
    Spreadsheet ID 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
    Sheet / Range LiveData!A:A
    Write Mode update
    Key File Path C:\Keys\plant-monitor-sa.json
  4. Click “Save Connection”

Step 3: Connect

Click Connect. Data changes will begin appearing in your spreadsheet:

A (Connection) B (Display Name) C (Node ID) D (Timestamp) E (Value) F (Status)
Local Simulator Temperature ns=2;s=Temperature 2026-02-21T12:00:00.000Z 23.5 Good
Local Simulator Pressure ns=2;s=Pressure 2026-02-21T12:00:01.234Z 101.3 Good

Tip: In Update mode, each ConnectionName|NodeId combination occupies exactly one row. New values overwrite the previous entry, creating a real-time “current values” view.


6. Using Secure OPC-UA Connections

Example: Connect with Certificate-Based Security

Prerequisites

Step 1: Configure the Connection

  1. Click “Add Connection”

  2. Enter:

    Field Value
    Connection Name Secure PLC
    Endpoint URL opc.tcp://plc.factory.local:4840
    Security Mode Sign & Encrypt
    Security Policy Basic256Sha256
    Authentication Username/Password
    Username operator
    Password secure_pass
    Certificate File C:\Certs\client-cert.pem
    Private Key File C:\Certs\client-key.pem
    Private Key Passphrase my_key_password
    Accept Unknown Certs [ ] (unchecked for production)
  3. Click “Add Connection”

Security Note: Only check “Accept Unknown Certificates” in development or when connecting to servers with self-signed certificates on trusted networks.


7. Using MQTT with TLS

Example: Connect to an MQTTS Broker

Step 1: Configure TLS MQTT

  1. Go to Output Destinations -> “Add MQTT Connection”

  2. Enter:

    Field Value
    Connection Name Secure Cloud Broker
    Host cloud-mqtt.example.com
    Port 8883
    Protocol mqtts
    Username device01
    Password device_secret
    Topic plant/opcua
    CA Certificate C:\Certs\mqtt-ca.pem
    Client Certificate C:\Certs\mqtt-client.pem
    Client Key C:\Certs\mqtt-client-key.pem
    Reject Unauthorized [x] enabled
  3. Click “Save Connection”

For self-signed certificates: Uncheck Reject Unauthorized to skip CA validation. This is insecure and should only be used in development.


8. Saving and Restoring Projects

Saving a Project

  1. Configure all your connections, outputs, and subscriptions
  2. Press Ctrl+S (or use the menu)
  3. Choose a location and filename (e.g., factory-floor-config.json)
  4. Click Save

Restoring a Project

  1. Press Ctrl+O (or use the menu)
  2. Select a previously saved .json project file
  3. UA-Bridge will replace the current configuration and restart

Project File Example

{
  "opcuaConnections": [
    {
      "id": 1,
      "name": "PLC Line A",
      "endpoint": "opc.tcp://192.168.1.10:4840",
      "securityMode": "None",
      "securityPolicy": "None",
      "authenticationMethod": "Anonymous",
      "autoConnect": true,
      "sessionTimeout": 60000
    },
    {
      "id": 2,
      "name": "PLC Line B",
      "endpoint": "opc.tcp://192.168.1.11:4840",
      "securityMode": "None",
      "securityPolicy": "None",
      "authenticationMethod": "Anonymous",
      "autoConnect": true,
      "sessionTimeout": 60000
    }
  ],
  "mqttConnections": [
    {
      "id": "mqtt-1",
      "name": "Factory MQTT",
      "host": "mqtt.factory.local",
      "port": 1883,
      "protocol": "mqtt",
      "topic": "factory/data",
      "retain": true
    }
  ],
  "postgresConnections": [
    {
      "id": "pg-1",
      "name": "Historian",
      "host": "historian.factory.local",
      "port": 5432,
      "database": "process_data",
      "username": "opcua",
      "password": "secret",
      "tableName": "sensor_data"
    }
  ],
  "appSettings": {
    "dataRetention": 90
  }
}

9. Setting Up Data Retention

Adjusting Retention Period

  1. Go to the Settings page
  2. Set the Data Retention (Days) value:

What Gets Cleaned

Data Store Records Affected Followed By
SQLite (built-in) opc_data_changes where serverTimestamp < cutoff VACUUM
PostgreSQL All records where created_at < cutoff VACUUM ANALYZE

Cleanup Schedule


10. Viewing Historical Data

Built-in Charts

  1. Navigate to the Visualize page
  2. The page loads the last 3 hours of numeric data from the SQLite database
  3. Data is displayed as time-series charts (Chart.js)

Direct Database Access

Click “Show Database File” from the Dashboard or use OPC data options to open Windows Explorer at the database location. You can then query the SQLite file directly:

sqlite3 "%APPDATA%\ua-bridge\opcua-data.sqlite"

For MS Store version (UWP):

sqlite3 "%LOCALAPPDATA%\Packages\{pkg}\LocalCache\Roaming\ua-bridge\config.json"

Use the SQLite Output “Show File” button to open Windows Explorer at the exact database file location.

-- View recent temperature readings
SELECT displayName, value,
       datetime(serverTimestamp/1000, 'unixepoch', 'localtime') as time
FROM opc_data_changes
WHERE displayName LIKE '%Temperature%'
ORDER BY id DESC
LIMIT 20;

-- Count records per connection
SELECT connectionId, COUNT(*) as record_count
FROM opc_data_changes
GROUP BY connectionId;

Clearing Historical Data

To free disk space, use the “Empty Data” button, which performs:

DELETE FROM opc_data_changes;
VACUUM;

11. Complete Industrial Setup Example

Scenario

A manufacturing plant with:

Configuration

+----------------------------+
|        UA-Bridge           |
|                            |
|  OPC-UA Connections:       |
|  +-- PLC Line A            |---> opc.tcp://192.168.1.10:4840
|  +-- PLC Line B            |---> opc.tcp://192.168.1.11:4840
|                            |
|  Output Destinations:      |
|  +-- MQTT: SCADA           |---> mqtt://scada-broker:1883
|  |   Topic: plant/opcua    |
|  +-- PostgreSQL: Historian |---> postgres://db-server:5432/process_data
|  |   Table: sensor_data    |
|  +-- Google Sheets: KPIs   |---> Spreadsheet: "Plant KPIs"
|      Mode: update          |
|                            |
|  Settings:                 |
|  +-- Retention: 90 days    |
+----------------------------+

Step-by-Step Setup

  1. Add OPC-UA Connections
  2. Connect & Subscribe
  3. Configure MQTT Output
  4. Configure PostgreSQL Output
  5. Configure Google Sheets Output
  6. Save the Project
  7. Set Data Retention

All data from both PLCs will now automatically flow to the MQTT broker, PostgreSQL database, and Google Sheet simultaneously, with automatic reconnection and 90-day retention management.


Troubleshooting

Common Issues

Issue Cause Solution
Connection immediately fails Wrong endpoint URL or server not running Verify the endpoint format (opc.tcp://...)
“Maximum subscription limit” Free edition 100-variable limit reached Remove unused subscriptions or upgrade to Pro
MQTT messages not appearing Topic mismatch Check the base topic; actual topics include connection and node names
PostgreSQL permission denied User lacks CREATEDB or table privileges Grant privileges or pre-create the database and table
Google Sheets API error Service account not shared on spreadsheet Share the spreadsheet with the service account email (Editor)
Private key decryption fails Wrong passphrase Verify the passphrase matches the one used to encrypt the key
Auto-reconnect not working Manually disconnected Manually reconnect; auto-reconnect is suppressed after manual disconnect
Data not appearing in charts Non-numeric values The Visualize page only displays numeric (REAL) values

Checking Connection Logs

Each connection maintains up to 10,000 log entries. Open the log viewer:

  1. Click the Log button on any connection
  2. A new window opens with the full log history
  3. Logs include timestamps, severity levels, and detailed messages