Pass -nocursor to startx so the mouse pointer never appears on the\nOnefinity touchscreen. Patched in all three boot paths: rc.local.fast\n(active), legacy rc.local, and the setup_rpi.sh bootstrap.
Pi's onboard chromium is 72 (Jan 2019). Two issues:
1. Python 3.5's mimetypes doesn't know woff/woff2/ttf, so Tornado
serves them as application/octet-stream which chromium 72 refuses
to use as web fonts -> all FA6 icons render as empty boxes. Add
scripts/deploy/patch_font_mime.py that monkey-patches bbctrl
Web.py's StaticFileHandler with correct content types. Run
automatically by deploy-hardware.sh (idempotent).
2. flex-gap landed in chromium 84. Add '> * + *' margin fallbacks
for the flex containers that show up on Program tab (action-bar,
action-btn, file-bar, file-btn) and tighten the kiosk-mode
settings rail so all 14 items fit in 768px height.
Round-3 cold-boot trims:
- mask sysstat.service (sadc CPU/IO logger; nothing reads it).
- mask dphys-swapfile.service and add /var/swap to /etc/fstab so swap
is brought up by systemd at local-fs.target instead of by an LSB
wrapper that re-checks the swap file size on every boot.
Both are reversible: `systemctl unmask <unit>` and remove the fstab
line. Before doing the dphys swap, install.sh verifies /var/swap
exists; on a fresh image where the file hasn't been created yet,
nothing is changed and dphys-swapfile keeps running normally.
Userspace boot 11.5s -> 10.7-11.4s on clean runs; bbctrl listen
unchanged at boot+10.4s (the saving moves to chromium/multi-user).
Persist the cold-boot wins (was: only manually deployed via
tmp/20260501_restart_timing/deploy-fast.sh, would silently revert on
the next prod firmware update).
- Install bbserial-rebind.service alongside bbctrl.service and enable
it. Eliminates the rc.local bbserial reload mid-boot.
- Prefer scripts/rc.local.fast over scripts/rc.local when present.
Legacy rc.local left as a fallback for old firmware tarballs.
- Mask plymouth-read-write, plymouth-quit-wait, and raspi-config.
Together these were ~6s of userspace startup that bought nothing
on a deployed Onefinity Pi.
Cumulative: bbctrl listening at boot+10.6s (was 20.6s), userspace
boot 11.5s (was ~13s), bbctrl.service @2.9s in critical-chain (was
@6.5s after the first optimisation pass).
Measured on onefinity.local (Pi 3, Raspbian Stretch, bbctrl 1.6.7).
Before -> after:
bbctrl listen boot+20.6s -> boot+12.4s (-8.2s)
host -> /api/config/load 28.2s -> 22.5s (-5.7s)
The 4 changes (each independently revertable):
1. scripts/bbserial-rebind.service: do the bbserial unbind + reload
in a dedicated unit ordered Before=bbctrl.service, instead of in
rc.local AFTER bbctrl is already listening on the serial port.
Eliminates a full bbctrl restart mid-boot.
2. scripts/bbctrl.service: drop "After=network.target". bbctrl talks
to the AVR on a local serial port and to the LCD on I2C; it does
not need DHCP / network-online to come up. Also adds explicit
ordering after the new bbserial-rebind unit.
3. scripts/rc.local.fast: trimmed rc.local that no longer touches
bbserial and backgrounds 'startx' so chromium launches in
parallel with bbctrl rather than after rc.local finishes.
4. src/py/bbctrl/Planner.py: lazy-import camotics.gplan. Costs ~130ms
on cold cache, deferred from import-time to ctrl.mach init.
5. (bonus) src/py/bbctrl/Log.py: tolerate FileNotFoundError in
_rotate(). The improved boot path exposed a pre-existing log
rotator bug that crashed bbctrl on first start when bbctrl.log.16
was missing.
Add a lightweight, self-contained phase tracer for measuring end-to-end
bbctrl restart and Pi boot time. Disabled by setting BBCTRL_TRACE=0.
- src/py/bbctrl/Trace.py: monotonic-anchored event log + sd_notify helper.
- bbctrl/__init__.py: marks for imports, args parsed, ioloop, web init,
listen, and an sd_notify READY=1 once HTTP is bound.
- bbctrl/Ctrl.py: spans around each subsystem (avr, i2c, lcd, mach,
preplanner, jog, pwr, hooks, aux, mach.connect).
- bbctrl/Comm.py: avr.firmware_rebooted mark.
- bbctrl/Web.py: TimingHandler (GET /api/diag/timing) and
UITimingHandler (PUT /api/diag/timing/ui), plus a ws.first_open mark.
- src/js/restart-timing.js + app.js: UI-side performance.now() marks
(script.load, ws.open, ws.first_msg, ui.first_state, window.load),
posted once to the controller.
- scripts/bbctrl.service: stdout/stderr -> journal so TRACE lines are
visible via journalctl -u bbctrl. (Was StandardOutput=null.)
Revert: git revert this commit. To disable at runtime without
reverting, set BBCTRL_TRACE=0 in the bbctrl service environment.
UX
- The V09 redesign already exposed the W axis in the Control jog grid
(row 4 when w.enabled) and as a row in the DRO table. The Settings
shell now also surfaces a dedicated 'W Axis' rail entry that smooth-
scrolls to the W Axis (auxcnc) section of the main settings page.
The rail item is marked active only while the user is on Display &
Units AND the W Axis link was the most recent click.
- The W Axis section in src/svelte-components/src/components/Settings
View.svelte gets an id="w-axis" anchor so the scroll lands cleanly.
Tested live against onefinity.local. Aux status reports
{enabled: true, present: true, pos_mm: 43.96, homed: false}; the W
axis row appears in the DRO with the right purple styling, and the
jog row 4 shows W- / Home W / W+ / Probe.
Deploy scripts
- deploy.sh dispatches to scripts/deploy/{local,hardware,prod}.sh
with shorthand wrappers (deploy-local.sh / deploy-hardware.sh /
deploy-prod.sh).
- local: builds the UI bundle and serves build/http/ via
python3 -m http.server 8770 in a tmux session 'onefin-local'.
Useful for visual iteration on macOS — chrome only, no controller.
- hardware: rsyncs the freshly built build/http/ tree onto the Pi at
onefinity.local and restarts bbctrl. Stages to /tmp on the Pi and
uses sudo to install into the running egg's bbctrl/http directory,
so iteration time is ~5 seconds.
- prod: requires a clean working tree, then runs 'make pkg' followed
by 'make update HOST=onefinity.local PASSWORD=onefinity'.
Defaults can be overridden with environment variables (HOST, PASSWORD,
REMOTE_USER for the hardware path).