dyadmisha
synced commits to backend-fluidnc-http at dyadmisha/dune-weaver from mirror
9fe64d2cce feat(touch): wire touch app directly to FluidNC firmware HTTP API
Replace the dune-weaver host FastAPI dependency with direct
communication to the headless FluidNC sand-table firmware. The QML
interface (properties/slots/signals) is preserved unchanged.
- firmware_client.py: shared async HTTP client singleton (status,
$-commands, /sand_* routes, /upload file-ops, LED + clear-mode maps)
- discovery.py: mDNS auto-discovery of _http._tcp tables (model=dune-weaver)
- thr_preview.py: render .thr polar paths to cached PNG previews
- backend.py: WebSocket status -> /sand_status polling; all actions
remapped to firmware; local screen/LCD control kept
- models: PatternModel/PlaylistModel now firmware-backed
- requirements (+zeroconf), .env.example, run.sh, README, .gitignore
- FIRMWARE_MIGRATION.md: progress notes, mapping decisions, follow-ups
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
613070a8ce feat: delegate all execution to FluidNC firmware; drop serial and host GPIO LEDs
Rework the backend into a thin proxy + status observer over the FluidNC
firmware HTTP API. The board now owns kinematics, .thr playback, playlist
sequencing, pre-execution clears, quiet hours, auto-home and homing; the
backend's job is the continuous/historical layer the headless firmware omits
(previews, play history, MQTT/HA, WLED, mDNS multi-table, file management).
Execution (new modules/core/execution.py):
- Command proxy: run_pattern ($Sand/Run), start_playlist ($Playlist/* NVS +
$Playlist/Run, idle-gated so run-while-running stops first), stop/pause/
resume/skip, set_speed, move_polar.
- translate_status(): pure /sand_status -> /ws/status mapping (strips GRBL
substate suffixes like "Hold:0").
- BoardObserver: single poll loop (1s active / 2s idle) that logs play
history on file transitions, runs the clear-speed shim, the WLED
quiet-hours watcher, and broadcasts. Replaces the host sequencing loop,
board_status_poller and broadcast_progress.
Removed (~1900 lines): pattern_manager execution core + MotionControlThread,
playlist_manager.run_playlist, state stop/skip event machinery and the
serial/kinematics/dw_led/auto_play fields, fluidnc_config.py, the dw_leds
NeoPixel stack, the debug-serial block, /api/fluidnc/*, /controller_restart,
SetupPage.tsx. Live queue editing dropped (/reorder_playlist + /add_to_queue
removed; NowPlayingBar queue read-only; dnd-kit removed). Serial terminal
replaced by a firmware command console (POST /api/board/command). Dropped
pyserial and all Adafruit/RPi GPIO deps.
Settings: board NVS is canonical for table-behavior settings shared with the
mobile apps. New modules/core/board_settings.py syncs auto-play on boot
($Playlist/Autostart*), Still Sands quiet hours ($Sands/*), the board clock,
and mirrors playlists/clear files to the board SD. Web Settings adapted from
the mobile app; "Device Connection" is now a board-address field.
LEDs: new board provider (modules/led/board_led_controller.py) drives the
table's own ring via the firmware, duck-typed to the existing /api/dw_leds/*
contract. Added the firmware-native "ball" tracker (blob that follows the
sand ball) with blob/background colour, brightness, direction, alignment,
glow size and background sub-effect; all params persist to board NVS. WLED
kept; host GPIO NeoPixels removed.
Also: atomic metadata-cache writes (fixes truncation on kill mid-write that
forced full preview regeneration).
Verified live on the FluidNC board and via unit tests (143 passing).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
e317f0ed10 chore: add generated pattern previews and time-based LED brightness script
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4b852bcbe0 feat: drive FluidNC board over HTTP instead of streaming G-code
The backend now delegates pattern execution to the FluidNC firmware:
FluidNCClient talks to the board's HTTP API ($SD/Run + /sand_status
polling) instead of streaming coordinates over serial/websocket with
Python-side kinematics. Adds a configurable board_url in state, an
idle-rate board status poller, and reworks the connection manager and
pattern manager accordingly. main.py also wires mDNS discovery into
the app lifecycle and adds GET /api/discovered-tables.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fa9b74d937 feat: mDNS auto-discovery of tables
Each backend advertises itself as _dune-weaver._tcp.local. and browses
for peers (modules/core/mdns_discovery.py, best-effort if zeroconf is
missing). The frontend merges live peers into the table selector: an
mDNS announcement marks a saved table online and refreshes its URL
(heals DHCP address changes), and switching to a discovered table
persists it to known-tables first. Clearer error when the entered
address is a controller board rather than a Dune Weaver server.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- View comparison for these 10 commits »
1 week ago