sondahub

sondahub / Industrial protocols

Industrial protocols

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

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.

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.

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

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 or HART address speaks the JSON form; a client that speaks the protocols themselves takes the addresses as they are.

Questions

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

sondahub runs where only HTTP reaches — no raw TCP sockets come 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. The bridge turns any of the three back into a TCP port on your computer for tools that speak only TCP.

Do my writes reach other people?

No. Every connection gets its own plant, lift station and loop: what you write, start, stop 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 and manufacturer ids are made up. OPC UA is a specification of the OPC Foundation, HART of FieldComm Group, Modbus of the Modbus Organization.