OPC UA·SANDBOX Free public server

RUEN

Docs

Connecting

Shared server
opc.tcp://opcua-sendbox.electroman.by:4840/electroman/
Personal servers
ports 4841–5000
Security
None (anonymous login) и Basic256Sha256 (Sign/SignAndEncrypt): user and password sendbox/sendbox
Namespace
urn:electroman:opcua-sendbox (ns=2)
Nodes
Objects/SendBox/Tags/*, Objects/SendBox/Alarms/*

UaExpert

Add Server → Custom Discovery → paste the address, policy None, Anonymous (or Basic256Sha256, Sign/SignAndEncrypt, Username with sendbox/sendbox). Events: Document → Add → Event View, drag the Server node; alarms — Alarms & Conditions View.

ModbusToolkit

OPC UA tab: paste the address, security None (or Basic256Sha256 with login sendbox), Connect. History is on the History page, events on Events → subscribe to SendBox or Server.

Python (asyncua)

import asyncio
from asyncua import Client, ua

async def main():
    async with Client("opc.tcp://opcua-sendbox.electroman.by:4840/electroman/") as client:
        sine = client.get_node("ns=2;s=Tags.Sine")
        print("Sine =", await sine.read_value())

asyncio.run(main())

Python (asyncua): subscription with reconnection

auto_reconnect=True: on connection loss the client reconnects and restores subscriptions on its own. UaExpert also restores subscriptions automatically, and the open62541 (C/C++) library has session and subscription recovery built in.

import asyncio
from asyncua import Client

class Handler:
    def datachange_notification(self, node, value, data):
        print(node, "=", value)

async def main():
    # auto_reconnect=True: при обрыве клиент переподключается
    # и восстанавливает подписки сам
    async with Client("opc.tcp://opcua-sendbox.electroman.by:4840/electroman/", auto_reconnect=True) as client:
        node = client.get_node("ns=2;s=Tags.Sine")
        subscription = await client.create_subscription(500, Handler())
        await subscription.subscribe_data_change(node)
        while True:
            await asyncio.sleep(3600)

asyncio.run(main())

REST API

KEY=$(curl -s -X POST http://opcua-sendbox.electroman.by/api/keys | jq -r .key)
curl -s -X POST -H "X-API-Key: $KEY" http://opcua-sendbox.electroman.by/api/sessions

What the server does

Limits

Source code

The server is open source: you can run your own copy on a local network.

git clone https://github.com/StarLeG/opcua-sendbox.git

About the author

Oleg Starinsky

Commissioning engineer for industrial automation: I build the tools I use on site myself. C++/Qt, Python, STM32. The Electroman ecosystem — ModbusToolkit, Modbus SendBox and OPC UA SendBox — is a set of free tools for control-system engineers.

GitHub · electroman.by · Telegram

ModbusToolkit

Test clients in ModbusToolkit

Connect to the sandbox from ModbusToolkit: node tree, subscriptions, history, events, OPC UA ↔ Modbus bridge. Free, 19 tools, Windows and Linux.

SendBox is free and ad-free. The server and the test bench are paid for by donations.