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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.9Windows x86-64

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

File metadata

  • Download URL: openbricks-1.22.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.22.0.tar.gz
Algorithm Hash digest
SHA256 edca7e9e5f695a6264194d7477cd4bc6f2412638a9ac38f049ba7a1737498759
MD5 be7231e16bbbaf607087497897f92650
BLAKE2b-256 ffcc22aa292780d2f8bdb58d076ed1111dca7e51ca367e14bd5a705a73c05df7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 eb6de35bc422103b46b9383627bd0efb2a82c67d44187dbe7aa7c10b6a59bf79
MD5 a056b7602b875f047624b69dbe548edf
BLAKE2b-256 b05512ff3ab1d281567c12d7c79787c516a0a4bf3ded6257b657866d29e3ae55

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 e471ae5dfed0c300f27d5565d9d2cd24e973a7c4d4710ca17c1fcc652fe4991a
MD5 6dbbb0678596414c9f54754de8347feb
BLAKE2b-256 0285ce49d87adae07166b1af681735f011a67fed35bd1230b7ab553264fdaf3b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 816561d536d0e3d168564d87ca4d4643c63a2ce669974eb45f5cae88bb74e5ee
MD5 8c26f03f9c405a8a18d8d730c035ae1a
BLAKE2b-256 0753596d4e96785fc0ee259ae662957515b65ebe4d63d3bafb66989099341e0a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4f21c1a4784b55efd591372d8be903670087ccd13b064fb836e270ce2fbaed07
MD5 db67f91521d2517cc6a069f040edb0a0
BLAKE2b-256 b55d2425af660b0e6517fd63c6646f4a91a57aa1c1c75cd118883ad6a5b6ab7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 64403f7cf077776a64d6035e89f4d7bf4397a1b424e31f891981d7cd2ebabb68
MD5 43cc4a49750ff002ea3fa1694529f36a
BLAKE2b-256 c0e9c516feae381a4e242e8a96083a804abd5adc2f8d7e11f2ab0927a5e2f9e4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 5aad2debd260e8b124e6d352f646391417eb7695e5c70dac0c81efa563615d8f
MD5 ffce4a482ae338dcb25261cf3b60a91a
BLAKE2b-256 ae12ad3b1e596d87287a2c8763ec2666b251d30ac3a8a55807f78fe13f899d54

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 35f2f5e0d603bcc8054154a17715be174d18590650b0980916229db1ea97dd83
MD5 232388f0004f3194a57fbfef04f30d03
BLAKE2b-256 9865b7ab1b1c5e85ffe82f9d36fe2ee3de1f80b0e3b988cefb118b1ab7b019ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 81795364b800763af57e249cff5cadf98eacb9c364fe341cf5d4df5e59470a30
MD5 f582fedcaa4646a730722dcfbb8c6af8
BLAKE2b-256 55e98d2750f4fea2f30982f143b5b451704d16c582265fd2fcd1adcc90746139

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4a0305d97a1124a8ec87fb49b71df4250cd4b3467d71f39ce45aa4e8f16a4541
MD5 bec448bff220c730c0f2d9b8b9a28719
BLAKE2b-256 4854d6100d4b928cd758f653e41770f935ff5313cfab7448a7443a6f0b95fc91

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7ff3742bbe1f7a917ec740477f1274198eb00ad759a0a1d25a4d1f7d91e5f603
MD5 dc9b9db2c842685683651a68fe819b8e
BLAKE2b-256 32abb9d8e9bb128b988366154c695d88758c497b0488deac7964dcda64578e04

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 ba677a89593673e87f3234b7659cb37bd65db8a0acab2d420d2e1dd62d262123
MD5 e4714a78d824bb9bdf9603e191f5d54f
BLAKE2b-256 8f74ab443b294a8ace81f3cabb31362b0b47961301827ba2826a05970880f7c9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ea36adef57ac43eced96fd41a3e65377e9c36e6796838feda65ba7e4c21e0c76
MD5 97a081622bbf84abf48a61c15cdd6e13
BLAKE2b-256 f03360f95be4f4af070755e018ba6a1c72e512d7adbe248891ac2c1a3989573c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.22.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.22.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c1959aea7f037ce4e83c54ee8240eda7bdef3877eebe27e4c1ca708efbc3e2a3
MD5 06208c1b6fa7368bc0c9f806b7ac58ef
BLAKE2b-256 e344fe0b990cc41fa5cb86c07f2daa9d47e70b27309d4bce88bb81f2475561d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.22.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.22.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.22.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 5afca6cd13432234a4c35b1e2347fdc5119f57497d80f903ad1f0f7bfb8c02d3
MD5 6f961bd1f49ec9dcf33984d3ad980aa4
BLAKE2b-256 0539cc13e2c67b3b2f86fe23b24dced70cb9e5dde1db9e31c7093e576ddbea41

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.22.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 817d2929efef6dac94e754186b0ea29d3e72ff8dd5c42ba9ad95dddcac183cd1
MD5 29c83d02414cb63e4b29ee2901c1c039
BLAKE2b-256 5928ba9c3e460fe80dc01f0fa3a7fdd3c0964b22519b72311782feddfe71c83b

See more details on using hashes here.

Provenance

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