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

Uploaded CPython 3.13Windows x86-64

openbricks-1.26.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.26.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.26.0-cp312-cp312-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.12Windows x86-64

openbricks-1.26.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.26.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.26.0-cp311-cp311-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.11Windows x86-64

openbricks-1.26.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.26.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.26.0-cp310-cp310-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.10Windows x86-64

openbricks-1.26.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.26.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.26.0-cp39-cp39-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.9Windows x86-64

openbricks-1.26.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.26.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.26.0.tar.gz.

File metadata

  • Download URL: openbricks-1.26.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.26.0.tar.gz
Algorithm Hash digest
SHA256 41235a2ce453f96269e2ac6432b5bfe4bdebade581325443b94ac7a4f09f0022
MD5 824f5d2e4afed6c08721e1b555bc253e
BLAKE2b-256 553c831d76e1f4d5eb8d7819f7d819059bd3ec23e8bb311002eb93a0a529326c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.26.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cade7c855b26ee7a29bac86dd958626b43c9282d5bd85f651f072f540c817a02
MD5 774187363b92b29aa2d92cea8c5dbcd3
BLAKE2b-256 8c538d08263f11c329b5d11eda194837e4c474ea7f10215f379849197b5c5e9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.26.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.26.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.26.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 eb9185cbf8020d0da04a72666be1a4c181c4bdae0e059bf7712f07afb6f7223d
MD5 ac81c47c9bbba0f74dd20377b512f8cb
BLAKE2b-256 bf42550b835353e7fecc43288484671f834a1f6424b82012e078a26d4bf84376

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.26.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 f9c8cbce3ce140418d4cc09d45e23e7df7f22691294ad59432d9c35168c65ccf
MD5 dc44af3f0efeffb94c222041dce72e1d
BLAKE2b-256 a9702b93effcd93612a1fa66a200d99287cb9c056a1223435f724b4aacc43a2c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.26.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3739047fd848872f42f36372bb0c1e489e3fc38f063e84a81db8cad23ac1d5a1
MD5 aff5ebb30009d171849bb1087bba9c64
BLAKE2b-256 3bfa436f4a5dc46ce35876522d4e29e918f89bb67da9db0795c19890722844fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.26.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.26.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.26.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 d79d66ccb30cd0fa911d5dc0e17dc49025c16c8e1efde3044f97247ce7362785
MD5 7f46e1d4e3bfd647475e4faa739082c7
BLAKE2b-256 77a0f81a57643b3aaa800dd384c0c07a075d7e353ff6fd094603d7e4516ab04c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.26.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 01324159cc65d5f2f84b7bb01a7e2d3364bd17e3562b98266ff9e58dc053f2fd
MD5 ec654bfce90f1ed02651d309ac87e085
BLAKE2b-256 13d53b1ee83f09356f3f62ab61d4062d5cf1bb26af1f5a5351fdd59b7aa531f3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.26.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 aba189c0524f6bb3ed7bc9ab8ab39572ce27ad1442c61be07c946fc123944b37
MD5 3376a8c98007e20c4cc0d4694146fbd3
BLAKE2b-256 030ff68409f9963315e090286b84c22b2daf236553f3876a14bd21ace30e523d

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.26.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.26.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.26.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 cf70d2b9d9149d79e24fe6dfdc34c30a3daca4e1bd1827c4c7ec4553f46ed51b
MD5 08d83d821ed56b0f5f45d33168e1d84f
BLAKE2b-256 55bc77fb4fc5730fb82e611282c29e12ae92b4ee450da0cda8e83bce5c960593

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.26.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 70437051765068d4fe5bcab0aa3f39a17ce89c475de151a6fd80a97dbf22d8b4
MD5 0edc1f414167d0f13f9dc42ad031940e
BLAKE2b-256 1e2b979d791343f3ad17ec9cda4ad76b107ff5d3e48cb29306e8843f4f489a49

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.26.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b5503a66119d7b8519d4e1dbeee699e3f7b0de34899a2fc7dbcbb708afdf56ed
MD5 cc5670d3ca5ecc56112b67f89aaad93e
BLAKE2b-256 4a4e94d29b54407102a9a3c5fe4cfb80ac8cbea34dcf4ec222897b7b5d5b64a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.26.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.26.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.26.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 0281c800aab8c7e393474f73d7d3c6aa7897bb468238a209a106f385295a3e3e
MD5 ccde83854550baa4098b91c76a5875ca
BLAKE2b-256 186325f19f636c306cd951eca4a131d7f8d51c380b466dac4c4cb7ef7e3aae47

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.26.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ebe204228ea30a3962c718e2c83a5593cff57321f0f131f3b203af6d92baa2b5
MD5 ba9fe914e57c8a2bfe94d75afdadd6c4
BLAKE2b-256 4f255d16f8bab2bc6604133801189c1fb4184079dfd8313957678c8128032f4c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: openbricks-1.26.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.26.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 416c9a4ff9b9decd0a2d56d8f1a01fc52a52032bb70a4b0fb6f76737384b6ffc
MD5 5c77fb8fcbe33230ee154fa1d298e26c
BLAKE2b-256 8687cb8248bb45942ee1a14039fe9e611037a7de8752b4c9e406b66738d70338

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbricks-1.26.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.26.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.26.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 1855e8a835759d9c047f37ad9d127a1fca2591f434a1658b9249bcc061b3f586
MD5 6779e9ab165dd50d926e276ff947ea92
BLAKE2b-256 c6be367093b9221841069b436e36e5ce76d26176ab34742fb10fbae3935fd78f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openbricks-1.26.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a8a6bc1ab3fbf6c6a033dd1dbdf97ebdd5347f7fb3549231799cdef22bc801e0
MD5 f9a1b3f7d276730d7dda9f5b6f879bf0
BLAKE2b-256 f576f041ab53bd7ab4720564ed3188f0abb953728a75d44f1fd71ef7436146fc

See more details on using hashes here.

Provenance

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