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.20.1.tar.gz (17.4 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.20.1-cp313-cp313-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.13Windows x86-64

openbricks-1.20.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

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

openbricks-1.20.1-cp313-cp313-macosx_10_13_universal2.whl (17.3 MB view details)

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

openbricks-1.20.1-cp312-cp312-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.12Windows x86-64

openbricks-1.20.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

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

openbricks-1.20.1-cp312-cp312-macosx_10_13_universal2.whl (17.3 MB view details)

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

openbricks-1.20.1-cp311-cp311-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.11Windows x86-64

openbricks-1.20.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

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

openbricks-1.20.1-cp311-cp311-macosx_10_9_universal2.whl (17.3 MB view details)

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

openbricks-1.20.1-cp310-cp310-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.10Windows x86-64

openbricks-1.20.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

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

openbricks-1.20.1-cp310-cp310-macosx_10_9_universal2.whl (17.3 MB view details)

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

openbricks-1.20.1-cp39-cp39-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.9Windows x86-64

openbricks-1.20.1-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

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

openbricks-1.20.1-cp39-cp39-macosx_10_9_universal2.whl (17.3 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for openbricks-1.20.1.tar.gz
Algorithm Hash digest
SHA256 f2d4e878ce359e82d2879b3966151597f9ab49f645ca8f3248d401257486e751
MD5 0713f904a61e5e50b426a97507e61988
BLAKE2b-256 a47e987efb1bf0eb56052dd6b6f810d88aa56e196fe0c067360902f7a72fd1e2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.20.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d58f742264972598721d3e4333738d1eb1a64a32a087302e4c1bb43238587623
MD5 94d5f62f63edf02a96b4599c9f48dbbe
BLAKE2b-256 00f54051a4bba8f75c30d62f44329b645aee0ea16d4b27e63880172b35fb0d51

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 9b8a9b9adfdc3d6a844fd5e715d5c6b7aa7ebaa2710d058c1b59e7ae9c21b23a
MD5 f5323f9503c132d5647f67fa2f8b9541
BLAKE2b-256 9a428b589be94dcd3f4a89ff84010f93362568ee2bfb777129ca4e9c01707a5f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.1-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 fc5cea967cc13c85d1d4304fd5f7e77658ae5c759d1a9bf86f2dfbb6655fc554
MD5 f698e5cb1968ea2f696f67b55fdae9af
BLAKE2b-256 95303e600a3a1a3b38ca4428d6c81ccf23a4a9a2146cbaedeb128828261728c8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.20.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 efb99f3a3bbbc77f37967a000e695f6d8a3398b5cf6c6ee612f03e7bd338776a
MD5 0d32dab6440f75ada8455c14b934bad5
BLAKE2b-256 fdfc7bb2ab8b25eb00bbfe9feb3e1ba2fedb55a59e3721b2fd8e7c66ea5c5b30

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 08ab275c7c8d804bbef1b4b39e3295fd76dd5aa79211490e26c5e4ae08c893e1
MD5 d880341a5275008c85b518775556e4cf
BLAKE2b-256 d9986f292c29c5b8f041e3afbd45171b427b30e25ad70cc466e4f17965c4eaea

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 543a81a2cab7da1406394ea026ccb441b4b94df295a8fe72a6be543c316fa614
MD5 dc09e6b537e19edc2c5dd655e66da209
BLAKE2b-256 5f96081fccdc2809eb6e7d44b03a8e989daea816a3d57829819b0c2c52b9707b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.20.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f5d24d846b0df91615aa66d4a28acb8d54064fecfd7d1a4086ae591adbca0af1
MD5 e2d59c8d85fbe54007e719987abfea6d
BLAKE2b-256 3b7eb7573d9ff9b46692987d3d0749681162d62e225b746a7765c006de78efdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a3cf8d82ebdca8251ce2db673598e43b9c95b918db2981d25560a3a4c0074628
MD5 2aa8d1512ac751f5225e1cc37d8ed2f5
BLAKE2b-256 448595f1bb3c65d8089f4cc17404e761730019e126055b79c41099862e2fe147

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5e257fb29a67b7a32f86e238efc7236fadbbe142e61e16b9c7b3628fd669a298
MD5 81a9564c6515baa3664423c32cfc2055
BLAKE2b-256 aaa9e119928c0ec89fdabdcb44ab70177f876977bfd407414ea8410327e60006

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.20.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ada25ab827ba0ad5d40835baa0609e00190257c2bce52b90a5333b003f668ba2
MD5 152bfe277f03c78ec7eda76757dc5547
BLAKE2b-256 d359f22efaba7cf620cff5feb6e2ded78523ae072645bc23f211b45e0bf09c3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 6733b3c747a1baebc968a6d4a8d8de79aa3284a9486dc1f7caf749d2576cb7b4
MD5 b6d08400ac3854fe6e45ffdbaf96d6fa
BLAKE2b-256 9397c81509ef4a4da096edda1829e103d7bfb1d116ca5137dfc9ffcd3e63d624

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2d320324753031ccfe405327d292a517adb4ba6f7c3f74062ace8381997e4da1
MD5 77ef0c8cb21688fc3a4e687a5a7af655
BLAKE2b-256 b38e3c7858f44c168a0c211ae3ea5fbf4819df7934e2817d8b6758ef5f08ef91

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for openbricks-1.20.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bf054ee0b420201894dc2c42a7df8190d0c14c172b508772f57e0382d4cc8730
MD5 adcbb6e3c42a79f99f6a0d1fea6abb8a
BLAKE2b-256 a01f283a2be9426f67a8659126d432bfa7277a0d9eae135f9a9250ab70a1d3cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.1-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 9b2d252fa66c7abc00aef8011d39354e97b4364ecef6d38dfd748f2107de533d
MD5 96b0355fb1669236b63d7adb4c2d7aba
BLAKE2b-256 d14b7cc05678e91ab77b2a979a32e3e10a40b4042ce2628de71ea9738c2d0b36

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5533044c1b2270f9578f16f6521649bbecf66477de5f68aa9d4c965deca8111b
MD5 d21dc5edd154f5c7ea6b2ebe84799014
BLAKE2b-256 78f57e870d7bca4d6a6e012d01125f70ee29cd648d4386ea3a84cf793ab1cac5

See more details on using hashes here.

Provenance

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