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

Uploaded CPython 3.13Windows x86-64

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

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

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

Uploaded CPython 3.12Windows x86-64

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

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

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

Uploaded CPython 3.11Windows x86-64

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

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

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

Uploaded CPython 3.10Windows x86-64

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

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

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

Uploaded CPython 3.9Windows x86-64

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

File metadata

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

File hashes

Hashes for openbricks-1.20.2.tar.gz
Algorithm Hash digest
SHA256 536b6353fd4c36545eb699eef1aaf23b8bfaaf839834010a47eb70c37937ed5a
MD5 40400b4387b70589c9878203f948a58a
BLAKE2b-256 67dff53956e6e4b86397ec81b8485c69862e6f4c312154409a89a957b94f556a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.2-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.14

File hashes

Hashes for openbricks-1.20.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 49527008ba46deca22b1724bd607954a4098c645b803559f95ffcfa6758c54cb
MD5 59f93ed22e4731c2d463626a174833e7
BLAKE2b-256 8f1323870524d61b0593bf6380b72372d4f251b140180275041737ee75e5b9fc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 761bca4d402c312e5736c7b3ab6087a5580446cbcb7439a5ecde0f6cfc810049
MD5 c19061c6b28646a099d921391d7799a4
BLAKE2b-256 942c88cc84762af74009f76c2251b11430063f91312913009c16ed827c4dc66c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 6e779b1ed5811f5e869fd060335eb0e6060556a9ea0f46e35b5619232476a201
MD5 138cc16fa6f6fe7edea1c1102e503c40
BLAKE2b-256 8faa8d4d3040df0bb8049bba3871255998956b8a42036daa7df03d209dbb2b7d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.2-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.14

File hashes

Hashes for openbricks-1.20.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 dde99907f8caa75f04d842973cb4e275223e47c1434b0f848f6972f4ade45f62
MD5 ad082b37afd912d0682b0441930f9eff
BLAKE2b-256 20d8658d72933add18024fd46ae6cc9b80f92ff3d50c7987a5ec24e3a6044468

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 ec03b45880f9141c0eb1c2490460bd7f14d567769948b16dc0504ea0cfdb4382
MD5 d3f089106191e4b57a2c6affaf177222
BLAKE2b-256 f4c7ab61a02dffa9e1d191ce4e231fbe9a8a522795fa5de9743851580df30c95

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 283fb1d73ee66848968ae42ed15c1a82cef0ce8be294f6aa6cb4c1f501c23a6a
MD5 8e66efb1ccc544c5235f78e607814489
BLAKE2b-256 4496ed81639a843f68b7ad574baeea712d61ad4cd48d644b6f7d7b44c26c8678

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.2-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.14

File hashes

Hashes for openbricks-1.20.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b6e1f1722d7bf7a410467b27f05220bca3182f50b2642137f13a2e3a796c5c2b
MD5 ec2ac3d5660bad7ca944ff86f4e61c28
BLAKE2b-256 894fda2ed16d900df4bde3d1ed900dfb8abdfa93b77ac64f696dc061a76cb1c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 c1eac283520674a04802dc2513546c0c93fd27abe273dc8e8983bf64b6824d79
MD5 db09fc7ebb16fdb2f12e103d53805395
BLAKE2b-256 981b84b6443a9f96c3204acdb203c3073c3dd26ed2e9ad873077675c236310da

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7cc5f6f10d0f62e0152dcb3bed660435d08d299ebdc940f866f4b55608eef80c
MD5 0cf29c63f16d973684bef5241c28e8f5
BLAKE2b-256 2c45c3620b3852046b5be0f3468371d59ac91f9b187ab34a1eb46573ae615b5f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.2-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.14

File hashes

Hashes for openbricks-1.20.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6ca1d86ec13e145b9704e3f0080b6065fe6ba0a3327f3c0a99f4b63c37b49c3b
MD5 d0e734052b20f6004cbdb71f6f5853a0
BLAKE2b-256 be35f9ee90106b3912cc6d70cf98e1f4fcaa9e354245ee19e1b46fbf259a3541

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 41c5de7c5b403ac537e32aae2a3ac46c8455cb082ef5bb364dae265e68850eaf
MD5 18c3ebde08a29872fb00c6db0940bd66
BLAKE2b-256 d8b9a14a039aafb950642fbbbf0a4d05c21a0c2456b9db1608cece284247c5dc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2e9143b52914f2538b6fc750d2523cdba705c0194ad1805ed802550dec4280ec
MD5 fc21c8c8d05fcfc35d4fd2e3f6dab340
BLAKE2b-256 9a967face70b3a77e214060f20b66bfd937d8f132b8be039fc95ee357354973a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.20.2-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.14

File hashes

Hashes for openbricks-1.20.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 7fe19fecba8df2d269bdf92d7207d55d5572694af4438a204e9d8a1b4e6fc7a6
MD5 78a5cdc5b3f4fc733172fa388a51cd22
BLAKE2b-256 5f0cc2f894f6e0a31b2c790bcb813f3419895238c4f260925c81cc51057aadf4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 9528287b7c9b6382480c38a045e4381e5f4ec04f17749434f80acdff13065362
MD5 19516663d7b349dfb6662dbbd5bf3a32
BLAKE2b-256 b11b50161fb2d272aecbd17a64b36e585c617448d4155f144916096d697d5fb9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.20.2-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 392967e0677faf970d7371392adb5a0fd7b09ee083fe82299878ef4afa2d8733
MD5 2b5f6016b537bb4cdcd975ad33707898
BLAKE2b-256 e95a9f3e03956f9ad4b03b1665edb0acbe3490b36a6e1855fed7b4ee801ca2c3

See more details on using hashes here.

Provenance

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