Skip to main content

openbricks — host-side CLI + MuJoCo-backed simulator for the openbricks MicroPython firmware. Flash, list, run, upload, log; ``openbricks sim`` for the physics simulator.

Project description

openbricks (host CLI + sim)

Host-side tooling for openbricks hubs — same UX as pybricksdev, built on commodity Python tooling (bleak, esptool, mpremote). One package, one console script: openbricks flash / list / run / upload / stop / log. The MuJoCo-backed simulator is built in too — openbricks sim … opens the sim's CLI when the [sim] extra is installed.

Website: https://openbricks.dev · Documentation: https://docs.openbricks.dev

Install

Recommended — with pipx so the CLI lands in an isolated venv and avoids the "externally managed environment" error on modern macOS / Linux distros:

pipx install openbricks            # CLI only (lightweight; bleak / esptool / mpremote)
pipx install 'openbricks[sim]'     # CLI + MuJoCo physics simulator

Plain pip works too:

pip install openbricks
pip install 'openbricks[sim]'

For development against a repo checkout (editable install):

pip install -e 'tools/openbricks[sim]'

[sim] adds mujoco (~50 MB, native OpenGL) and numpy — most users (flash + run + log) don't need it. Without [sim], openbricks sim … prints a helpful "pip install openbricks[sim]" hint instead of crashing.

Note: binary wheels (manylinux, macOS universal2, Windows AMD64; CPython 3.9–3.13) ship on PyPI since 0.10.3, so installs are toolchain-free on common platforms. On anything outside that matrix, pip falls back to the sdist and compiles the bundled native extension (openbricks_sim._native), which needs a C compiler + Python headers.

Commands

flash — program a hub

openbricks flash \
    --name RobotA \
    --port /dev/tty.usbserial-XXXX \
    --firmware native/micropython/ports/esp32/build-openbricks_esp32s3/firmware.bin

Writes the firmware image and bakes the hub's BLE advertising name into NVS. --name is mandatory: two hubs with the same name can't be individually addressed over BLE.

Port syntax: /dev/ttyUSB0 (Linux), /dev/cu.usbserial-* (macOS), COM5 (Windows).

Useful flags: --chip esp32s3, --baud 921600, --skip-erase (faster dev loop, keeps stale NVS).

list — scan for hubs

openbricks list [--timeout 5.0] [--all]

Runs a BLE scan and prints every named device found, sorted by RSSI (strongest first). --all includes unnamed devices too.

run — stage and launch; button stops it; client exits on stop

openbricks run -n RobotA examples/hello.py

Stages the script to /program.py (same target as upload) and triggers the hub's launcher to execute it immediately. Output streams back to your terminal in real time.

  • Button stop. Pressing the hub button while the program runs raises KeyboardInterrupt via the same launcher path upload+button uses. The client sees the clean "stopped by button press" line and exits.
  • Program completion. When the program finishes (or raises), the client disconnects and exits — same as pybricksdev run.
  • Script persists. Because run stages to /program.py, the hub can re-run the last program via a button press without another upload. upload and run differ only in whether the client auto-launches after upload.

Stderr (e.g. exception tracebacks) arrives after stdout and is surfaced with a blank-line separator. No paste-mode === echo — raw-paste mode is clean.

stop — interrupt the running program

openbricks stop -n RobotA

Sends a single Ctrl-C byte over the NUS REPL bridge, which MicroPython surfaces as KeyboardInterrupt. Useful when openbricks run has already exited but the hub's still chewing on a long-running user program.

upload — stage a script; hub button launches it

openbricks upload -n RobotA examples/wander.py

Writes the script to /program.py on the hub. The code does not run automatically. Place your robot, press the program button (GPIO 4), and the program starts. Press again to stop it mid-run.

