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

Uploaded CPython 3.13Windows x86-64

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

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

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

Uploaded CPython 3.12Windows x86-64

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

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

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

Uploaded CPython 3.11Windows x86-64

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

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

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

Uploaded CPython 3.10Windows x86-64

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

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

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

Uploaded CPython 3.9Windows x86-64

openbricks-1.23.1-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.23.1-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.23.1.tar.gz.

File metadata

  • Download URL: openbricks-1.23.1.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.23.1.tar.gz
Algorithm Hash digest
SHA256 0c632e3e43ae2663dc4055848c46fb50d356ac52e0474c05c3f451a56fcb660e
MD5 f9c014628b7d520adc39c746061c9df3
BLAKE2b-256 6a6c43e2d86cba51dcb8a8e368e9490db8422e51304ad941915a475062650a4f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4d02887497db984187b4d90b3cd92e495268df50d58221f6630ea776afaabc75
MD5 b2b10ce60363ffeb235adda8e75684de
BLAKE2b-256 e990f0a99558c49433ba57b73750b47fa829eab51d53bbc17bae038d30afa259

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 bd188c046368bf35e08d3caf052c94bbedc7761d7f99f6dadcfd1837dc518a04
MD5 19c66f27717fa4f1a1823e7c673a4849
BLAKE2b-256 7d98eedc5909f01bac5aea71cd93d9013390daf7468c2bd05204c78c72322c00

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 98fb940c28a9fadaee53423f3a64ddd270cb26189f1e8762bb7218c4e67405e9
MD5 efe28d2db01967cef4455a99b7fb837e
BLAKE2b-256 95bc28ef9818874700de234cb965e7c0d7a827af36c5ff98897e92b69d511e38

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 921eb0b4e301ad6da685ccd0fc911e42ba630916ff042e663a8c25da1921bbb7
MD5 b4117b6b13964c13c60c59af401839c7
BLAKE2b-256 5cc0361a9f2d27a417853a808501e56e53aa8475982b94bc7286b69b8b92c7fe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 4ca8a7bd88a9f977b2f3a7f502bc750a5723f4878e5c09485b92792633e87095
MD5 e4c16545865066258025a6830099c1ef
BLAKE2b-256 4c1a37e3d74fb87c9771908bd4b310cd2ed56b1f22d966f6c8ad399201ba234b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 f7a0433e61ec43beb48ff8ce940fbdfdae5214e879ef5f307fc124135a602056
MD5 455dcd2b1d3961b891571dbf3d2e4b51
BLAKE2b-256 1339289711c21141e66c23d44d3513e97ee00639f2529c0f819db5f5dabc409a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bbf5b203dd4fcaddeba0f3fafd89b1f8e157222a169d1377952bf1666bae9014
MD5 c3f6178baf075db2c61b65efca40762e
BLAKE2b-256 da0ca6c48cdfdbbaf45ad3666316d3f5ca98ebed606142bc0a1152485e52d219

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 ccaa81d2d566223bd8690d00fe982e1dccd9c7f7bb5aef40e26f9e50ed61b979
MD5 8640f94cc4b7bb3e19f80e7b8ed2442e
BLAKE2b-256 c005f2ab07df16c7387a47ee04f967dffa09446ae0baf4d71c843222e319dabb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e770406bd08dc7b061ea4bdf4ce17946a5357373d8b011713aa06ed248ead5d7
MD5 46c02b352a5bf99b2a367af62b326bc3
BLAKE2b-256 124d89f322b15c9a3127dcbcf1a7a52f8b4984369bb89121729c3015b8cf5c51

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4d44cc464cfe52be75e38d1e8a13394dada905d103e266fddfb9b4c26c14bcdc
MD5 9a70fc51c96efb3f1599dbafe02c2c8b
BLAKE2b-256 6e612a1076d31c67d9e9a99712d50e3a6594071f5c474f2e22c5f61f55508a30

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 7ab1d664f29301eee4bcbdb877edbd20704c8b8dfb693b35ea569b547c2f9948
MD5 634fa7bda9d7a144e93a8c8ecfb1382d
BLAKE2b-256 991c84441b6b5aa81e881909584935493e163b5fd134a9abd5ff41c2e0dc7c9e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c21d1ffe4d447d771574f43ea0aec70d7227692cc24039fd7759d39028b46bc8
MD5 d4660ef9fc6e1c8657ddccd41ab6494f
BLAKE2b-256 f17ed76db386afe4755b06affc0fd25ad1967a5aaa84908ad4e7c6831a16423a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.23.1-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.23.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 345c023e2cd408749b7719199eaf3856e44e82bb2e7f1d9adc70aaadf82aefe2
MD5 16e4b2dfeeb188c773cdbf4d7b80b16d
BLAKE2b-256 93e8932f4232914ba505107dff032a50a6fb84fab25ac937b256bf380799a16e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 6cf3e448db6d8ff18c39e6c570478a06b7ad57f949771f77a9ceb0447660f4e6
MD5 c7c262456920a744769017d1766f6e89
BLAKE2b-256 24e20f51b5358453eb751507ea8af90c714e3956d5d7ed8f4c7e5f8124b20d6b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 aacaabc538bdd8357375a3eaf4bdcae4df937679026d9c005c8c1e1ef68ab365
MD5 94379dd20c5dce76e2c6531962ceecd0
BLAKE2b-256 01d77065a591391c8353fbbbab9272a98108343e37b893485c32dffb7ba0e80a

See more details on using hashes here.

Provenance

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