Skip to main content

pro-os-connect-py

Python library and command-line tool for monitoring and controlling Donaldson BOFA fume extractors over the Pro OS Connect TCP protocol.

  • Read telemetry: flow rate, filter pressures, blockage levels, alarms, pump state
  • Start and stop the pump, change the setpoint
  • Read and set the device clock
  • Query device information: software version, serial numbers, network configuration
  • No dependencies beyond crccheck

Disclaimer

The initial working version of this library was written by a human. It was then refactored and improved with the help of Claude Code.

Installation

pip install pro-os-connect-py

Requires Python 3.10 or newer. The device must be reachable on TCP port 2345.

Command-line tool

pro-os-connect-cli --device bofa.local get_telemetry
timestamp=109951839
alarms=0
setpoint=370
flow_rate=9.2
combined_pressure=12.5
pre_pressure=11.1
inlet_pressure=15.4
pump_level=0
real_combined_blockage=0
real_pre_blockage=0
real_inlet_blockage=0
compensated_combined_blockage=0
compensated_pre_blockage=0
is_running=0

Commands

Command Description
get_telemetry All telemetry fields
get_setpoint Current target flow rate
set_setpoint VALUE Set the target flow rate (0–4294967295) and print the new value read back from the device
is_running 1 if the pump is running, 0 otherwise
pump_start Start the pump
pump_stop Stop the pump
get_uptime Device uptime in seconds
get_time Device clock
set_time Set the device clock to this computer's local time
get_software_version Firmware version
get_serial_number Device serial number
get_cpu_serial_number CPU serial number (hex)
get_network_configuration Network configuration
get_protocol_version Pro OS Connect protocol version
echo [--payload TEXT] Check connectivity and measure the round-trip time
reboot Reboot the device

Options

Option Description
--version Library version
-d, --device HOST Hostname or IP address of the device (required)
-j, --json Output JSON instead of text
-p, --precision N Decimal places for telemetry values (default: 1)
-l, --log-level LEVEL Log to stderr at ERROR, WARNING, INFO or DEBUG (DEBUG shows raw packets)

Global options go before the command:

pro-os-connect-cli -d bofa.local --json get_time
{
  "time": "2026-11-09T16:14:04"
}

In JSON mode, commands that return a single value use the command name without its get_/is_ prefix as the key ({"time": ...}, {"running": false}), and commands that perform an action return {"success": true}. Errors are written as {"success": false, "error": "..."}. In text mode, errors go to stderr.

Exit codes

Code Meaning
0 Success
2 Invalid command-line arguments
5 Request error: the connection failed or the device did not respond in time
6 Response error: the response was invalid, could not be decoded, or reported an error status
7 Internal error: the device responded with an unsupported command
8 Other client error
9 Command failed: invalid command, incorrect echo response

Library

from pro_os_connect import ProOSConnect, ProOSConnectError

poc = ProOSConnect("bofa.local")
try:
    telemetry = poc.get_telemetry()
    print(f"Flow rate: {telemetry.flow_rate:.1f}, running: {bool(telemetry.is_running)}")

    setpoint = poc.set_setpoint(300)
    print(f"Setpoint set to {setpoint}")
    poc.pump_start()
except ProOSConnectError as e:
    print(f"Device error: {e}")
finally:
    poc.disconnect()

ProOSConnect(host, port=2345, timeout=2.0, keep_connection=True) connects on the first request and keeps the connection open for later requests until disconnect() is called. If a request fails, the connection is closed and the next request opens a new one.

The device accepts only one connection at a time. With keep_connection=False, the client connects for each request and disconnects right after it, so other clients can connect in between. To send several requests over one connection anyway, use hold_connection():

poc = ProOSConnect("bofa.local", keep_connection=False)
with poc.hold_connection():
    telemetry = poc.get_telemetry()
    clock = poc.get_time()
# Disconnected here

The connection is opened by the first request in the block and closed when the block exits. Blocks can be nested. With keep_connection=True, hold_connection() has no effect.

Methods

