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

Uploaded CPython 3.13Windows x86-64

openbricks-1.21.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.21.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.21.1-cp312-cp312-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.12Windows x86-64

openbricks-1.21.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.21.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.21.1-cp311-cp311-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.11Windows x86-64

openbricks-1.21.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.21.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.21.1-cp310-cp310-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.10Windows x86-64

openbricks-1.21.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.21.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.21.1-cp39-cp39-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.9Windows x86-64

openbricks-1.21.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.21.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.21.1.tar.gz.

File metadata

  • Download URL: openbricks-1.21.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.21.1.tar.gz
Algorithm Hash digest
SHA256 994a3b7ac95d34d0e3d8c2e56bdd63ef66a1eecb592381529d1f6bed00ff26a5
MD5 af1d702d91f62b56bf3dfa98a45d63a7
BLAKE2b-256 6f6be9f60ad6364eb8c08cd76332fcdae3696e61bca7382d4f28d0a544119b89

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.21.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 672a47879a43220c712494c8edb423aebd99efc1f8dc4455f8019ede79d7be75
MD5 c2d74fd8cd4ff60cd7660da2b6c2c4ce
BLAKE2b-256 fcbe318dc638bebcccddeb16fc3c6c0a6ec7a10cab7cdaa3edef0d4667cbf7e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.21.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.21.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.21.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 37cafdfec34c33304d49892392de5f0f7fd433fe144742a5be9fbeeb08537c52
MD5 d388edcb7b992f9cdd144387d14d5a48
BLAKE2b-256 dcc70ba6c252d440c2e7b7d583cd5c04e0caa033d244d1b6ea7560b3ea15470c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.21.1-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 e0531ee1975e0e23e4208c5cfe12e95ced59046eeb446319aed9b3e92f0cc625
MD5 c55f09fdcdd92e011690d45277317f9c
BLAKE2b-256 bcba50de6e44c788a5d3d7978f4ea844014a1a1975c1a518b7484f5ee4c72b7f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.21.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 896cff2d1aac2032cd691eb461f07def907ba10bb642a0e2068c50460ab5a98c
MD5 53e1d5451df16bcf328a04f3fdf7b86d
BLAKE2b-256 6cd6658ebb27bcf668106171b415ae02fb778e3ca5e1c424fec6c3bee519cc1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.21.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.21.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.21.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 3a577aa3a968ddee2e508cf163df54f67d0d1bf2b8596936bbcf3a1e93fbd188
MD5 737bbfb45b2c4a2582577a00520d17f7
BLAKE2b-256 63884e1c4d3b9c3b4890b828986c3bdda9f7a978c225484c086733577089b782

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.21.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 5373a24593d7b8dd18ac12d74b55dcd9a1d9f1ab25108c05015181e0fb07a771
MD5 16c3f052beef616b4fe8c38d05d13924
BLAKE2b-256 386d2dcc5232dc9237ea9f8a3d85ae7bc98d503a4ba9a3a401d091dbdf2f149f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.21.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0d8c708107978fd92043a8b8f2bd6342d13911f857ca335636f1eb5ecdd76ff5
MD5 e8005fc13337e66ab1beb95f12d90d7b
BLAKE2b-256 bfef4a5e9ddcb4be9e71898e2e68e033e347b2cc8f98725b67f1c287a7f2271e

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.21.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.21.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.21.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 dd22cb70c7b54017b5aaae2a17bc8ee13cec1f61c6a9b04490a8486d918678c9
MD5 006ace8f1b24977ee8206482a9b6acdd
BLAKE2b-256 edbdc4a16690a1f3a2fbcda0231e8bd8005a19104e004aa9b08776e0fe5cd642

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.21.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c251ecdf33069e88ddad5493f1fe8066f69db81e18dca189cad0b1b78649b4ae
MD5 63a643265281da883e84f39199bc410f
BLAKE2b-256 05a21e0fdb3b1de980bba260fd7c6eb3268b5a64d15ae2a66bc2467d99e4e580

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.21.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a8bc5c95032e0f822e9e6c831f980a26526d5eaa1a396ec38496edb62425071f
MD5 3f7229e2275816e47a06f3d39a3ec009
BLAKE2b-256 12ce6dad8cd32408db1e40b7b9bcfeac345ffe29769844f588acd386fa78e5c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.21.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.21.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.21.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 11369006c436bb05b9816585807cc58bc0a171fd507217acca2486e7844111e3
MD5 270a1c4a01ec40935b0de1988d4ab507
BLAKE2b-256 14aa4451ee6ba9514a9f8d742ec55d344ef82092a4263de8ba2cdfed12e2b64d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.21.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 071e558ccb69029d9f7219a1017f9e3cb52ae1922a57c298ea10a69018ae5add
MD5 b11a78fb3585360ab11d09fa752f65f2
BLAKE2b-256 97783aa28d003e27f41cce26679ee24f85eba8de0a14aa2b7892fba8581be665

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.21.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.21.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1709e5151e538a95a01fa0a5f273911b787920cfbe725a7e1ef46fa94bae2875
MD5 2002ad5df136b974c23399d98f21b848
BLAKE2b-256 65e686ef8176bba14ed2d9af926f9a52f000cecd5cf083b85dae4b3f9b7105a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.21.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.21.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.21.1-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 08c4bb9b2c8e57a5fd9aea14fe607902261f6231836329e6068b71209f12f654
MD5 09ef5bd78ccdd66ebad6f2cabf44e450
BLAKE2b-256 dbc779973ea345ff4315b11d1fce7710c4e8a913afd1c421d9cde6b45edfdee2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.21.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7ba5f97bb21ae9e3ddfbc7143bb81e404996379c0ed8a7b7940a7c82a299789d
MD5 b94df7ec80a1aeb4a2fa00bc3a4f378c
BLAKE2b-256 0a9b60107a9381dc765f69ba2fce74f6a89080ed4bf8c52adb6286acec6b81d7

See more details on using hashes here.

Provenance

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