Henrik Muehe 5926316a25 Fix: real-hardware bring-up issues found at 1920x1080 on the Pi
After testing the V09 redesign live on the Pi at onefinity.local
(1920x1080, Chrome fullscreen) several real bugs surfaced. This
commit fixes all of them.

Layout fits at 1920x1080
- Cap .app-shell at 100vh height with overflow:hidden so child
  flex containers actually constrain to one screen.
- Make .control-page / .program-page / .console-page use
  flex 1 1 auto + min-height 0 + overflow hidden so the page total
  no longer grows to ~36 000 px when the gcode-viewer is mounted.
- Override clusterize.css default max-height: 200px on the
  .clusterize-scroll element with max-height: none + flex 1 1 0 +
  height 100% so the gcode listing fills the available column.

E-Stop in the header
- The legacy estop.pug SVG had width=130 height=130 but no
  viewBox, so CSS-only sizing did nothing and the SVG content
  spilled ~26 px off the right edge of the screen and ~70 px
  below the header. Add viewBox="0 0 130 130" plus
  preserveAspectRatio so CSS sizing actually shrinks the inner
  geometry. Drop the octagonal clip-path (the SVG already
  carries its own yellow safety ring + EMERGENCY/STOP text).

3D toolpath preview (path-viewer)
- The legacy .path-viewer.small CSS clamped the canvas to
  340 x 150 floated into the corner. In the new program-body
  grid we want it to fill the 600 px right column. Override
  with width 100%, height auto, float none, !important.
- Make orbit.js wheel/touchstart/touchmove listeners
  {passive: false} so OrbitControls.preventDefault() actually
  works and the page no longer scrolls while panning the 3D
  view on a touch screen.

Vue 1 template + reactivity bugs exposed by the live data
- Replace v-else-if (Vue 1 has no v-else-if) in
  control-view.pug with three sibling v-if templates that
  mutually exclude on w.enabled and state['2an'] == 3.
- axis-vars._get_motor_id: guard motor.axis.toLowerCase()
  against undefined motors (initial config is [{}, {}, ...]).
- axis-vars._check_is_enabled: prefer config.motors[i].axis
  when present, fall back to state[N + 'an'] only for
  recognised axes (x/y/z/a) so undefined == undefined
  doesn't mistakenly enable b/c rows.
- program-mixin: tolerate state.files / state.gcode_list
  being undefined right after connect.

App-shell race conditions
- Skip the early parse_hash() in app.js ready() when the
  initial hash is in the settings family. Those Svelte
  components read settings.units / settings.probing-prompts /
  motion.* etc. and crash on first paint with the empty
  placeholder config. Stay on loading-view until update()
  completes and routes us in itself.

