Skip to content

About

Native CircuitPython Bluetooth editor.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

112 Commits

Folders and files

PyScribBLE

A mobile Bluetooth CircuitPython editor. PyScribBLE connects to a CircuitPython board over Bluetooth Low Energy, lists the Python files on it, and lets you edit and save them with syntax highlighting. It is built with BeeWare: Toga for the interface, Briefcase for packaging, toga-code-editor for the editor, and caerulea for Bluetooth.

Version 1 runs on the iPad (an iPhone uses the same build, untried so far), and on macOS as the test rig for the shared code; the Android build is in place and waiting for its first run on a phone.

Documentation

  • docs/installation.md: building the app and putting it on an iPhone, an iPad, or an Android phone.
  • docs/usage.md: pairing a board, each screen, and what the app's messages mean.

Setup

uv venv --python 3.14
uv pip install --group dev
scripts/build-toga-wheels.sh
uv pip install --group probe

The third line builds wheels into dist/toga/ for Briefcase: Toga's main branch, because the app runs on a pinned Toga commit for the display=none fix until the release after 0.5.7 and Briefcase installs only wheels on iOS and macOS, and the toga-console widget, because Gradle cannot install a source directory. The last line is optional and installs the bleak-based dev probe.

To work on toga-console alongside the app, clone it next to this checkout and run uv pip install -e ../toga-console over the pinned copy; for a Briefcase build, uv build --wheel --out-dir dist/toga ../toga-console replaces the pinned wheel. For caerulea, uv pip install -e ../caerulea does the same for development and tests; Briefcase builds still install the commit pyproject.toml pins.

Run

.venv/bin/briefcase dev

The first launch asks for Bluetooth permission. To pair a new board, press its reset button, and press it again when the light blinks blue quickly.

iOS

Briefcase generates the Xcode project, and Xcode puts the app on the iPad or iPhone. Signing, Developer Mode, and the bundle identifier for a first install are in docs/installation.md.

.venv/bin/briefcase create iOS
.venv/bin/briefcase open iOS

In Xcode, pick the device as the run destination and press Run. After changing the app's code, update copies it into the project. A plain update leaves the installed packages alone, so add -r after a requirement changes or the wheels are rebuilt:

.venv/bin/briefcase update iOS -r
.venv/bin/briefcase open iOS

Briefcase runs iOS apps only in the simulator, which has no Bluetooth, so the hardware tests run on the Mac and the Android phone instead.

Android

The app targets Android 12 and later:

.venv/bin/briefcase run android -d <device serial>

Pass -d with no serial to be shown the connected phones and pick one; leaving -d out altogether starts Briefcase's emulator, which has no Bluetooth. Briefcase runs the build it already has: after changing the app's code, add -u so it is updated first, and after rebuilding the wheels, add -r so the new wheels are installed and the app rebuilt (Briefcase re-reads the requirements only on create and update):

.venv/bin/briefcase run android -r -d <device serial>

After a change to the Android settings in pyproject.toml, such as build_gradle_extra_content, neither flag helps: Briefcase renders them only when it creates the project, so remove the project and let the next run create it again:

rm -rf build/pyscribble/android

The hardware tests run on the phone with the same board the Mac uses, after the app has been run once, allowed Nearby devices, and paired with the board:

.venv/bin/briefcase run android --test -d <device serial> -- -m hardware --board CIRCUITPY5919

Test

.venv/bin/ruff check . && .venv/bin/ruff format --check .
.venv/bin/pytest

With a bonded board nearby, the opt-in hardware tests check the transport and protocol against the real thing. They write one scratch file and delete it:

.venv/bin/pytest -m hardware --board CIRCUITPY -v -s

docs/manual-checks.md lists the checks that need a person.

About

Native CircuitPython Bluetooth editor.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages