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

Uploaded CPython 3.13Windows x86-64

openbricks-1.22.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.22.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.22.1-cp312-cp312-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.12Windows x86-64

openbricks-1.22.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.22.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.22.1-cp311-cp311-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.11Windows x86-64

openbricks-1.22.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.22.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.22.1-cp310-cp310-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.10Windows x86-64

openbricks-1.22.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.22.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.22.1-cp39-cp39-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.9Windows x86-64

openbricks-1.22.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.22.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.22.1.tar.gz.

File metadata

  • Download URL: openbricks-1.22.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.22.1.tar.gz
Algorithm Hash digest
SHA256 b1e23bb5af94ff71479b398d8d9c6b4d0b2149ee3af31efc1df701e455c3e88d
MD5 1b2afb39bc26a0a95819416428a22c33
BLAKE2b-256 3108517767bc9b2cc2b2f070995c1a99a250522f3d3cc24cdb1a6b05d63dd1fe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 76b94bd04042c054921b1380ef547fa21569a6f1b5054b91d1ca63c6516e2980
MD5 44b4160bbb7472a28fc7371508962cd6
BLAKE2b-256 418910086865151f1ce8475150d1ab9f456caa62fc7207db83a3110b756b0384

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 b876d2453ab3c4097c038f027995311b22ed30497c027bd29b6f075fdbf069f2
MD5 bc17a0b4110e962891e2eeb51c06f880
BLAKE2b-256 a211f49ac095b58a09e22b5df018c5292fd53562e0e5cd4cbd379fdcf2f28870

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.1-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 5bffd5d60cdc9b75f4b5c8b02c94856f646c430d89a593ab763b627efffe14d1
MD5 0b56de066cef00da0cedb1420361ce66
BLAKE2b-256 4df7e44c0b49470643c52fb78080f7cf981c39d576f8907e8985bb3c84fcbf15

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7abd7f8e2b93864faa6fb3812ca9c8897b1b5469b91903d82e7b9e12fd35d3e4
MD5 eef526068206e31f9f2492f4c8afa0ea
BLAKE2b-256 35b3729b84085c98f5b88249e5841f41b849e617924306e21d13ddc6672d5df0

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 bc39a8401b8828897d14489599ba4089adbea737fca7919911137227930a3e3e
MD5 29ba5be0d3969ad568efcf2763fce773
BLAKE2b-256 e056372e5608c14a357730a13c740d4c5576ab10d046d650d84526f00c4099e4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 1a4832ad75e68fb608e5a9c330e79456766ddd360cdfb9638ba4f8876df80922
MD5 d75797140f5f8d9b996f37a5f15a8a3c
BLAKE2b-256 c9d90de77a3cc2363edc74808b8504be22be1980316368415dd56a0d131fc4d9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f9bd72be799da3667e9473da8b8239398e4a6e17b0fe827cd62b26feefed2fbe
MD5 0ba134bf3fa7e5e6d86102e295ee52a1
BLAKE2b-256 ed61c19ff62e391067d4ecf86e63159009574608e96373d7a0f7879415caf2da

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 6bd9aaa543915bb01bf578bf8d3fbe833ef01edb48744e6b7b643cef7ebde3d9
MD5 ba44590d560dd6c8236017ecdd1e6a88
BLAKE2b-256 aed1efb21b66bddd4735fb28d92801e72c6f16cde9e9c6b21e065a0064053bd9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b8db0ffe4303de028ab6c788e1bd424fa95c44973f7444c11b9d14392db201f9
MD5 7597def5c7ab691a82a85710f25c3afd
BLAKE2b-256 0f268a7c4743b1affb50b5ec6604b2f91bf0525d8a9eddf7721e037caa27d7b5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2860cceadaf79cde5c5b7bd3070f625c07b7cc23b77552354db9c3131c3c0463
MD5 dc2e7f7dbc4c20f3f8c2d99853acd650
BLAKE2b-256 a807b3e876486cd34f243bc0c6ee02136274505408fe4ce5d1542e2995aa7197

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 10aa9813a0f42caa46638c62dd561ac776eaf9a76590b3524219b0037170846e
MD5 798719aeaf09a3323a24071f7f30cf48
BLAKE2b-256 bea1349158692a4e7e1740eac4c76d14724957a16ee042bf531187af71546899

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a54ca02a76287b31b38f48c468d8a3d1cb81bfe2126c90f9c2b8b5ddfdfca4ad
MD5 ecb039d3b6dfd81bca06bf4c5eb2c30c
BLAKE2b-256 0e2af2cbf7cff49993ca7ff85cb28bf22ceae7e3f8169a03a401f727e006324e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.22.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.22.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 fa0d62648b375c84a39aaba5b47a826053daf9a894397062423ecf7b8c6f13ed
MD5 677961b498437a62f25c6ad218d74b5b
BLAKE2b-256 934af575f23d6d380a0f07735c349d9d0caa638e39b24b0e1b6d7afc8e73505d

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.1-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 13880e2af4f77f6b78506db7ab6ab1acfc4aa3d701de948b358234b7cccf63d6
MD5 385c52ba2c9c4f2da7950619c1f70c83
BLAKE2b-256 f8d83d3f7ba604a04331693cf2c869704bf33ed56da495345a80faecf6087e27

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 119a0c612356a00956a5c8245b055777a1cc4d039c76954f7cf520d081793c0a
MD5 0a6b1e44e35488aece11a55a93215563
BLAKE2b-256 4392814ad29e7b1797570f6685fe51f4dc24657c00a329bfab7d7d20013f5bbd

See more details on using hashes here.

Provenance

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