Skip to content
CLI tools

bacnetctl

Discover BACnet devices, list point lists, read, write at priority, monitor COV and inspect alarms, or serve a simulated device from a JSON file to test clients against.

Install

Linux and macOS

curl -fsSL https://get.otfabric.io/bacnetctl | sh

Windows (PowerShell)

irm https://get.otfabric.io/bacnetctl.ps1 | iex

CI, containers and device images

curl -fsSL https://get.otfabric.io/bacnetctl | 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/bacnetctl@latest.

First commands

# Which devices are on this network?
bacnetctl discover

# Its point list: every object with value, unit, status and description
bacnetctl objects --device 192.168.1.20 --values

# One value, as JSON for a script
bacnetctl read --device 192.168.1.20 analog-input:1 present-value --format json

# Watch two points change, until Ctrl-C
bacnetctl monitor --device 192.168.1.20 analog-input:1 binary-input:3

# Override a setpoint at operator priority, then hand it back
bacnetctl write --device 192.168.1.20 analog-value:1 present-value 22.5 --priority 8
bacnetctl release --device 192.168.1.20 analog-value:1 --priority 8

# No device at hand: serve the example device
bacnetctl server run --listen 127.0.0.1

The bacnetctl guide walks through every command group, connection option and safety rule.

For scripts, CI and containers

bacnetctl 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.

The exit-code table
CodeMeaning
0Success
1Findings: the command completed and its result reports problems, such as a file that does not validate or a diagnosis with a failing check
2Usage: unknown command or flag, a missing argument
3Invalid input: a flag value, a file or a combination that does not make sense. Nothing was sent
4Transport: the connection could not be made, or was lost
5Timeout: the device did not answer in time
6Protocol: the device refused the request, or broke the protocol
7Partial success: a valid result was written, and it holds failures
8Unsupported: the device, or this platform, does not support what was asked
9Permission: the device or the operating system refused, such as raw-socket access without the capability
10Output or internal error
130Interrupted 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/bacnetctl \
    | env OTF_UNMANAGED_INSTALL=/usr/local/bin sh \
 && rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["bacnetctl"]

Scripts, CI and containers has GitHub Actions and GitLab CI examples and shows how to use a simulator as a test fixture.

Protocols

The README on GitHub has the full feature list, examples and changelog.

go-bacnet

BACnet/IP client and server: discovery, properties, COV and alarms, routed networks and foreign-device registration on the client; a device of your own with its objects, intrinsic reporting and an optional BBMD on the server.

go get github.com/otfabric/go-bacnet

bacnet-interop

BACnet/IP reference devices: BACnet Stack, BACpypes3, legacy BACpypes, BACnet4J, System.IO.BACnet, Worldiety, cB-Sigma, ulbios and bacnet-js, with cB-Sigma's simulator for faults. Six of them also run as clients to test a BACnet server, and go-bacnet is published as an image for others to test against.