Method Returns
get_telemetry() TelemetryFields
get_uptime() int, seconds
is_running() bool
pump_start(), pump_stop() None
get_setpoint() int
set_setpoint(setpoint: int, read_back: bool = True) int | None, the new setpoint as read from the device if read_back=True, or None
get_time() datetime
set_time(date_obj: datetime) None; sent without fractional seconds or time zone
get_software_version() str
get_serial_number() str
get_cpu_serial_number() str, hex
get_network_configuration() dict
get_protocol_version() int
echo(test_payload: bytes | None = None) bool, whether the device sent the payload back unchanged
reboot() None
connect(force=False), disconnect() Manage the connection explicitly
hold_connection() Context manager: keep one connection open for the requests in the block

Errors are raised as exceptions (see below), so methods that only perform an action return None.

TelemetryFields is a dataclass with these fields:

Field Type Notes
timestamp int Device uptime in hundredths of a second
alarms int Alarm flags (bit map)
setpoint int Target flow rate [m³/h]
flow_rate float Actual flow rate [m³/h]
combined_pressure, pre_pressure, inlet_pressure float [Pa]
pump_level int Drive level (0 - 1000)
real_combined_blockage, real_pre_blockage, real_inlet_blockage int [%]
compensated_combined_blockage, compensated_pre_blockage int Blockage of the combined filter/pre-filter after accounting for the expected pressure drop across a new filter [%]
is_running int 1 while the pump is running, 0 when stopped

Errors

Errors communicating with the device derive from ProOSConnectError:

ProOSConnectError
├── ProOSConnectRequestError      sending the request failed
│   ├── ProOSConnectConnectError  connection refused, closed or broken
│   └── ProOSConnectTimeoutError  request not sent or no response within the timeout
├── ProOSConnectResponseError     invalid response, undecodable payload or error status
└── ProOSConnectInternalError     response command not supported by the library

Invalid arguments raise TypeError (wrong type, including bool where an int is expected) or ValueError (out of range, e.g. a negative setpoint) before anything is sent, and leave the connection untouched. They are bugs in the calling code, not device errors, so they don't derive from ProOSConnectError.

Thread safety

The ProOSConnect instance isn't thread-safe: two threads sharing one client could interleave requests on the same socket

Public API

The public API, covered by semantic versioning, is what pro_os_connect exports in __all__: ProOSConnect with the methods and constructor arguments documented above, the exceptions, TelemetryFields, TCP_PORT and __version__. Everything else, including send_request(), the request, response, codecs and common modules, and attributes such as socket, is internal and may change in any release.

Protocol notes

The device's payload checksum is CRC-32/MPEG-2 computed over the data zero-padded to a multiple of 4 bytes, as a 32-bit hardware CRC unit would compute it. A standard CRC-32/MPEG-2 only matches when the length is already a multiple of 4. The device silently ignores requests with any other checksum.

Development

uv sync
uv run pytest

The tests do not need a device: they run against a simulated device on localhost.

License

MIT

Metadata

Release files for pro-os-connect-py 0.9.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pro-os-connect-py 0.9.9
File Size Uploaded Provenance Actions
pro_os_connect_py-0.9.9.tar.gz 16.8 kB With provenance Details for pro_os_connect_py-0.9.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pro-os-connect-py 0.9.9
File Interpreter ABI Platform Actions
pro_os_connect_py-0.9.9-py3-none-any.whl Python 3 none any Details for pro_os_connect_py-0.9.9-py3-none-any.whl

Total release size: 36.3 kB

Release files / pro_os_connect_py-0.9.9.tar.gz

Download URL pro_os_connect_py-0.9.9.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
01887fcf5386be7c9e87dc1dad989d83af20b9952a898e4a4d64f3339029e754
BLAKE2b-256 checksum
How to use checksums
d218da201847b25cf220a26a20c033ad7eb35efff82bc4ba859f9eea1e2f49d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / pro_os_connect_py-0.9.9-py3-none-any.whl

Download URL pro_os_connect_py-0.9.9-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65d2150355397f548529e6d9c8bd7820ae6aba0d4e80544a5fd27d282f018d88
BLAKE2b-256 checksum
How to use checksums
a77284925c588efce7d1357fa79409be659a7403ccc08a454807e9ae43ef6ff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for pro-os-connect-py 0.9.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pro_os_connect_py-0.9.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page