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

Uploaded CPython 3.13Windows x86-64

openbricks-1.20.0-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.0-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.0-cp312-cp312-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.12Windows x86-64

openbricks-1.20.0-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.0-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.0-cp311-cp311-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.11Windows x86-64

openbricks-1.20.0-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.0-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.0-cp310-cp310-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.10Windows x86-64

openbricks-1.20.0-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.0-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.0-cp39-cp39-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.9Windows x86-64

openbricks-1.20.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: openbricks-1.20.0.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.0.tar.gz
Algorithm Hash digest
SHA256 2cabfdabe8bc878f4e6dc69d0563d9af0d2d170265322eefdcd13ed0d2b47f0a
MD5 9245f148363930ca80f2150c47fca7ff
BLAKE2b-256 799ed74f457626f854bdf840040b55bd29807286636f12f656f7e1a36353e7bb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.0-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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d6c5eafce52033ea2bd8d1d865ad4ab80d80f9f51bc1645741d77bc422ba47bb
MD5 1f302481aaa98fc92c307131d5848c96
BLAKE2b-256 cc05550952ae02401001769d147c12f2e3b275d2259cae4a5a693e0e330338f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 c9d265f1d6e7af8839bef39f52becf36a0bdef5fa0fdbcc99c5fc6ac3140859c
MD5 49893a2d3705c384ef5a6031c60bd528
BLAKE2b-256 0e508ebf42722fb9a74b334080e0a4aa41b70006ce482b0a17279f0d058e5510

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 6647bebfac741a3a9ca522ee761eaafd7f952f436db894e6c96b59d6028c18b5
MD5 489b8887770bee2b20bc05932217502f
BLAKE2b-256 7e5f3e2cddac69917b7434e89e7ccc277ec7347ba46ffa814b6e8226792c5fee

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fb82dfc424d6850f5a9224ac096cd8d7e4e3056460783b35c5bec8cc3740d19a
MD5 426ff03b2e12d2846066f1116fa6bb82
BLAKE2b-256 f22430f3b044d3317eb77b6882f31143e3df8fcb30f6d9b858ab53706750b2e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 dff6abd0cbc5c0a338d7c00cca28252da1e40b0cd66bc4fcf58291f278b0bba1
MD5 23e7a16a7de12b1bab4d53af22b1a553
BLAKE2b-256 9cd18a677c97b16c6c6498b9084c08a19f98c8970b91298a9be4a70589c18bdf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 4981eb7f4a5c1136aabbf2b3fc1e4a3dc2cdc44d94eb871afba9e6413cc93f8f
MD5 33882f990fd57ae7c5ef88e9cacf2a58
BLAKE2b-256 719d95cd853410d1f49db89ce465882e2950703cef7071a59250c9c241b339a7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1aa0fd89b3feac7baadd7a9f7a93c6a869d94b87dbef71333e59cbf81a41dfdd
MD5 6c3b9c81e38732f232ac8a1845937750
BLAKE2b-256 82453443cf36405171715a3c67e37db02f0d2539c069009b749e2e03bc5923a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 e37d491c005a0906291ea33d2965ba3eda6f01982705b113247ee8e426aa9e30
MD5 529e3fedf7ed55d8315ff16181ddbc14
BLAKE2b-256 781385707d286363291c5d25118817fc3fdc16383bf8c7298ef765765e6e98f8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 be3420147f18ebf9f6ba492ca95b4d5a4fe085efe3b0820074c1b2196f8b6b96
MD5 8eb99bdf898ea8fb0507e33e79304f9e
BLAKE2b-256 d5a18a223dc85b21f7666faa02015265c5756c6bb5eeecb5e3e22768f8cfa1e1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 806041e7a0088b687fc1c93395d7ab0dfb4639d53067680cef14ca30b2534b52
MD5 dbf2cd3d5ab1510f5b7d97fa0d7ed657
BLAKE2b-256 59fa049d0021935de4e306beb080a85f5428207af7c51a580ead89a2074b581d

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f6096c9dd257c5d8c14c07be58ebadedef8ec5ce685438a252cd7ae528b58765
MD5 b7a0c170918d631765f205789ad61fa5
BLAKE2b-256 ed424f39b223e658db3bf35e7f08b1f9f2d562b5cd2c8bb540e8d697e5ab072d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fcda6eb2b1eee34c0c792b5aa46b46087fcaf1f1cb0760af85acf0ea4777a1f7
MD5 db33c5af3230b2b335c5960d4f08d5c1
BLAKE2b-256 591a0e303c7f38412591fb9fb355019a93736a37e6bc973e5bc98d6f2deac81c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.0-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.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 900c18bcc1366da1518080a8ff74c4433a7c6685a56ad123103afde5c444cd12
MD5 31ca739169162e417cd7abdb8dc65109
BLAKE2b-256 cd96701f0541fc43145aec2ab1b97cecaa35f2551586d53de83e9a633c2a6f73

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.20.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.20.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.20.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 0d7c80886bfe7ce7a3d233e901f77255544085f5b98100943dc6710fea5f9d07
MD5 0d7f5fc30fafe786afacdf26a6d4f8c0
BLAKE2b-256 ca9289d8b29641e492cc721d25d6e63c6703b5e77883b02d5c383663d920ec97

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 11bad90ecd27d6a15f0354557c3907303568f6eb744ce45a0c5bd547462665bb
MD5 298c3ee429da18558f3c8d51e1dcae75
BLAKE2b-256 ac11e059ead3a1310403ee4d5ef2bb5611185ccf3853dd0630f7313c6b5715cc

See more details on using hashes here.

Provenance

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