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

Uploaded CPython 3.13Windows x86-64

openbricks-1.23.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.23.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.23.0-cp312-cp312-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.12Windows x86-64

openbricks-1.23.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.23.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.23.0-cp311-cp311-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.11Windows x86-64

openbricks-1.23.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.23.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.23.0-cp310-cp310-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.10Windows x86-64

openbricks-1.23.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.23.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.23.0-cp39-cp39-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.9Windows x86-64

openbricks-1.23.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.23.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.23.0.tar.gz.

File metadata

  • Download URL: openbricks-1.23.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.23.0.tar.gz
Algorithm Hash digest
SHA256 b7e543b19075ce2a4c2e05697b870621d1c85ba6818c2f6b5078d1e7d913d7a7
MD5 f1ed2cde0b8576f6fb0965a7b61bcf9f
BLAKE2b-256 55194ddd0707356387e9a8f741df34e784e3f4169e18e84f6640f1dd9cfb5dd4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 de9f77f17c932f72ddb93a6e5dc3ec452acb1b923b7f7be4f1bffcb0b413c21e
MD5 25c04b120555fb884569c2e4acdadf3c
BLAKE2b-256 ad13285fd86826e96249621d490d2632fbde5a63200329d6f6178dd609527c91

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.23.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.23.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.23.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 4ddc2eabe40dbf19a350541c17a0d265f8b2966a22569a52d171ccc9db7ae686
MD5 8c546c83803adc6ab95f5bd86d1c6902
BLAKE2b-256 66a27c17eb6f44b287c872ace050ddf4fa68dd19b0a0d6b27e67b5cb5425144f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 784cb17cf9c32bf5fd09d05c89427f49bb8ae3a091906183aea64a58d11ed27c
MD5 8dc9ab2f0f0d99f7acbff123fd6a3c21
BLAKE2b-256 08994483beab501d0caa645970d3e91e4fe45d5a0931a4dca9b74f5eb33f21f9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 663e3a2f7ae38832af6b735fcf76c5f2c3d58a0372668e01434b2fb4c9b14bf8
MD5 558224b356ed91ff461d721a96be1995
BLAKE2b-256 22b4b992a2032fea134ffe372bd5f7767c32647f0993b19f7e8e07e6ba75ca3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.23.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.23.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.23.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 338a7dec940d16d1048e4a8048cc35362b65533927a2ddb86f006871b2988a40
MD5 bb1817cdbcc7afb2013e85ace6678420
BLAKE2b-256 d4a6ed92b2edc05f6e281a4c573430d096ac17bc79906a42dd336720e8fbcbf5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 73a375baa90253135be1f2e52abc44bdc48ba95b8e84e5d3a9231f921e127b0f
MD5 2421538279d65a5738985e8fafb13f4d
BLAKE2b-256 85c4c503a197f0df72973251474f94cba586b25280c824b092b8b10a53dc01b8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 26519601a667e27a2576968795d9c23a96cc7a7250045236ff82d482347b9917
MD5 7ab90f1d51f42c01d8a94a214361ff06
BLAKE2b-256 e5dc1675e91749c6260de1821de8d7d37c617e523c308abb4fe3ff9258d535f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.23.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.23.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.23.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 382e2099d2d333c183fcb2199fc3590cac36f3655ddcff0c15a1df0c1682df88
MD5 3bf894d79cbda682c6f0224ba25888f6
BLAKE2b-256 a322ff237c8ccf6680a063eecf62a1984fede94a046f9cf29d05393db3d0cbca

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5a82b3c49f58ca1d12e0bafa2364a42e35c3ec54b85c44788f647cb3de5072d2
MD5 ddb7977c9c72b648984b6d8cdfd5aaf9
BLAKE2b-256 67c2aa2802fd52924bbe5e7f5e418e91f8b12ae289492798f8e09e0d6adad5df

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d95e7644f1484f3339c6b00bb1d630b9d9bae55a05dec9afe1b5afd45a2d3537
MD5 1e4fbd6066fe9a15478da2f6fc0c1c9e
BLAKE2b-256 e5bc2158fd33311e84329975e78a509189ef568718fe33f0db6d0148fe4a6b58

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.23.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.23.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.23.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 333ba8a03cd05fb775ba49e5af24aca279dcb4a1e8ba943a2c9cad82d773b7fc
MD5 8bdf5d435bfb8a72877a8c38e836de9e
BLAKE2b-256 b3c1590ee056d7ab9bb33ee55484647857256a9b174e6502cb419e0eb0e2ce31

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ef719784cca2233f0c48aacc6e32de1ecd66b31ad02a69e34bc272d14cc70018
MD5 f6d8f5e8bd30a4a1221325ed5a6da6b3
BLAKE2b-256 9c63891d9e22c1ce7928af4808960059fbe495f756e91b65421802c2b14e26d8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.23.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.23.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 266796b57697c9302ac00c72b5ab6f527e4a16f7c5d02951fdb2df91753dd488
MD5 e088142972485f85ebf9642807934c64
BLAKE2b-256 dab0d8853e501c55d5c2348417456ffbe11538f0252572ad6ca51fab9a7c5f6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.23.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.23.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.23.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 0f14ffade1bf9d0f0deda3f54c8d48be6fa37219d7b96663c6ee9ffc151a6bb8
MD5 564b34c38aadac3ad8d490ab1134277b
BLAKE2b-256 bd5a06aa400cba5c03d85f56c1f48586f9535d9effc17fccf9ae29eef2803e25

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.23.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fce1a98d8541e72bf259f410fcc19e5e545fe6f5a1030a43476db04fe5a75485
MD5 7f390ee36b7ee0a5dece68f75f242f21
BLAKE2b-256 3891bbfe54c2c4de87b802ab65b327034db52096a55c0062f5e6dd4acc5fb306

See more details on using hashes here.

Provenance

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