(Pybricks calls this same operation download from the hub's "download to me" perspective. We name by direction-of-data-travel — bytes flow up to the hub, hence upload.)

This works because the firmware ships a frozen main.py that:

  1. Brings BLE + REPL bridge up immediately (so openbricks run / upload / stop are always reachable, even when no program is running).
  2. Instantiates the board's Hub, which wires the BLE-toggle button (short-press on GPIO 5) with LED feedback.
  3. Watches the program button (GPIO 4) via openbricks.launcher.run() — a short-press runs /program.py, a second short-press raises KeyboardInterrupt in the running program.

Two separate pins (4 for program, 5 for BLE toggle), each handled by short-press only — no duration-based dispatch.

Pass --path /alt.py to stage at a different filename (if you've written your own main.py that reads from there).

Tests

cd tools/openbricks
PYTHONPATH=. python -m unittest discover -s tests -t .

No real hardware needed — esptool, mpremote, and bleak are mocked.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openbricks-1.22.2.tar.gz (3.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

openbricks-1.22.2-cp313-cp313-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.13Windows x86-64

openbricks-1.22.2-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.22.2-cp313-cp313-macosx_10_13_universal2.whl (3.2 MB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

openbricks-1.22.2-cp312-cp312-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.12Windows x86-64

openbricks-1.22.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.22.2-cp312-cp312-macosx_10_13_universal2.whl (3.2 MB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

openbricks-1.22.2-cp311-cp311-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.11Windows x86-64

openbricks-1.22.2-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.22.2-cp311-cp311-macosx_10_9_universal2.whl (3.2 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

openbricks-1.22.2-cp310-cp310-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.10Windows x86-64

openbricks-1.22.2-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.22.2-cp310-cp310-macosx_10_9_universal2.whl (3.2 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

openbricks-1.22.2-cp39-cp39-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.9Windows x86-64

openbricks-1.22.2-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.22.2-cp39-cp39-macosx_10_9_universal2.whl (3.2 MB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file openbricks-1.22.2.tar.gz.

File metadata

  • Download URL: openbricks-1.22.2.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for openbricks-1.22.2.tar.gz
Algorithm Hash digest
SHA256 59f6f79e019f57a4b3de3a06e8e0861febf6e6e08eaea1ba3fb40dd60535d964
MD5 aa49e0dd4c019649ea2007613cec2b8e
BLAKE2b-256 057e9eca555753f75a1872947099e5fdc8f6720365fe0a483bc9bce8a0bd231f

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2.tar.gz:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 94c7c7cb617de065df7c6b6c43ecfebea19167dd36c447c02f7b7b7372582a36
MD5 2d4ef2d6a9f0b955c6c99056e1112ccd
BLAKE2b-256 ca400d017e4400c687bd7ac567970458e96aa06f22bef4857fce21b51d149943

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp313-cp313-win_amd64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 31dabd85a5444a7fd2fba7a784f0455e4239f01882e0dd33ecd555ffda5876bd
MD5 93bb7c5ef5127a2f738e962055065dfb
BLAKE2b-256 9c8628b3a9158ac0e251b54bb88e9ef9477dccf55a1b7ff7fc2b3f27702bfef5

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 735d0de641e89d90ee1a355a406da61056545fe2e2a9300a16ff5062cc45559f
MD5 ddf861959c994e80499ba74c59a20cfd
BLAKE2b-256 5082a96a248745973a1ca1a0c44949d9054f5c68d4ea78331a2cd4162938275a

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp313-cp313-macosx_10_13_universal2.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a3bc6550d11668b3a22b14f7e2f461bba6090f8320e4683c29097a5a3c5edc3d
MD5 74852e94d37429d190bf75c9fcba440d
BLAKE2b-256 b15107b6a48f7e1dd78ec73b3d797ea6da690f350d31f6d7ea9903422d8f405c

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp312-cp312-win_amd64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 718f11086cebb44ff0cee3b38f157385b005fc10a540231b3dbdc4e67655862e
MD5 3473c89b458efbfe8593e924da1effb1
BLAKE2b-256 58438fd38dd742849024e21d5277e8f7097242850c857982782036645f611ccd

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 c0ebe23df6e826efd28fc0b1cbefdc0abe8f980ab39a6518fc2c203464bff13e
MD5 61d5e63a5753db6afa0faad5805af580
BLAKE2b-256 2a761816926742c08cb14ac3e6f2cd2dbab8d7ce9a87369bc2da447ac5baa264

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp312-cp312-macosx_10_13_universal2.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 50c4982e302df10c5fa7f1bcf241d6c4f714dd9232d3ab45bfec0fddaa757ce9
MD5 34ae8e14bbf861528609cba287b54cd1
BLAKE2b-256 d3297988c856f8465d4496c99b13ec1fe4f8cb812036530205491b7244707ab4

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp311-cp311-win_amd64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 37f90367886dcf7efa29e985846c6fa1d554c704a326521ca17929a31113cabb
MD5 a251ed2c91fa344b81239460c2d8f72c
BLAKE2b-256 3c0ea25246c01ef9494832faae8f0cc77d4a1c854a5bcbea483e20ed611ad857

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9c61de93992d903db570c9c540c3afc8ff3e5ae9052e4f5c5aa3cdf55fce619d
MD5 3e2464695cf8e7a84de8632144e5164d
BLAKE2b-256 7a1dc2ee2f1097a39d626907ee390b94eab1e8f97947f10b1103677bc240bfaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp311-cp311-macosx_10_9_universal2.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 82de3543e0e85c3589b51b1ab47793827f12a9b8d6605c5f03e53bf821f3d48a
MD5 bcf076425348ac7e16aa71764edcaf81
BLAKE2b-256 2ee7bccb67c403ae36846316e23859eb9885e1565fb4c85062331c8bf6a8bda4

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp310-cp310-win_amd64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 bee73ffcc66e86783b417977b8a471cac9aaf38624567bfd909da8d180b0de8e
MD5 a5b551ef8492d12459f971ff76a7f52c
BLAKE2b-256 130e50d6794c3f1bd604130ec0617f418a1720bda0b63bcb1ed1adec4c12f5bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4f5ef603814f74d32c9ed91f1af57d277f3c3f60241545d48605753e3d79524d
MD5 8a3ef692d9c380de4fc6e559d700e448
BLAKE2b-256 9059ff251c76aba4f4be0f17cd81af14e617e2675983ca96e96bbc76294be3e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp310-cp310-macosx_10_9_universal2.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: openbricks-1.22.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for openbricks-1.22.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a30453fb0805da7b1d71b18655b1f38a9284df8d901fd1f8662a99ccc88e4742
MD5 9f728fae9a7278d5029dfefeb0519bfe
BLAKE2b-256 0b275ce7418f6986a5e70d71b058b1253365f4d4801e05861b1065c1ea085287

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp39-cp39-win_amd64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f030ef59deecfaca6c31294968a9de8c04b78ce7d895897bbeb715824a0f0baf
MD5 79dc6f10787a2a79604b4d42c42f961a
BLAKE2b-256 be57ae573e32947ccc400f9f86cc6a140ba5b80797d9ee0e0c6f01a87abcd2fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbricks-1.22.2-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.22.2-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d409ae11e157ea2edacd5ebc9f41846ada7730ebf6ab8338f8c4a7303f8c020d
MD5 232cf7d13199087ab6bd0be69d0b39de
BLAKE2b-256 6e7125331b8513c177877794faf6e3b8cdef705b00965dd3f3b61266df2b39a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.2-cp39-cp39-macosx_10_9_universal2.whl:

Publisher: ci.yaml on 1e0ng/openbricks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page