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.19.0.tar.gz (17.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.19.0-cp313-cp313-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.13Windows x86-64

openbricks-1.19.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.19.0-cp313-cp313-macosx_10_13_universal2.whl (17.3 MB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

openbricks-1.19.0-cp312-cp312-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.12Windows x86-64

openbricks-1.19.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.19.0-cp312-cp312-macosx_10_13_universal2.whl (17.3 MB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

openbricks-1.19.0-cp311-cp311-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.11Windows x86-64

openbricks-1.19.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.19.0-cp311-cp311-macosx_10_9_universal2.whl (17.3 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

openbricks-1.19.0-cp310-cp310-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.10Windows x86-64

openbricks-1.19.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.19.0-cp310-cp310-macosx_10_9_universal2.whl (17.3 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

openbricks-1.19.0-cp39-cp39-win_amd64.whl (17.3 MB view details)

Uploaded CPython 3.9Windows x86-64

openbricks-1.19.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

openbricks-1.19.0-cp39-cp39-macosx_10_9_universal2.whl (17.3 MB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file openbricks-1.19.0.tar.gz.

File metadata

  • Download URL: openbricks-1.19.0.tar.gz
  • Upload date:
  • Size: 17.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.19.0.tar.gz
Algorithm Hash digest
SHA256 8584fcde7f6116e1bb31319353e96efc61dc51204586fb8932974b4395c6708a
MD5 9bc86e523e43f18434538764e15859e0
BLAKE2b-256 f64c4b78bc7d6bdc7d44aaaec57ad063f15131b5bfec572face346d286667579

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.19.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.19.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 60eb0f9f635723748746e51a2f70c45978a98341c7643a5d376012d1a8690ad5
MD5 5e4bf2205ab31ecf83ea202c8ccbb699
BLAKE2b-256 bbd7324e6e1b2436c11a2701d6e454390e7459ceca280251272fd6fd4865ade8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.19.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.19.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.19.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 17766676de0dc7c0746ff6606956f7304b8c7df1b594b46c11ccc049254e2cfe
MD5 832aed580e7dc7d22e879fb509ae4d66
BLAKE2b-256 fa9ceea631a13b41b876d1c6380c8a5ff8f5b8d7a4eca79235c224bb2c6e5ed7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.19.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 0e354753e687e36fe50c224ce957b68550b7a6d5fad7d20e4b5a74af3c229f6a
MD5 2c6e0ccaa9d7ede1c568c02844abf8b2
BLAKE2b-256 9fc8d0f71c27370cb255b044bcccdf68a8724bb809dbebeedddd3dd5c73e9272

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.19.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.19.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d4c67162d49b2681fcfdcd93f3f13847c10872e4353e3d9c9fbed9b368def10c
MD5 ab9d1411815c7c9fd5406ec7f33c958f
BLAKE2b-256 7ef6c30a418d3cffa0a72880d7d68163e68b0cf0d60e197a6a17c55fc50a4a02

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.19.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.19.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.19.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 3a413e535072680c46b3439ac419050d0bac07a19e34e068976933fcea142503
MD5 e3e58443e51a6a4c9f12f239902ef719
BLAKE2b-256 a3fa78b0c2c1deb6eadbdeb721cfca6807795e7fe73a6c9b94d6d89c90413b9e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.19.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 2eda2e8294fb7ca585d1379c1601b32d8f6973a8ad42a92786bb664fe36b9073
MD5 860d99b3435af08c4f0935edc2f8a80d
BLAKE2b-256 9460e410cc7a7c9cb29855d33eb447709b5b2958f32295856976b50eec1ceb19

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.19.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.19.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b9d559e98c7932984e28108d942d5c6832f6cfd4cea40e1d63c6b8b0b8da3523
MD5 99456d973dda4068b9983e5f338a823e
BLAKE2b-256 698a885c60bbf0a42de76bba6dd91d8aefcb73d257d3b716474b31f8baac833d

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.19.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.19.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.19.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 1880ee911db6abc4a1baafd1e7747d8c876a297d7ba04821c62d91f680498a4a
MD5 6e5c57009e425d4f517c8daeaa9c9285
BLAKE2b-256 2dbd8bea40162dc201cbdea84fc440470b65ef09a1b4bc28fc968a232c4c2198

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.19.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 037036ab12055b656b12903012da79e982b8f1d20f2a445d90d70b5e943c6070
MD5 258692fe876f35929208b395bb974d8d
BLAKE2b-256 b76709375caef4fe7a8b1ba493b444f0bdd419ba0b0deb6583d087a5ff91e223

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.19.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.19.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 137bdbe52eaf741fa9a96ef6d6a13c64e42769ccae5294820016b7896a8fd51e
MD5 8660ac90d6f1e1c9f0b4ee4de8bc6d03
BLAKE2b-256 e2ee90f20c2278acd1321fef3383eb180bea50c3175e6e3882933f8693072a62

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.19.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.19.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.19.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 0e0b13c934da04202cb39ece725946d4e2ba0438d5b93e6aa756c2c0ca874f82
MD5 25e872ad4e9b34da711c6290ddd4684a
BLAKE2b-256 0bb0cb43791fc303763f38ff3f7cb09a4a14780d0108b3d311efda2b8ba4a4df

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.19.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4cc6d94eab0ec7f3a21da018efee26be6547a8805e9d2dbd5fc821b192ccc32c
MD5 5aaebf1a63f24f55c7efae05c9d497f4
BLAKE2b-256 7d9ec8ed64216d42f7ac03899c05eb98dc800b0fff677ffb336259b990da3c01

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.19.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openbricks-1.19.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9cedca2f4e21f3a7207cc9af386cdb112a27ee718380ed0b1adf799e30a87ba4
MD5 76daae7ec2502d33220bc6b077edb8d5
BLAKE2b-256 5ddc8e02dd3e57bf7049c596ed464ef79c353f56a69fbb13389bb14aa4d08927

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.19.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.19.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.19.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 e2e06b1914530adcb5102f26d441905dce16d99fd55377405c149959bbd3932d
MD5 c2235e0b48c2c6ced671d1210b46238c
BLAKE2b-256 14e602ba4944f37b97447a44dc0797711e547e913b96981f1353aebff37c1cdc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.19.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 beaf3a0b411468433a7ba76214a2fa570de6b6d958b1fcb2bfd542469e44d1df
MD5 15ec8d3b160c4adef664eb063897c912
BLAKE2b-256 dbfe586fc4dfdecb693369b0584a069f90b2b8c743233a471abebad3437078b0

See more details on using hashes here.

Provenance

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