Skip to content

appkit, touchkit and System: run on CircuitPython boards - #46

Merged
bdbarnett merged 1 commit into
mainfrom
cp-system
Nov 10, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
cp-system

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Home and System now run on a CircuitPython board, under the same code.py lines a MicroPython board uses in its main.py (TouchLauncher, scan("apps"), boot(), appkit.serve()). On twin boards, System's interpreter line tells them apart: "CircuitPython 11.0.0-alpha.2" against "MicroPython 1.30.0".

What changed: touchkit.net reads the address, signal and hostname from wifi.radio where there's no network module. System shows CircuitPython's pre-release, which sys.implementation.version leaves out. appkit's scope finds the built-in lvgl on CircuitPython, so an app's LVGL objects close with it. The launcher can now restart there: it keeps the next app's name in /data/.next_app, then calls supervisor.reload(), or microcontroller.reset() from a callback, where the reload's exception would be caught. That makes the memory restart work, and plain scripts from the home screen (that roadmap item is done). Ctrl-C ends code.py on CircuitPython, display and all, so appkit.serve() also runs lines typed on the console while the apps keep going. import apps.system; apps.system.stats() answers that way.

Checked on a Waveshare ESP32-S3-Touch-LCD-4.3 (800x480) running CircuitPython 11.0.0-alpha.2. code.py boots Home, and System opens in 761 to 914 ms at about 25 fps. The arc turned between two camera frames, and the motion card's label reads "CircuitPython 11.0.0-alpha.2". stats() returned the IP, -36 dBm, 41 °C and the heap over the console. A restart from the top level and one from a timer callback each came back in the app asked for, with restarts at 1. A one-line script app ran and came back to Home. appkit's tests pass on CPython. I didn't check BOOT going home: this board's CircuitPython config has no boot_button, and touchkit's BOOT handler needs machine.Pin. The WebREPL row reads "off" there, which is true: CircuitPython has the web workflow instead.

Home and System ran on a Waveshare ESP32-S3-Touch-LCD-4.3 under
CircuitPython 11.0.0-alpha.2 with a few gaps. These close them.

touchkit.net reads the address, signal and hostname from wifi.radio
where there is no network module, so System's network rows and stats()
work. System shows CircuitPython's pre-release in its interpreter line
("CircuitPython 11.0.0-alpha.2"), which the version tuple leaves out.
appkit's scope finds the built-in lvgl module on CircuitPython too, so
an app's LVGL objects are closed with it.

The launcher can now restart on CircuitPython: the next app's name goes
in /data/.next_app, then supervisor.reload(), or microcontroller.reset()
from a callback. That makes the memory restart and plain scripts from
the home screen work there. Ctrl-C ends code.py on CircuitPython, so
appkit.serve() also runs lines typed on the console while the apps keep
going, and apps.system.stats() answers from it.

Checked on the board: code.py boots Home, System opens (761-914 ms,
25 fps, the arc turning), stats() answers over the console, a restart
from the top level and one from a timer both land in the app asked for,
and a script app runs and comes back to Home. appkit's tests pass on
CPython.
@bdbarnett
bdbarnett merged commit 61b2bc5 into main Nov 10, 2026
6 checks passed
@bdbarnett
bdbarnett deleted the cp-system branch November 10, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant