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

Uploaded CPython 3.13Windows x86-64

openbricks-1.25.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.25.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.25.0-cp312-cp312-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.12Windows x86-64

openbricks-1.25.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.25.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.25.0-cp311-cp311-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.11Windows x86-64

openbricks-1.25.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.25.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.25.0-cp310-cp310-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.10Windows x86-64

openbricks-1.25.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.25.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.25.0-cp39-cp39-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.9Windows x86-64

openbricks-1.25.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.25.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.25.0.tar.gz.

File metadata

  • Download URL: openbricks-1.25.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.25.0.tar.gz
Algorithm Hash digest
SHA256 d4e391e5728e4394a03cd9c58cb89d8709a55573b90e27399bd921f0226d4eab
MD5 fbf72c41672e4b48f8559220144b075f
BLAKE2b-256 22d1b75a8454c6abf4fc8c0dea94ff027fd8a9a60945884566402f188ea3adc7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.25.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 954ccfa8ebbc8d65ad8783c83e424c4f8fafcf74bc62cb4d0f84f761e93d540f
MD5 0d40e1d5814a58067b89a0cffa743ed7
BLAKE2b-256 1ac8d77f08663ddf694bf3a98f62044a90fa95b93a2a054fc2c817df1b36799f

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.25.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.25.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.25.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 ebcd07c8dafe9342ff0fee760ba8cdba2e4a3a98083240412deae61dda9278e7
MD5 9992c1cc3f892d2f17cff67095a5ef81
BLAKE2b-256 3f4a647810fecde205af1d92e8687efc1286c1deab089872b61c73f22fff1019

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.25.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 e0e168c5b3b94c9bcb6ca7d702f250e7e0575374d442a878c38e5e4b2bcd8275
MD5 6f1a2a1db4ba48dd49cf6f18fa5b97a9
BLAKE2b-256 42a445398b8aa56c88d82b1e4503b42c154a10e2c233f1678314c0c62191d84a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.25.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8816919d3eb517d30aa40eaf0cdf0708fc2c7fcf30ec644dd5df0e5f2cbc5844
MD5 8865b12b7cb92bde7832b05032fa9efe
BLAKE2b-256 24a7a21f571b704f483a4d477b1d3b6d1fbe8163670bd542e61485d32d6a19f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.25.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.25.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.25.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 c3d011d70451c4741efe83fcc1cfecbe93f2d7d3cbda52f4047d516b49c7c66a
MD5 7ed4f2ca40c1f9c4218c2bd26ad94ece
BLAKE2b-256 d2fe4de2440b664351226d36f05d268a892b241293e045b48c28c1e5da33200a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.25.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 fcbd1136ffc28899abf1dacc7241422dde180f5613ac8133b491c0a0919f2566
MD5 5fb720bf6bba5c661f9acfe6a5f12133
BLAKE2b-256 4dddae9ec237f69e148fd6f07b1a94574b9d5f0d73ac226a9d275723b46442a8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.25.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 344e1399a619eee3c958cbdf468904d939581389fb69d072f553618fe65562af
MD5 ff33578da6a7d908a3d5ce65c722b883
BLAKE2b-256 757dcff675e0ffcb82de297ef5f3e179de47b4e903f22569ed45cc92e6a59f32

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.25.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.25.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.25.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 331e2fd74b97e90c47a90129a73360291d1565de286253e0b9cbc15deecd457c
MD5 43e3f529eb2f58cbeb769b1b37c6c822
BLAKE2b-256 fed0880f7f609eb7efb17350ff61552144d8733b40fa1a902919ca344f0baf68

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.25.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 995b91897bf47efa368c79237eb5995ba0007e4cbb4108903f2b10dd91a38b03
MD5 4846b9d8aa3547d864e69aa36e37170e
BLAKE2b-256 e76152bc993a9e063c59b37b44a8cd9fef25d013c74ec3bd58ffab2906bf82e7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.25.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9df738cdc2df04aa09e715e5d1536c958740d532d31f7024af55905cf0a850de
MD5 530934d88275b1267838cff319ec9880
BLAKE2b-256 24da2b929f9ce7f9ab2851f54f9a5475272ad86274adbf462347517f5f215731

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.25.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.25.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.25.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 fcc17745c77ddfcdf47d11f3568d46f25172503c9024f19cc0314cb03c315fe3
MD5 cbedd204026f0eb93bca32a783008fd0
BLAKE2b-256 94814a909b004eb864f21ed94bfb2ef4875d1a023f6a8abc445d2b558de9ce5d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.25.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1babd81d99505e84c073bb05d4730e21e54c95d8877d53ba14a8e569c015163c
MD5 043d059d03bb9daf746201a7cf83d780
BLAKE2b-256 420f192d16daefdfbc02fd182395008c6c479f39cf0f0d62587209c682e47023

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.25.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.25.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 986ff51453403179a4a4bbf64529c1d59ee876818c2fec989cbcd7c8db508db9
MD5 130c700f4fca3c3d8d1783093ba9a298
BLAKE2b-256 11a326fc1a92ec6b7c337a4715d0cddc6dcb63cc17df0133b174d3fe3b033418

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.25.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.25.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.25.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 dc9225f6a50494206a41463bc9e1a69fa025d7a8da8ce3c8fab168ea69e555db
MD5 c177094b748cbb47371a90802c31e155
BLAKE2b-256 1b0774ab62396684692a5de6975ddb0529c0a9e03247f3ce27a6186a61cf4185

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.25.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7010566cadc1daa48d8ae24c2b473e3c9d249edd3827006b5aab3aea94ea83d7
MD5 3e013175355d21118b60b1839a4a94b4
BLAKE2b-256 45225004bba46b55489ed86df6a92207926c5ced0ce387d22b304d4336bd660a

See more details on using hashes here.

Provenance

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