Pimoroni Galactic Unicorn (53x11 LED matrix) on a Raspberry Pi Pico W running MicroPython. Weather clock: open-meteo forecast rotated with a clock and a hi/lo screen.
- Never read, print, or commit
secrets.py(WiFi credentials, location,SCD41_ALTITUDE_M). It is gitignored; the board holds the only copy. Variable contract + how to create it:secrets.example.pyand README "Board configuration" — fill the template, upload host -> board, delete local. - Board code must stay MicroPython-compatible: no CPython-only stdlib, match
the existing
%-formatting style, keep thesrc/drawing modules (render.py,weather.py,matrix.py,scenes.py) free of board imports (they also run on the host insim/). - The SCD41 driver is frozen into Pimoroni's MicroPython firmware
(
breakout_scd41,pimoroni_i2c) — do not vendor a copy; the sim mocks those two modules (sim/run_main.py). - The board runs
main.pyplus the modulesscripts/deploy.shuploads (the manifest there is the single source of truth — flash root only).
- Board attach (Windows host + WSL2, usbipd):
scripts/attach.sh(busid auto-detected by USB vendor 2e8a;usbipd bind <busid>is needed once per Windows boot, as admin; re-attach after everympremote reset). Board shows up as/dev/ttyACM0. If missing/unresponsive:skills/mpremote/SKILL.md. - Deploy:
scripts/deploy.sh→ uploads everything on its manifest (main.py+ thesrc/services), thenmpremote reset. It fails fast with the attach hint if the board is not usbipd-attached (/dev/ttyACM0missing). File management:skills/mpremote/SKILL.md. One-off display snippets:skills/unicorn/. - Preview display changes in sim/ before deploying — not as a fallback for
a detached board, but because you can actually see what the matrix will
show, using the exact
src/render code and real bitmap6 font metrics:python3 sim/sim.py print --screen weather --code 61 --temp 21 --frames 8writes plain ASCII frames to stdout for agent analysis;python3 sim/sim.py play ...animates in the terminal. Render the whole rotation loop (realmain.py, fully mocked) to a GIF for reviews:python3 sim/run_main.py --seconds 18 --gif /tmp/rotation.gif(needs Pillow). In agent sandboxes the ambientLD_LIBRARY_PATHcan point at an incompatible libstdc++ (e.g. the editor's), which breaks Pillow's libLerc withGLIBCXX_3.4.29 not found; run with a clean env instead:env -i HOME=$HOME PATH=/usr/bin:/bin:/usr/local/bin python3 ...— same forpython3 -m unittest discover -s testsso the Pillow-dependent GIF test actually runs instead of skipping. - Run the tests with any display change:
python3 -m unittest discover -s tests -v— bitmap property checks, golden ASCII dumps, tz DST rules, and a mocked full run ofmain.py. - Recordings are never committed (
frames/,*.gifgitignored — the one exception is the tracked README demodocs/demo-rotation.gif). For a pull request, generate a GIF on demand and attach it, e.g.python3 sim/before_after.py --ref main --out /tmp/pr→ attach e.g./tmp/pr_weather_compare.gifto the PR.
Most contributions here come from agents — this file is the contract:
- Branch off
micropython:git checkout -b feat/my-change micropython(fix/...for fixes). Never push tomain/micropythondirectly. - Clean commit queue: small, atomic commits, one logical change each,
<type>: <what>messages (feat:,fix:,docs:,refactor:,tests:,ci:,scripts:) — seegit logfor examples. - Before pushing, run
python3 -m unittest discover -s tests -vand preview any display change insim/(above). - Push the branch and open the PR against
micropython. CI (.github/workflows/pr-sim.yml, triggered by changes tomain.py/src//sim//tests/) runs the tests and posts before/after GIFs of every changed screen inline on the PR (artifactsim-before-after; screens pixel-identical to the base produce no GIFs). For icon changes, also do a HITL pass on the physical board:python3 skills/unicorn/display.py --iconsafterscripts/deploy.sh --no-reset(so the board runs your render code), thenmpremote resetto return to the clock.micropythonis protected by a ruleset: one approving review and all threads resolved are required; merges are rebase-only with required linear history (no squash — the atomic commits from step 2 are what lands); deletion and non-fast-forward pushes are blocked; themicropython-checkstatus (workflow of the same name) must be green and up to date (strict policy). So before asking for review / merging, rebase:git fetch origin && git rebase origin/micropythonand re-push. - If the change affects rendering, regenerate the README demo GIF in the same
branch:
python3 sim/run_main.py --seconds 18 --delay 0.12 --gif docs/demo-rotation.gif. Themicropython-checkworkflow runs on the PR and on push tomicropython(.github/workflows/micropython-check.yml→sim/check_demo_gif.py) and fails if code and GIF disagree — it must be a required check in branch protection to actually block the merge.tests/runs the same comparison locally (skipped without Pillow).
main.py— board entry point (WiFi/NTP/open-meteo/SCD41 + dashboard loop), thinsrc/render.py— core drawing (clock, CO2, hi/lo, boot); pure functions taking a PicoGraphics-likedsrc/weather.py— weather icon art;src/matrix.py— matrix rain;src/scenes.py— dashboard composition and widgetssrc/tz.py— EU DST offset, pure integer math (no tzdata on the board)sim/— host simulator:sim.py,font6_data.py(Pimoroni font6),run_main.py(mocked full run of main.py),before_after.py(PR GIFs)tests/— unittest suite, host-only (python3 -m unittest discover -s tests -v)scripts/— attach.sh, deploy.shskills/,docs/— board access via mpremote (mpremote), the unicorn board itself (unicorn), flashing notesfirmware/— local .uf2 copy (gitignored)
main, micropython (PR target — active work happens on short-lived
feat/* / fix/* branches merged into it).
Check git branch before committing; do not push without asking.
PR flow: see "Pull requests" above.