Misc
- src/static/js/ui.js: null-guard the legacy burger menu code
  (#menuLink no longer exists). Was throwing 'Cannot set
  properties of null (setting onclick)'.
- src/static/css/Audiowide.css: switch the gstatic font URL
  from http:// to https:// so it isn't blocked as mixed
  content under the home.muehe.org HTTPS proxy.
- Macro buttons: drop the default 6 px yellow border-left.
  The stripe now only appears via .has-color when
  state.macros[i].color is actually configured. Removes the
  asymmetric/lopsided look from the screenshot.

Tested live on http://10.1.10.55/ and via the HTTPS proxy at
https://onefinity.home.muehe.org/.
2026-04-30 22:24:55 +02:00
2026-04-30 11:17:03 +02:00
2026-04-30 21:33:48 +02:00
2020-08-27 23:20:27 -04:00
2020-08-27 23:20:27 -04:00
2020-08-27 23:20:27 -04:00
2023-02-12 14:01:05 +05:30
2025-09-21 01:57:17 +05:30
2025-09-21 01:57:17 +05:30
2020-08-27 23:20:27 -04:00
2020-08-27 23:20:27 -04:00

OneFinity CNC Controller Firmware (W-axis fork)

This is the OneFinity / Buildbotics bbctrl firmware with a virtual W axis driven by an auxcnc ESP32 over USB serial. See docs/AUX_W_AXIS.md for the design and config.

Layout

src/avr/        AVR firmware (motion controller, AtxMega)
src/boot/       AVR bootloader
src/bbserial/   Linux kernel module for the bbserial driver
src/py/bbctrl/  Python control daemon (Tornado + websockets)
src/js/         Vue.js UI (legacy)
src/svelte-components/  Newer Svelte UI for dialogs and settings
src/pug/        Pug templates compiled into build/http/index.html
src/resources/  Static assets and config templates
scripts/        Install / update / RPi build helpers
docs/           Architecture, dev setup, W-axis docs

Build & flash (quick path, macOS or Linux)

The full build (make) requires avr-gcc, but the controller and UI only depend on the Python + web parts. If you're shipping a UI/Python change you don't need the AVR toolchain.

Prerequisites

  • Node.js (any recent LTS) with npm
  • Python 3 with setuptools
  • npm install once at the project root (this is wired into the node_modules Make target, but on a fresh checkout it's clearer to do it explicitly)
npm install
(cd src/svelte-components && npm install)

macOS gotcha: esbuild platform pin

The Pi build leaves node_modules/esbuild pinned to linux-arm64, which won't run on Darwin. If npm run build inside src/svelte-components complains about esbuild, reinstall it for the host:

cd src/svelte-components
rm -rf node_modules/esbuild
npm install esbuild@0.14.49 --no-save

(Use the version that matches package-lock.json.)

Build the web UI + Python sdist

# Build the Svelte components
(cd src/svelte-components && npm run build)

# Render pug templates and copy assets into build/http
make all          # AVR step will fail without avr-gcc; safe to ignore
                  # if you didn't change anything under src/avr or src/boot

# Package
./setup.py sdist
ls dist/bbctrl-*.tar.bz2

make pkg is the canonical target but it tries to build AVR first. On hosts without avr-gcc, run the steps above directly.

If bbctrl-*.tar.bz2 is missing src/bbserial/bbserial.ko, copy the prebuilt .ko from a previous official release into src/bbserial/ before running setup.py sdist (the install script on the controller just installs the existing module if a newer one isn't shipped).

Flash to a controller

curl -X PUT -H "Content-Type: multipart/form-data" \
  -F "firmware=@dist/bbctrl-1.6.7.tar.bz2" \
  -F "password=onefinity" \
  http://onefinity.local/api/firmware/update

…or use the Make target:

make update HOST=onefinity.local PASSWORD=onefinity

The controller stops bbctrl, untars the package, runs scripts/install.sh, and brings the service back up. Total downtime is ~30-45s. Watch progress at http://<host>/ (you'll get 404s while bbctrl restarts, then the new UI).

Verify the flash

curl -s http://onefinity.local/ | grep -c "OneFinity"
curl -s http://onefinity.local/api/aux/status   # if W axis is enabled

Build & flash (full path, Debian/Linux)

For AVR + GPlan rebuilds, see docs/development.md. That path uses qemu + chroot to cross-compile gplan for ARM and needs the gcc-avr / avr-libc toolchain.

W axis (auxcnc)

This fork adds a virtual W axis. See docs/AUX_W_AXIS.md for:

  • G-code surface (G28 W0, G1 W25, etc.)
  • The G-code preprocessor and hook architecture
  • aux.json keys
  • REST API (/api/aux/*)
  • UI surface (jog row in Control, settings panel in Settings)
  • Edge cases (ESP reboot mid-job, limit closed at home start, …)
Description
Onefinity CNC controller firmware (fork of OneFinityCNC/onefinity-firmware) with W axis (auxcnc) integration, hooks, build/flash docs, and V09 UX redesign.
Readme GPL-2.0 9.6 MiB
Languages
C 37.4%
JavaScript 22.5%
Python 22.5%
Pug 5.3%
Svelte 4%
Other 8.2%