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

Uploaded CPython 3.13Windows x86-64

openbricks-0.10.22-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-0.10.22-cp313-cp313-macosx_10_13_universal2.whl (17.3 MB view details)

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

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

Uploaded CPython 3.12Windows x86-64

openbricks-0.10.22-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-0.10.22-cp312-cp312-macosx_10_13_universal2.whl (17.3 MB view details)

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

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

Uploaded CPython 3.11Windows x86-64

openbricks-0.10.22-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-0.10.22-cp311-cp311-macosx_10_9_universal2.whl (17.3 MB view details)

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

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

Uploaded CPython 3.10Windows x86-64

openbricks-0.10.22-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-0.10.22-cp310-cp310-macosx_10_9_universal2.whl (17.3 MB view details)

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

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

Uploaded CPython 3.9Windows x86-64

openbricks-0.10.22-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-0.10.22-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-0.10.22.tar.gz.

File metadata

  • Download URL: openbricks-0.10.22.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-0.10.22.tar.gz
Algorithm Hash digest
SHA256 c2d5c33a9a298648151b49bbc366826c6a006c6d46fb2e487ee5d78653b142e9
MD5 f6de387ae679cbe5c017a1b18a3c23bf
BLAKE2b-256 3e2c002b28ab37562d1fe6e6508663d985b3fb03538edcec51c28831b739203e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-0.10.22-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0e5c352ea86fdffe44379f254dbe153246491bad09b332e4d4e00f829f9391c0
MD5 0b445f9ed14806862181760d009180df
BLAKE2b-256 5d34c5e1ec609768e888b77fdc9b98611f4a8c7e57c5fe08bec41b9646bda2fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-0.10.22-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-0.10.22-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-0.10.22-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 36f1c42857dfc5567009937ca24030a5308afc6f1d16635aa6150c67e50b6f73
MD5 9a5c3a2a7b1b0507571f109f40fba9f7
BLAKE2b-256 606874faf146f7347e34082900b45860c873f5d5fedb9744e60dec8a1ceb350d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-0.10.22-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 8f938cdd4757da8127b509515d62c7de60df58896939d8d1139e844bc5a67913
MD5 d2b2019051f0d3c227580a897b9e37ca
BLAKE2b-256 a4ee2fd039b8a1944d972aae8370be0a39b2bb9ee7d6d95929ae76ee84db31a6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-0.10.22-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 818701dc1e534e0f468731789b3b80e871dfad2368aacf6acde4c040c478457d
MD5 c234a5a94a7f17f68fee48f564cf879a
BLAKE2b-256 2c6110df03f600171cf3a29bdb7ee772af2130907097d15b29874db139f290f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-0.10.22-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-0.10.22-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-0.10.22-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 bf024a3bee9f65187a1f66d3694f9ae7e19f48443c951217aa19362f8b6adfa9
MD5 f585dc2507ce66b1cd62c4c1872f5c89
BLAKE2b-256 3f4cecaf187d0f53cb8224918e8df18ac5376c418bc1fa0bec96d4ad25a45a21

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-0.10.22-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 0e5a7f3a38cae5e59ba8ee0182f915ac26778313f604e658b9936969612ac50c
MD5 e1f33afcf5104e8603c4ecd4db84c086
BLAKE2b-256 5d4f4fd8b1f525a9525562551ea0bef649036ecb77d42d596367d1a591a7467e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-0.10.22-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6923d99c88003d7e550682e5d2808dc7269cb5d221c80251c481649b5173343a
MD5 05275b167f3f8596a547b49129f26c25
BLAKE2b-256 acbad886873126ae7bbf138fa113ed9f7d32485d4b6b16e14d64b9a9ac4642d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-0.10.22-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-0.10.22-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-0.10.22-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 4ef02d77be0a3b899571adcca40c654e8e3eb312c230ac1471695e1bcd651ed6
MD5 a1f05c631305cd92ef95648ebab91e35
BLAKE2b-256 8d7a7da09c17eb29d9fdccde546772acdcc86af0d360497f4976f93181723a35

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-0.10.22-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7290b246d32de356fb83cc5e04c7ed250c07a43a1d17f347f47e8b402379aaa8
MD5 c25204232b36f2d74ed5934c4bab7934
BLAKE2b-256 6537d410ca804d09e137adedd97dad59cda0eb2ac2ebe691111caeff8f44d283

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-0.10.22-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f4b4c190ef4122d0c3a36ca8c2517e4e8bb8bd65266bac4afe6031e83e7fa9e0
MD5 09831caa8cb12ecda0a4077b050bd031
BLAKE2b-256 109418619c2e99668c81a723a996718f82429ecac4e633bf2c0a3d362101f6a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-0.10.22-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-0.10.22-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-0.10.22-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 5b70e15c9c65c24f0c4cdfde0ca4401187aa4f37270bca7d97a8514591b12368
MD5 5581576d3ca4dda58b348fce6e03479f
BLAKE2b-256 0a150c4c29f200575b1d935bf39887e782c48843796fe039caec0b06d8de9197

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-0.10.22-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c9e398997784de4cbc11396e2f86522caa4de44b4a4b77353d66b969f3dba5ac
MD5 a920611ef5160d2f3704f5180316565d
BLAKE2b-256 0e85f91e057c919701ef0ada05289ed5a44f360e957743b1e2cce3ea10500fa1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-0.10.22-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-0.10.22-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2ed1b5556281884813fa4d51c6c21117151cf5ed067c9ca86c03d1e80005f975
MD5 24ed1d9d8407027f95abd84e9e6d556f
BLAKE2b-256 87cacd5849d71e5156d556a506f1da4ea12e2262f879d821373e5fc81f7745df

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-0.10.22-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-0.10.22-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for openbricks-0.10.22-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 3f47bbce275d1be82103978331ab3cb78aa6fe85d85f86795e5d6834ed03afad
MD5 cf1005127670b3ed5b56a630d544920c
BLAKE2b-256 3066316b8176927620bd01b8e5e54412cd1a6980fbcf5706adab7c8ef921bbdf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-0.10.22-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 82152da50b4179bd5bb9ca6460f0b6aa3115bacc950ec443f00f933aade9dea1
MD5 3dae3406fce6cdda95c97a6fe2a92ffa
BLAKE2b-256 a1f3bee73f8eae10f3aecbf0fa9ee98d1d8aeeab4840b4b633181036bd23fc28

See more details on using hashes here.

Provenance

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