Voltrus Gateway Documentation: One gRPC API for Every Protocol

Overview

Voltrus Gateway is a single Rust binary that unifies seven industrial protocols (Modbus TCP, OPC UA, EtherNet/IP (CIP), Siemens S7, DNP3, BACnet/IP, and MQTT) behind one typed gRPC API. Instead of writing and maintaining a different client for every protocol, your application talks to the gateway once and reads, writes, and subscribes to tags on any PLC.

The gateway runs the same mt-* engines that power the Voltrus explorer apps, making it the single canonical implementation of each protocol. SCADA shrinks to SCADA concerns; protocol bugs get fixed once, everywhere.

One license = one host. Voltrus Gateway is a commercial, one-time-purchase product: not open source, not a subscription. Each license covers a single machine that runs the binary. Buy a license per host you deploy on.

Installation

Voltrus Gateway ships as a single static binary per platform: Linux and Windows. No installer, no runtime, no package manager required. Download it, make it executable, run it.

Download

System Requirements

RequirementMinimum
OSLinux (x86_64 / aarch64) or Windows x64
NetworkReachability to the device on its protocol port (Modbus 502, S7 102, OPC UA 4840, …)
LicenseOne VOLTRUS-GATEWAY-* key per host

First Run

Make the binary executable (Linux) and activate the license by exporting it as an environment variable:

chmod +x voltrus-gateway
export VOLTRUS_GATEWAY_LICENSE=VOLTRUS-GATEWAY-XXXX-XXXX-XXXX
./voltrus-gateway
You may also put the key in a voltrus-gateway.license file beside the binary instead of using the environment variable.

Quick Start

The gateway exposes five RPCs. The flow is the same for every protocol: open a session, read or write tags, then subscribe for live updates.

  1. Open a session. Call OpenSession with a ConnectRequest describing the protocol and target, e.g. a Modbus TCP device at 192.168.10.5:502, unit ID 1. The gateway holds the connection and speaks the native wire protocol.
  2. Read tags. Call ReadTags with the tag paths or addresses you want. Values come back typed (bool, int, float, double, string, bytes), never flattened.
  3. Write a tag. Call WriteTag with a typed value. The gateway encodes it correctly for the target protocol.
  4. Subscribe. Call SubscribeTags and consume the server-streamed TagUpdateBatch as devices change. No client-side polling loop.
  5. Discover. Don't know the tag list? Call Discover to browse the device's tag namespace over the same surface.

The gRPC API

The full surface is five RPCs. One client talks to every protocol through them.

rpc OpenSession(ConnectRequest)     -> ConnectResponse
rpc ReadTags(ReadTagsRequest)       -> ReadTagsResponse
rpc WriteTag(WriteTagRequest)       -> WriteResult
rpc SubscribeTags(SubscribeRequest) -> stream TagUpdateBatch
rpc Discover(DiscoverRequest)       -> DiscoverResponse

Typed tag values

Every tag value is carried as a rich oneof so a CIP DINT or an OPC UA string round-trips without being flattened to a number:

message TagValue {
  oneof value {
    bool   v_bool   = 1;
    int32  v_int32  = 2;
    int64  v_int64  = 3;
    uint32 v_uint32 = 4;
    float  v_float  = 5;
    double v_double = 6;
    string v_string = 7;
    bytes  v_bytes  = 8;
  }
  string source_type = 9;   // e.g. "CIP.DINT", "OPCUA.String"
}

Supported Protocols

All seven protocols ship today. The six device protocols have full read, write, and subscribe; MQTT adds publish, read, and subscribe on the same gRPC surface.

ProtocolReadWriteSubscribe
Modbus TCP✓✓✓
OPC UA✓✓✓
EtherNet/IP (CIP)✓✓✓
Siemens S7✓✓✓
BACnet/IP✓✓✓
DNP3✓✓✓
MQTT✓✓ (publish)✓

Configuration

Listen address

By default the gateway listens for gRPC on 127.0.0.1:50061. Override with --bind (or VOLTRUS_GATEWAY_BIND) to use another address/port, e.g. 0.0.0.0:50061 to expose it on the LAN, behind your firewall.

Per-protocol connection options

Each ConnectRequest carries protocol-specific options (timeout, unit ID / node ID, OPC UA security mode, S7 rack/slot). Sensible defaults are applied; override only what differs from the device's documented configuration.

Licensing

Provide the key via --license, VOLTRUS_GATEWAY_LICENSE or a voltrus-gateway.license file beside the binary. The gateway validates the key on startup and refuses to serve if it is missing or bound to another host.

Sparkplug B edge node

From version 2.2.0 the gateway can publish the tags it reads to an MQTT 3.1.1 broker as one Sparkplug B edge node. Each open session (a PLC connection) is a Sparkplug device; each tag is a metric named after the tag.

MessageWhen
NBIRTHAfter connecting, and on Rebirth: bdSeq, Node Control/Rebirth, software and version
DBIRTHPer device: every tag with name, alias, datatype and value
DDATAChanged tags only, by alias, after the device deadband
DDEATHEvery tag of the device failing, or its session closed. The device is born again when values return
NDEATHRegistered as the MQTT Will at QoS 1 (published by the broker if the gateway drops off), and on StopSparkplug
NCMDNode Control/Rebirth = true: NBIRTH and every DBIRTH again
DCMDWrites to the PLC, only when allow_writes is on

