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.24.0.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.24.0-cp313-cp313-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.13Windows x86-64

openbricks-1.24.0-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.24.0-cp313-cp313-macosx_10_13_universal2.whl (3.2 MB view details)

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

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

Uploaded CPython 3.12Windows x86-64

openbricks-1.24.0-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.24.0-cp312-cp312-macosx_10_13_universal2.whl (3.2 MB view details)

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

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

Uploaded CPython 3.11Windows x86-64

openbricks-1.24.0-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.24.0-cp311-cp311-macosx_10_9_universal2.whl (3.2 MB view details)

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

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

Uploaded CPython 3.10Windows x86-64

openbricks-1.24.0-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.24.0-cp310-cp310-macosx_10_9_universal2.whl (3.2 MB view details)

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

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

Uploaded CPython 3.9Windows x86-64

openbricks-1.24.0-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.24.0-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.24.0.tar.gz.

File metadata

  • Download URL: openbricks-1.24.0.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.24.0.tar.gz
Algorithm Hash digest
SHA256 80fb83adefd5e14ec226a65e95d023ba97a3f8848f8e96d92541a5928821c4c8
MD5 136c43f659f5c4357c9266cdc2416d69
BLAKE2b-256 54b7372846a30a6953838b9077bac94456c522611fe054cb7aecb9ef6acd6a78

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0.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.24.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5397b23e1f3c93aa115ae6cc4e997cc49605aad4ef74cf29318ba05b690b02de
MD5 c4cab2d0aaad2b79d96c6994fc7f381f
BLAKE2b-256 984b18b8fcf30741306eb4c3f6c1b61bd659b56a728a6fca7b19b878b517f05d

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 de9b43c545fdb488ebde2d4f6f37d94bab1c307b4796f04bd2ad6697efd395ac
MD5 7cb4236bde933d7d358edf941c58def2
BLAKE2b-256 7c13d3641515b12f0925c9164f42782ea16641cc2c6da1436b66e1861a3886d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 500bf3f2a2b7540549d30c7640c5970cb50b30ef2c0095ae34e8d88b4dbba0a1
MD5 aaf5e721ce6d7de6d0fb6e399f7cbb2e
BLAKE2b-256 0fc4823b92c259ebb68e3dfc1c3a5338dd4c94fdeb6c579429d80d51d682c5c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 74cad4db17a24380303c4aeb188b0d073a65fdb9d87b12935d75850efa56df6b
MD5 0b1cba7a08792110d36d92fb484888e1
BLAKE2b-256 a67d93f1949c625f7ffaaf4ff53d975fd85ea1029921b2d107e89e81b28c6896

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 69c5b4e0f7bdaa5518adbf5c7f9e90e2bbbf82fdfbb55a94365479c434f6ee09
MD5 3ad5cc8d8ec894343a39bc8078d13494
BLAKE2b-256 c0abb938af9fbe51879d660ec6bd056c7c7a43e29758fff32d484326bf0a4758

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 c8ab8a11cc1eb1d44751fe6e1b63523831d5d4aa5626b01e0030c335834297ab
MD5 a04b7c6dd84e95a6af3c8aaed2d30827
BLAKE2b-256 d2f5698bb0e57ca7261f3e2c9b6ead9f4e8fcb89ed42aae8eaf0dca9b3ec4154

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3be6f3f9535d416fe92d170a426b503f508f45c924cb09f40bb40e6a1b913c02
MD5 dd4654f1df0c4eed73f911c286caba42
BLAKE2b-256 a50ed1177ead4e6f3ae2b77d5aeec43fdaae48319ec8e2412e86c2eb1d999aa0

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 7ce35893530981a9d81cd3643ddb8e9a35f2756d855a0b22f1ba03e5a0d07c9e
MD5 ec33520ec251ecf781a884c81688d3d1
BLAKE2b-256 88c430992d54999a8f5d76c305fff7606a78139fdfb774980c739b85a2f4f79c

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0ee032edba89e28665a9fd409f5d60e7e0040d486203f958fcd47d1f14902abb
MD5 c245ac465470781de16c755f4b8e5277
BLAKE2b-256 b1275d1fb9d0c4ef065f8f08fc07b3d5c4bdfd6f723e107257eb321fc983c803

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cca8c7e1dfe2b4e75d82bbb1411546d82af8fd998a785df04d7d7a529f039c57
MD5 f0c33239d14b517ee9eb2529f7d4bb7a
BLAKE2b-256 4d09583b1a8ec6e137a5e3609fd5a58fd95b0624625cf81df8bf648f5e8f34b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 d27fb0c553fdd79e97fc66357828f7117162ab1ecc3d3a09d63226acee684609
MD5 8a77665dc127be7c03d0c9f6a4b7df35
BLAKE2b-256 14f3f2d48d94dd9705a8110f1b561f00298f553b2492606a4dfd61c22da6d477

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a16bc079715e20f6bbc1233814ada52bcb57c2d68a40b84385812404780a79c7
MD5 e75f23d7a8e574c2baa32e0ce86c3093
BLAKE2b-256 196e258d9249f64a7f6d3be19d9bf0c1ed1197eb274bb47b86a33e5c56c854b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: openbricks-1.24.0-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.24.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 41b6dc853d7c3673f7ed4f642624579f6f9120ff870bcea59231a73b404852f5
MD5 1c93aad1404a5fdf809b3e93b5c3ac28
BLAKE2b-256 066726eccf8311f200defba1b77ac46c8f7881ba884988a0c7860be3d5809399

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 7ebd12a1f722d7f31a5be91324f79503dba7e5a2332a6b23573428240d143416
MD5 dc8fe1a68fae234fa7405b9615cbece7
BLAKE2b-256 5cf58638e2377c728363860ddfc2b6aee4140d7c07e3a3fe694c2024db158d0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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.24.0-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for openbricks-1.24.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 dda8e72e47d860ae8491dc7f15ae6546ba00539b02c35b2fc8d4b3fae735093b
MD5 95d690aab7ad65220c40eb3fd54260ff
BLAKE2b-256 a35b6bcaf4f0795d60792e63bd8968ab5c6b16988f9fbdcf19f78b04cc7a236a

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.24.0-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