sondahub

sondahub / Industrial protocols

Industrial protocols

An OPC UA server, a Modbus TCP gateway, a HART-IP loop and a DDS participant, each with something real-shaped behind it that runs on the clock: a bottling line, a lift station, five field devices, a robot and a pumping plant. Free, open, nothing to install — and a small bridge for the tools that speak only TCP or UDP.

Each connection gets its own plant: what you write is yours, and gone when you disconnect.

How they travel

ProtocolAddressOn the wire
OPC UAopc.wss://api.sondahub.com/opcuaThe WebSocket mapping of OPC UA Part 6: subprotocol opcua+uacp, one UA Connection Protocol chunk per WebSocket message. SecurityPolicy None.
Modbus TCPwss://api.sondahub.com/modbusModbus TCP frames (MBAP header and PDU) as binary WebSocket messages — or JSON as text.
HART-IPwss://api.sondahub.com/hart-ipHART-IP messages (header and body) as binary WebSocket messages — or JSON as text.
DDSwss://api.sondahub.com/ddsRTPS datagrams, each with the address it came from or goes to, and Fast DDS’s TCP frames, through the bridge — or JSON as text. DDS Security with a published playground PKI.

The JSON form is there for any WebSocket client — a browser console, a WebSocket pane, wscat: send {"unit":1,"function":3,"address":0,"count":10} to the Modbus gateway, or {"command":3,"tag":"PT-101"} to the HART loop, and the answer comes back decoded, with the frames in hex beside it; send {"subscribe":"*"} to the DDS participant and its topics stream in.

From a browser console
const ws = new WebSocket('wss://api.sondahub.com/modbus')
ws.onmessage = (e) => console.log(JSON.parse(e.data))
ws.onopen = () => ws.send(JSON.stringify({ unit: 1, function: 4, address: 0, count: 6 }))

From a tool that only speaks TCP

UaExpert, asyncua, node-opcua, Modbus Poll, pymodbus and most other tools open a TCP connection and nothing else. The bridge is a small Node script that runs on your computer, listens on the usual TCP port and carries each message to the hub over WebSocket — nothing else happens in it, and nothing is installed:

Run the bridge
curl -O https://sondahub.com/industrial/bridge.mjs
node bridge.mjs opcua

# then point the tool at opc.tcp://localhost:4840

Every mode of the bridge, for every protocol that needs one: All Bridges.

For DDS, node bridge.mjs dds binds a participant’s ports instead — 7410 and 7411 on domain 0, and TCP port 5100 — and a DDS client on your computer discovers the hub there. How.

In Sonda

Built as the playground for LockFlare Sonda, the API client that lives on your computer. A WebSocket request in Sonda to the Modbus, HART or DDS address speaks the JSON form; a client that speaks the protocols themselves takes the addresses as they are, or the bridge.

Questions

Why WebSocket, and not port 4840, 502, 5094 or 7400?

sondahub runs where only HTTP reaches — no raw TCP or UDP comes in. So each protocol travels over a WebSocket, unchanged inside it. For OPC UA that is the standard itself: Part 6 of the specification maps OPC UA onto WebSockets (opc.wss://, subprotocol opcua+uacp). Modbus TCP and HART-IP have no such mapping, so their frames ride in WebSocket messages exactly as they travel on TCP, and DDS’s RTPS datagrams ride the same way. The bridge turns them back into a TCP port, or a DDS participant’s UDP ports, on your computer.

Do my writes reach other people?

No. Every connection gets its own plant, lift station, loop or robot: what you write, start, stop, publish or reconfigure belongs to your connection and disappears with it. Nothing is stored anywhere.

Are these real devices or certified implementations?

Neither. They are simulators for testing clients: the wire format and the behaviour a client has to handle — exceptions, ramps, status flags, subscriptions, timeouts — follow the protocols, and the plant behind them runs on the clock. They are not certified, and the device, manufacturer and vendor ids are made up or left unassigned. OPC UA is a specification of the OPC Foundation, HART of FieldComm Group, Modbus of the Modbus Organization, DDS of the Object Management Group.