Start it over gRPC

StartSparkplug takes the broker (host, port, username, password, TLS, CA), the group and edge node ids, and the devices: an open session id, its tags, a poll interval and a deadband. GetSparkplugStatus reports the connection, bdSeq, seq, devices online, counters and the last error. StopSparkplug publishes NDEATH and disconnects. The Python and TypeScript SDKs have start_sparkplug / startSparkplug and an example each.

session = gw.connect("modbus", ip="192.168.1.20", unit_id=1)
gw.start_sparkplug(
    broker={"host": "broker.local", "port": 1883},
    group_id="Plant1",
    edge_node_id="Gateway1",
    devices=[{"session": session, "device_id": "Filler", "deadband": 0.5,
              "tags": [{"name": "Speed", "address": 0, "reg_type": "uint16"}]}],
)

Start it from a file

For a headless install, voltrus-gateway --sparkplug-config sparkplug.json (or VOLTRUS_GATEWAY_SPARKPLUG_CONFIG) opens the sessions named in the file and starts the edge node, with no client attached. Devices that are unreachable at startup are retried every 10 seconds. The fields are the gRPC message fields in snake_case:

{
  "sessions": {
    "filler": { "protocol": { "modbus": { "ip": "192.168.1.20", "unit_id": 1 } } }
  },
  "sparkplug": {
    "broker": { "host": "plant1.broker.voltrus.id", "port": 8883, "tls": true,
                "username": "gateway1", "password": "change-me" },
    "group_id": "Plant1",
    "edge_node_id": "Gateway1",
    "bd_seq_path": "/var/lib/voltrus-gateway/sparkplug.bdseq",
    "devices": [{
      "session_id": "filler", "device_id": "Filler", "deadband": 0.5,
      "tags": [{ "address": { "modbus": { "name": "Speed", "address": 0, "reg_type": "uint16" } } }]
    }]
  }
}

Options

FieldDefaultMeaning
primary_host_idnoneWait for spBv1.0/STATE/<id> online before births. When the host goes offline, publish NDEATH, disconnect and connect again
allow_writesoffApply DCMD writes to the PLC. Off: refused and reported in last_error
devices[].deadband0Numeric change needed before a DDATA
max_interval_ms0 (never)Publish a change held back by the deadband after this long
bd_seq_path./voltrus-gateway-sparkplug.bdseqFile keeping bdSeq across restarts. Put it on persistent storage
broker.keep_alive_secs30The broker publishes the NDEATH Will after 1.5 times this without traffic

Datatypes follow the tag's source type: Boolean, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, Float, Double, String and Bytes. Modbus registers come back scaled, so they are published as Double. Not supported yet: Templates (UDTs), DataSets, store and forward, metric properties, MQTT 5.

To check what the gateway publishes, subscribe to spBv1.0/# in MQTT Explorer (free). Its Sparkplug B tab shows the edge node, devices and metrics and has a Rebirth button. Background: MQTT Sparkplug B explained.

Type Preservation

Industrial protocols carry rich data types that get destroyed when flattened to a JSON number: a CIP DINT, an OPC UA String, a signed vs unsigned 32-bit register. Voltrus Gateway preserves them via the TagValue oneof and a source_type string, so your client code branches on type rather than guessing byte order.

The same value read over Modbus, OPC UA, or EtherNet/IP arrives at the client in the same shape. The gateway absorbs each protocol's encoding quirks.

Troubleshooting

License rejected on startup

Symptom: The gateway exits with a license error.
Fix: Confirm VOLTRUS_GATEWAY_LICENSE is set in the environment the binary actually runs in (not just your interactive shell: check systemd unit, container env, or launch agent). One license binds to one host; a key activated elsewhere will be rejected.

OpenSession fails (connection refused)

Symptom: OpenSession returns an unreachable / refused error.
Fix: Confirm network reachability to the device on its protocol port from the gateway host: nc -zv 192.168.10.5 502. Check the protocol-specific addressing: Modbus unit ID, S7 rack/slot, OPC UA endpoint URL and security mode.

Tag values come back flattened

Symptom: A 32-bit register reads as a raw integer instead of a typed value.
Fix: The gateway preserves types only when the request names the tag with its native type/path. For raw Modbus addresses, specify the intended decoding in the read request; for CIP/OPC UA, use the symbolic tag path so the device reports its type.

Subscription gaps / missed updates

Symptom: SubscribeTags stream opens but updates seem delayed or batched irregularly.
Fix: The gateway pushes server-streamed deltas. Slow devices throttle internally; raise the device's scan rate, or for Modbus increase the poll cadence. Confirm the client is draining the stream. A blocked consumer stalls backpressure.

Roadmap

  • Now: read, write, subscribe, and discover over Modbus TCP, OPC UA, EtherNet/IP (CIP), Siemens S7, DNP3, and BACnet/IP.
  • MQTT: publish, read and subscribe on the same gRPC surface, bridged into the unified tag model.
  • Sparkplug B (2.2.0): publish sessions as a Sparkplug B edge node with births, aliases, Rebirth and optional DCMD writes. Next: Templates for UDTs and store and forward.
  • Then: richer discovery, batch write APIs, and per-session diagnostics.

Support

When reporting a connection issue, include the protocol, the ConnectRequest parameters (redact IPs), and the gateway's startup log lines.