brymenble SDK
⚠️ Unofficial. This is an independent, community-developed project. It is not affiliated with, endorsed by, or sponsored by Brymen Technology Corporation. "Brymen" and the device model names are trademarks of their respective owners.
Open-source Python SDK for Brymen BM78xBT Bluetooth Low Energy wireless multimeters. This is the monorepo for both the SDK itself (src/brymenble/) and
its example apps (examples/): a live-readings console and a raw-protocol
debug tool.
Related projects
The SDK is used by two companion projects in the same family:
- brymenble-overlay — emulates readings from the multimeter as an overlay for OBS (or any browser), driven live by this SDK over BLE.
- brymenble-tc-bridge — re-emits the SDK's parsed readings over a TCP socket so TestController (lygte-info.dk's freeware multi-device test & logging tool) can be used to log the meter.
Platform support
Linux and Windows are supported. macOS randomizes BLE device MAC addresses and behavior is not tested.
Install
From PyPI (recommended):
pip install brymenble
From a source checkout (for development or unreleased changes):
pip install -e . # from the repo root (installs `brymenble` + `bleak`)
Directly from GitHub (no PyPI needed):
pip install git+https://github.com/milksplash/brymenble.git
Layout
The SDK is a pip-installable package that handles the whole protocol:
brymenble.constants— protocol constants and lookup tablesbrymenble.crc— CRC-16 (poly 0xA001) used by the protocolbrymenble.commands— building command packets (auth, etc.)brymenble.parsers— turning raw packets/frames intoInfoPacket,ReadingPacket,RtcTimebrymenble.formatter— converting a parsed reading into a display string ("123.45 V")brymenble.console— shared console output helpers (ts(),status(),reading_line(),state(), and lifecycle/status callbacksretry/paused/lost/reconnected/scanning/using/found/connecting/connected/disconnected) so every consumer prints identicallybrymenble.transport—BrymenbleClient: connect, authenticate, subscribe, stream parsed frames, plus a retry/reconnect policy (ensure_connected), a high-level streaming loop (read_stream) that waits out function-switch pauses and reconnects on a real link drop, and idempotentclose()
Documentation
docs/SDK_DATA_REFERENCE.md— reference of every parsed field the SDK exposes (ReadingPacket,InfoPacket,RtcTime,CommandResponse)
Minimal use
import asyncio
from brymenble import BrymenbleClient, DEFAULT_PASSWORD, find_meters, format_reading
async def main():
meters = await find_meters()
if not meters:
print("No BM78xBT meters found.")
return
mac = meters[0].address
async with BrymenbleClient(mac, DEFAULT_PASSWORD, sync_rtc_on_connect=True) as client:
async for frame in client:
print(frame.info.mac_str, format_reading(frame.readings[0]))
asyncio.run(main())
find_first_meter() is the same discovery wrapped in a retry loop for
long-running apps — it scans until a meter is found (retrying every
retry_interval seconds, calling on_retry(attempt) before each re-scan).
Pass retry_interval=0 for a single-shot scan that returns None when
nothing is found.
Long-running consumers
For apps that must survive the meter powering off (overlays, loggers),
BrymenbleClient.read_stream() is a self-healing loop: a data gap while the
BLE link is up is treated as a function-switch pause and waited out, while a
real link drop is confirmed and transparently reconnected. Optional
on_pause / on_lost / on_reconnected callbacks report lifecycle
changes; retries=None reconnects forever.
async for frame in client.read_stream(retries=None):
print(frame.info.mac_str, format_reading(frame.readings[0]))
One connection per meter. BLE is point-to-point — a BM78xBT accepts a single connection, so a second instance (or any other app) cannot connect while another holds it; it just looks like "out of range". If a connect fails/times out, the error and a one-time warning include a hint to check the meter isn't connected elsewhere. Stop the other app before retrying.
Example apps
-
examples/live.py— a thin program built on the SDK: it connects to a meter and prints its readings as they arrive, using the sharedbrymenble.consolehelpers so the output matches the overlay and the TC bridge. With no MAC given it scans for the first BM78xBT meter it finds.python examples/live.py [MAC] [PASSWORD]
-
examples/debug_stream.py— a debug/test script that dumps the raw protocol stream viaexamples/display.py: the full raw frame hex, the device-info packet, each reading packet, and packet-timing statistics. Use it to inspect exactly what the meter sends (the clean console view above isexamples/live.py).python examples/debug_stream.py [MAC] [PASSWORD]
For on-demand reads and hardware probing, see tools/probe.py (exercises the
command/response layer against a real meter) and tools/capture.py (records
real frames for the test fixtures).
Tests
Offline tests:
.venv\Scripts\python.exe -m pytest
tools/capture.py captures real frames from a meter into
tests/fixtures/captures.json.
License
MIT — see LICENSE.
"Brymen" and the device model names are trademarks of their respective owners; this project is not affiliated with or endorsed by Brymen Technology Corporation.
Metadata
Release files for brymenble 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| brymenble-0.5.3.tar.gz | 40.9 kB | Without provenance | Details for brymenble-0.5.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| brymenble-0.5.3-py3-none-any.whl | Python 3 | none | any | Details for brymenble-0.5.3-py3-none-any.whl |
Total release size: 70.5 kB
Release files / brymenble-0.5.3.tar.gz
| Download URL | brymenble-0.5.3.tar.gz |
|---|---|
| Size | 40.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93ee7e69dce78796387f741ea165acc63a6956035d850232f81348f8ff2d6d60
|
|
BLAKE2b-256 checksum How to use checksums |
704302eb1ee88b7401b1fa4d2b97af65b03ef7d2e7310693bd0e9cad924286e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / brymenble-0.5.3-py3-none-any.whl
| Download URL | brymenble-0.5.3-py3-none-any.whl |
|---|---|
| Size | 29.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
654adc0daaa09e394b0ff1d1ad5d19f3bdfcdd1bba4a5bcdd9587cd521d08027
|
|
BLAKE2b-256 checksum How to use checksums |
0b0c5267c43f785579431f7f8d44de52db4b99f556821d6deb91435c292bd221
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for brymenble 0.5.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.