CLI toolsiec61850ctl
IEC 61850 from the terminal: browse IEDs, read and write, operate controls and subscribe to reports over MMS, and sniff, subscribe to and publish GOOSE and Sampled Values on the station bus.
What it does
- MMS client: discover, browse, read, write scalar settings, operate controls in one association, subscribe to URCBs and BRCBs, download files and read journals.
- GOOSE: list control blocks from SCL, sniff, supervised subscriptions, publishing with guard rails (test frames unless you say otherwise) and GoCB read and write over MMS.
- Sampled Values: sniff, supervised subscriptions with live loss and rate statistics, publishing with 9-2LE sine waveforms (simulation frames by default) and MSVCB read and write over MMS.
- Runs an MMS server from any ICD, CID or SCD file, and a read-only HTTP/JSON API in front of one device.
- Stable exit codes and JSON or JSON Lines output for scripting, static binaries with no cgo for Linux, macOS and Windows.
- Black-box end-to-end tests against the four iec61850-interop stacks, GOOSE and Sampled Values included.
Install
Linux and macOS
curl -fsSL https://get.otfabric.io/iec61850ctl | sh
Windows (PowerShell)
irm https://get.otfabric.io/iec61850ctl.ps1 | iex
CI, containers and device images
curl -fsSL https://get.otfabric.io/iec61850ctl | env OTF_UNMANAGED_INSTALL=/usr/local/bin sh
One static binary for Linux (x86-64, ARM64, ARMv7), macOS (Intel, Apple silicon) and Windows (x86-64, ARM64), with no runtime to install. The installer checks the release's SHA-256 checksum, installs per user without sudo, and upgrades in place when you run it again. Pin a release withOTF_VERSION. All install options. To build from source: go install github.com/otfabric/iec61850ctl@latest.
First commands
# List the logical devices of an IED, and the logical nodes in one
iec61850ctl list lds --host 192.0.2.10
iec61850ctl list lns --host 192.0.2.10 --ld MNSREF615LD0
# Read a measurement (FC MX)
iec61850ctl get object --host 192.0.2.10 --object MNSREF615LD0/FMMXU1.Hz.mag.f --fc MX
# Subscribe to a buffered report, until Ctrl-C
iec61850ctl subscribe report --host 192.0.2.10 --ld MNSREF615LD0 --ln LLN0 --report rcbMeasFlt01 --type BR --show-values --interrogation
# Watch GOOSE and Sampled Values on the station bus
iec61850ctl goose sniff --iface eth0 --count 5
iec61850ctl sv subscribe --iface eth0 --scl station.scd --svcb MSVCB01 --duration 10s
# Run a local MMS server from an SCL file
iec61850ctl server start --scl device.cid --host 0.0.0.0 --port 102
The iec61850ctl guide walks through every command group, connection option and safety rule.
For scripts, CI and containers
iec61850ctl is as easy to read for a pipeline as for a person. It follows the same conventions as every OT Fabric tool, so a script written for one protocol carries over to the next.
- JSON output.
--format json, or IEC61850CTL_FORMAT=json for a whole job. One JSON document per command, JSON Lines for streams, and a single {"error": {"kind", "code", "message"}} object on failure. Field names are a documented contract: json-output.md. - Clean streams. The result goes to stdout; progress, connection state and debug traces go to stderr.
- Stable exit codes from the shared OT Fabric table, so a script can tell a missing connection (4) from a timeout (5) or a refusal by the device (6). Which command returns what: exitcodes.md.
- Aligned version reporting.
iec61850ctl version --json prints name, version,tag, commit, built, libraries (the OT Fabric stacks inside the binary), go andplatform, with the same keys in every tool. - Pinned installs with
OTF_VERSION, and OTF_UNMANAGED_INSTALL for images that must not touch PATH or shell profiles.
The exit-code table
| Code | Meaning |
|---|
0 | Success |
1 | Findings: the command completed and its result reports problems, such as a file that does not validate or a diagnosis with a failing check |
2 | Usage: unknown command or flag, a missing argument |
3 | Invalid input: a flag value, a file or a combination that does not make sense. Nothing was sent |
4 | Transport: the connection could not be made, or was lost |
5 | Timeout: the device did not answer in time |
6 | Protocol: the device refused the request, or broke the protocol |
7 | Partial success: a valid result was written, and it holds failures |
8 | Unsupported: the device, or this platform, does not support what was asked |
9 | Permission: the device or the operating system refused, such as raw-socket access without the capability |
10 | Output or internal error |
130 | Interrupted by Ctrl-C or SIGTERM before a result |
Each tool uses the codes that apply to it; a code never changes meaning between tools.
In a Dockerfile
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl \
&& curl -fsSL https://get.otfabric.io/iec61850ctl \
| env OTF_UNMANAGED_INSTALL=/usr/local/bin sh \
&& rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["iec61850ctl"]
Scripts, CI and containers has GitHub Actions and GitLab CI examples and shows how to use a simulator as a test fixture.
Protocols
- IEC 61850: IEC 61850 communication for substation automation: client/server services over MMS on TCP port 102, GOOSE events and Sampled Values streams on the station and process bus, all configured from SCL.
The README on GitHub has the full feature list, examples and changelog.