mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-19 07:33:18 +02:00
v0.2.2b3
199
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b3a91d7314 |
Revert "v0.2.2b1 (#602)" (#603)
This reverts commit
|
||
|
|
3dd1ffb485 |
v0.2.2b1 (#602)
* feat(queue): show spool grams left in filament slot mapping
* Bumped version
* Add SpoolBuddy AMS slot config, external slots, and dashboard redesign
- AMS page: external spool slots (Ext/Ext-L/Ext-R), click-to-configure
modal on all slots, temperature/humidity threshold-colored indicators,
nozzle L/R badges for dual-nozzle printers, compact AMS-HT layout
- Dashboard: two-column layout with device status + printers list (left)
and current spool card (right), state-colored scale/NFC icons, dashed
border card styling
- Daemon: suppress redundant scale reports (±2g threshold + stability
state change detection) to prevent weight display bouncing
- TopBar: auto-select online printers only, SpoolBuddy logo
* Fix SpoolBuddy daemon crash when read_tag module is missing
NFCReader.__init__ imported read_tag and instantiated PN5180() outside
the try/except block, so a missing module crashed the entire daemon.
Moved the import inside the existing try/except so the daemon gracefully
skips NFC polling — matching the scale reader's existing behavior.
* Fix SpoolBuddy daemon failing to import hardware drivers
The daemon imports read_tag and scale_diag as bare modules, but they
live in spoolbuddy/scripts/ which isn't on sys.path when systemd runs
the daemon. Added scripts/ to sys.path at startup, resolved relative
to the module file. Also moved the read_tag import inside NFCReader's
try/except (was crashing the daemon instead of skipping gracefully)
and demoted hardware-not-available messages from ERROR to INFO.
* Increase scale moving average window to reduce weight bouncing
5 samples at 100ms (500ms window) wasn't enough to smooth NAU7802 ADC
noise — the averaged value still varied by >2g between 1s report
intervals, and the stability state kept flipping, triggering a report
every cycle. Increased to 20 samples (2s window) so noise is smoothed
before reaching the reporting layer.
* Remove stability flipping as scale report trigger
When ADC noise kept the spread hovering around the 2g stability
threshold, the stable flag toggled every cycle, forcing a report with
a slightly different weight each time. Now only actual weight changes
of >=2g trigger reports. The stable flag is still included in each
report for consumers that need it.
* Fix formatting of option elements in FilamentMapping
* Minor Spoolbuddy frontend improvements
* Updated Spoolbuddy install script to strip down Raspbian
* Updated Spoolbuddy install script
* Add API key auth support to /auth/me for SpoolBuddy kiosk
When Bambuddy auth is enabled, the SpoolBuddy kiosk gets redirected to
the login page because ProtectedRoute requires a user from GET /auth/me,
which only handled JWT tokens. The kiosk daemon already has an API key
but couldn't use it to satisfy the frontend auth check.
- Backend: /auth/me now accepts API keys (Bearer bb_xxx or X-API-Key)
and returns a synthetic admin UserResponse with all permissions
- Frontend: AuthContext reads ?token= from URL on first load, stores in
localStorage, and strips from URL (prevents history/referrer leakage)
- Install script: kiosk URL now includes ?token=${API_KEY}
- Tests: 3 new integration tests (Bearer API key, X-API-Key header,
invalid key rejection)
* SpoolBuddy touch-friendly UI overhaul for 1024x600 kiosk display
Enlarge all interactive elements across 9 SpoolBuddy components to meet
44px minimum tap targets on the RPi touchscreen. Increase nav icons
(20→24px), labels (10→12px), bar heights, section headers, printer
buttons, spool visualizations, fill bars, and status indicators.
Compact the dashboard stats bar and remove the printers card. Add
fullScreen prop to ConfigureAmsSlotModal with two-column layout
(filament list left, K-profile + color right) to eliminate scrolling.
* Updated CI
* Fix naive-vs-aware datetime crash from 0.2.1 timezone migration
The timezone fix (
|
||
|
|
90b9523998 |
Updated commit message (now includes the test fix):
Fix camera button permissions & ffmpeg process leak (#550) Camera button on printer card was clickable without camera:view permission. ffmpeg processes (~240MB each) accumulated after closing camera streams because: (1) stop endpoint called terminate() without wait()/kill(), (2) HTTP disconnect detection only ran between frames so was blocked when the generator was stuck on stdout read, and (3) no mechanism caught processes orphaned by generator abandonment or app restarts. - Add camera:view permission check + tooltip to camera button - Fix stop endpoint: terminate() → wait(2s) → kill() → wait() - Add background disconnect monitor (polls every 2s, kills ffmpeg directly on disconnect) - Add periodic /proc scan (every 60s) that SIGKILLs any ffmpeg with rtsps://bblp: not in an active stream - Add noCamera i18n key to all 6 locales - Fix camera API test mocks for async wait() and pid attribute |
||
|
|
105beb0929 | Updated CI | ||
|
|
f8b2ebd695 | Added # nosec B108 suppressions for virtual printer tests | ||
|
|
f4f09ccc2d |
Hide unnecessary target model selector on "Any" tab (#528)
When scheduling a print to "Any {model}", a redundant "Target Model"
dropdown appeared even though the G-code is already sliced for a
specific printer model. Changing it would lead to print failures.
Hide the dropdown when slicedForModel is known — the tab label already
communicates the target. The dropdown still appears as a fallback for
legacy files without model metadata.
|
||
|
|
37d9b4c841 |
Fix manual spool weight overwritten by AMS auto-sync (#525)
Add weight_locked flag to spools that auto-sets when weight_used is explicitly updated via the API. Both the MQTT AMS remain% auto-sync and the manual force-sync endpoint skip locked spools. Usage tracker delta tracking is unaffected. Users can re-enable AMS sync by setting weight_locked to false. |
||
|
|
c2b7b6a99a |
Fix inconsistent print cost calculation on reprints (#505)
Three independent code paths wrote to archive.cost with conflicting strategies, causing the same model to produce different prices on each reprint (e.g. £0.77, £1.54, £2.03). - Remove add_reprint_cost (Path 3) — redundant cost accumulation that double-counted on top of usage tracker - Fix usage tracker (Path 2) — compute cost from current session's results only, not a SUM of all historical SpoolUsageHistory rows - Remove _reprint_archives tracking set from main.py - Update test mocks to match simplified query pattern archive.cost now always reflects the cost of a single print. |
||
|
|
ed36eafbec |
Fix timestamps off by timezone offset in non-UTC containers (#504)
All backend timestamps used datetime.now() (server local time) or the deprecated datetime.utcnow(). The frontend's parseUTCDate() assumes timestamps without timezone indicators are UTC and appends 'Z', so stored timestamps were off by the timezone offset when the container's timezone wasn't UTC. Backend: replaced datetime.now() and datetime.utcnow() with datetime.now(timezone.utc) across 16 files (~80 call sites) for all database fields and DB comparisons. Cosmetic timestamps (filenames, user-facing local time formatting) intentionally left as local time. Frontend: replaced 13 new Date(backendTimestamp) calls with parseUTCDate() across 8 files to correctly interpret UTC timestamps. |
||
|
|
4cf76c53c7 | Updated conftest.py | ||
|
|
faff453dec |
Fix bed cooled notification never triggering (#497)
The bed cooldown monitor was defined at the end of on_print_complete, after an early return that exits when no archive is found. Prints started from BambuStudio or the printer's touchscreen have no archive, so the function returned before the bed cooldown task was ever created. Moved the bed cooldown block (function def + task creation) to before the archive_id early-return so it fires for all completed prints. Also hardened the temperature dict check from truthiness to isinstance. |
||
|
|
8e6a959eef | Redact IP addresses from support bundle debug logs | ||
|
|
38af5df050 |
Add filament override for model-based queue assignment (#486)
When scheduling a print to "any printer" (model-based assignment), users can now override the 3MF's original filament choices per slot. The override dropdown shows compatible filaments loaded across all printers of the selected model, filtered by type and nozzle (H2D). The scheduler matches against overridden type/color instead of the original 3MF values, preferring printers with exact color matches. Backend: - New GET /printers/available-filaments endpoint (aggregates loaded filaments across printers of a model, includes extruder_id for dual-nozzle nozzle-aware filtering) - New filament_overrides JSON column on print_queue table - Scheduler applies overrides before AMS mapping, clears tray_info_idx on overridden slots so color matching takes priority - Printer selection prefers printers with most override color matches Frontend: - New FilamentOverride component with per-slot override dropdowns - Type-filtered options (PLA slots only show PLA) - Nozzle-aware filtering (H2D: only shows filaments on correct extruder) - Integrated into PrintModal for model-based queue mode Tests: - 11 backend unit tests (color match counting, override application) - 12 frontend tests (rendering, type/nozzle filtering, interactions) i18n: All 6 locales (en, de, fr, it, ja, pt-BR) |
||
|
|
294bd74940 |
Fix AMS slot auto-config falling back to Generic instead of spool's slicer preset
Two bugs caused spool assignments to always configure AMS slots with generic Bambu filament IDs (e.g. GFB99 "Generic ABS") instead of the spool's actual slicer preset: 1. PFUS* IDs (cloud-synced custom presets) were blanket-rejected and replaced with generic IDs in both assign_spool and configure_ams_slot 2. Generic fallback IDs (GFB99, GFL99, etc.) were treated as "good" presets by the slot-reuse logic, making them sticky once set New priority: spool's own slicer_filament > slot's non-generic preset (same material) > generic fallback. |
||
|
|
0e87c377e6 |
Add developer LAN mode detection and warning banner
Parse the MQTT "fun" field bit 0x20000000 to detect whether connected printers have Developer LAN Mode enabled. Show a persistent orange warning banner when any printer lacks it, since newer firmware silently rejects MQTT write commands without developer mode. - Parse fun field into developer_mode on PrinterState - Add /printers/developer-mode-warnings lightweight polling endpoint - Include developer_mode in printer status API and support bundle - Orange banner with affected printer names and wiki link - Translations for all 6 locales (en, de, fr, it, ja, pt-BR) - 7 backend + 4 frontend tests |
||
|
|
055243683c |
Fix archive endpoints crash with "Is a directory" for BambuStudio prints (#475)
When FTP download of a 3MF fails (e.g. BambuStudio-initiated prints), the fallback archive has file_path="". Path.exists() on settings.base_dir / "" resolves to the base directory itself and returns True, so ZipFile() then fails with [Errno 21] Is a directory. Replace .exists() with .is_file() across all 15 archive route checks and 1 in main.py. Add file_path truthiness guard for finish photo capture to prevent saving photos under the base directory. |
||
|
|
7c5741b23c |
Fix wrong AMS unit displayed with dual AMS on P2S (#420)
P2S firmware sends local slot IDs (0-3) in tray_now, not global tray IDs, when multiple AMS units are connected. The UI highlighted the wrong AMS unit (e.g., AMS-A instead of AMS-B). Usage tracking was unaffected because it uses the MQTT mapping field. Added disambiguation in _handle_ams_data for single-nozzle printers with ams_exist_bits indicating >1 AMS: cross-references tray_now with the MQTT mapping field (snow-encoded) to resolve the correct global tray ID. Falls back to raw value when no mapping is available or ambiguous. No behavior change for single-AMS printers or dual-nozzle (H2D) printers. |
||
|
|
16fa84bc16 |
Add bulk spool addition and stock spools
Add Quick Add mode to the spool form for simplified entry (material + color + weight only), and a quantity field (1-100) for creating multiple identical spools at once. Stock spools (no slicer profile) are computed rather than stored — any spool without slicer_filament shows an amber "Stock" badge. New filter chips (All/Stock/Configured) on the inventory page. Backend bulk endpoint creates N spools in one transaction. Backend: - SpoolBulkCreate schema with quantity validation (1-100) - POST /inventory/spools/bulk endpoint Frontend: - Quick Add toggle in SpoolFormModal (create mode only) - Quantity field in FilamentSection (both modes) - bulkCreateSpools API method and bulkCreateMutation - Stock column (hidden by default) and stock filter chips - Inline error rendering moved into FilamentSection - CellCtx extended with t() for translatable cell content Tests: - 13 backend tests (schema validation + endpoint logic) - 10 frontend tests (validateForm quickAdd + UI behavior) i18n: 6 locales (en, de, fr, it, ja, pt-BR) Docs: CHANGELOG, README, website features, wiki inventory |
||
|
|
7d46b44561 | Fix PCTG filament misidentified as PC (#478) | ||
|
|
608a10eabb |
Fix filament not deducted from backup spool after runout auto-switch (#459)
When a spool runs empty mid-print and the AMS auto-switches to a backup, the entire print weight was attributed to the original spool. Track tray changes during the print via tray_change_log on PrinterState, then split the 3MF weight across trays using per-layer gcode segment boundaries at print completion. Falls back to linear layer-ratio splitting when gcode data is unavailable. |
||
|
|
839be41133 |
Fix support bundle leaking personal data (#473)
The log sanitizer only used regex patterns, missing arbitrary user-chosen strings (printer names, usernames). Tasmota smart plug credentials were logged verbatim in URLs by httpx. - Make _sanitize_log_content() database-aware: query Printer names/serials, User usernames, and Bambu Cloud email for exact-string replacement (longest-first, skip <3 chars to prevent over-redaction) - Fix serial regex leaking first 3 chars (remove capture group partial redaction), add case-insensitive flag - Move Tasmota credentials from URL-embedded (http://user:pass@host) to httpx auth= parameter so they never appear in logs - Add URL credentials regex as defense-in-depth for user:pass@ in logs - Add 'username' and 'path' to settings sensitive_keys filter (catches smtp_username, slicer_binary_path in support-info.json) |
||
|
|
6ab48fa338 | Updated CI | ||
|
|
85645ce184 | Merge branch '0.2.1b2' into feature/cost_tracker | ||
|
|
53c826d1d1 | Add integration tests for cost tracking with archive_id and print_name fallback; implement cleanup fixtures for temporary files | ||
|
|
3f201594f1 |
Fix spool usage lost when spool runs empty mid-print (#459)
When a spool ran empty during a print and the AMS auto-switched to a backup, on_ams_change eagerly deleted the SpoolAssignment (fingerprint mismatch). on_print_complete then queried the now-deleted assignment and silently dropped usage. Snapshot all spool assignments into PrintSession at print start. At completion, prefer the snapshot over live DB queries in both the 3MF primary path and the AMS remain% delta fallback. Fall back to live query for backward compatibility with in-flight sessions started before upgrade. |
||
|
|
1dd266b66e | Refactor functions in cost statistics integration tests | ||
|
|
e4e6e9f8c4 |
Decouples file uploads and print start commands so that they run in the background asynchronously. When a print is started, the print modal no longer waits for the print to upload and start. Instead, a new toast-based UI appears with the status of prints being dispatched. Prints being dispatched can be cancelled during upload. If cancelled, the partially-uploaded gcode is deleted from the printer automatically before the FTP connection is closed.
This allows users sending particularly large prints to slow printers such as the P1-series to start a print and then move onto another task in Bambuddy immediately (such as starting more prints on more printers). It also gives the user visibility into what's happening instead of a loading indicator appearing for an indefinite period of time. The new toast-based UI uses websockets to update in real time. It will also appear for other users / instances of Bambuddy, not just the user who started the prints, allowing more transparency and handling cases where the user closes the page and then comes back wanting to know the status of the dispatching. fix: review fixes for background dispatch PR #408 - Restore missing imports in main.py (inventory, print_log, virtual_printers, mqtt_smart_plug_service) - Guard voidresp() for A1 printers to prevent hang after upload - Don't fail upload on voidresp() error since data transfer already completed - Add ams_mapping to register_expected_print calls for Spoolman usage tracking - Fix cancel_job TOCTOU race by using single lock acquisition - Fix batch counter reset TOCTOU by re-checking condition inside second lock - Add backgroundDispatch translations to fr.ts and pt-BR.ts - Remove dead upload_progress_callback definitions - Skip redundant "Print queued" toast in reprint mode (dispatch toast handles it) - 5 backend tests: cancel_job single-lock TOCTOU, batch reset re-check, job lifecycle - 2 FTP regression tests: voidresp error handling (upload-loop fix), A1 model voidresp skip - 1 frontend test: reprint toast suppression - CHANGELOG: background dispatch feature + test coverage entries - README: add background dispatch to Scheduling & Automation - Website: add feature item to Automation section - Wiki: add Background Print Dispatch section to print-queue.md |
||
|
|
4a625c1ef2 | Add background print dispatching + tests | ||
|
|
071c2c702a | Refactor cost calculation logic to utilize pre-fetched spool usage costs and remove redundant imports; update InventoryPage to adjust cost display format | ||
|
|
8043bb18ba | Refactor cost calculation logic to prioritize spool usage history and update schema validation for cost_per_kg | ||
|
|
0e50285860 | Merge branch '0.2.1b' into feature/cost_tracker | ||
|
|
04ffca204f | Add cost tracking for spools and usage history | ||
|
|
7b39026429 |
fix: resolve PFUS preset IDs causing slicer slot resets + fill level for new spools
BambuStudio actively resets AMS slots configured with unrecognized PFUS* (user-local) preset IDs. Replace PFUS* with generic Bambu filament IDs (e.g. GFL99 for PLA) in both the slot configure and inventory assignment endpoints. When the slot already has a recognized cloud-synced preset for the same material, reuse it to preserve K-profile calibration. Also fix fill level bar not showing for brand new spools (weight_used=0) by changing the condition from weight_used > 0 to weight_used != null. |
||
|
|
c856badb84 |
fix: H2D tray_now disambiguation produces bogus IDs for AMS-HT (#364)
When the snow field hadn't arrived yet, the ams_extruder_map fallback computed ams_id * 4 + slot for AMS-HT units (128-135), producing invalid tray IDs like 512+. AMS-HT has a single slot; global ID = unit ID. - Single-AMS fallback: return ams_id directly for AMS-HT (128-135) - Multi-AMS matching: decompose AMS-HT trays correctly (slot=0) - Multi-AMS narrowing: slot > 0 eliminates AMS-HT candidates - last_loaded_tray: tighten to valid IDs only (0-15, 128-135, 254) - Add 10 tests for AMS-HT fallback and last_loaded_tray validation |
||
|
|
d24e7cdf84 |
feat: multiple virtual printers with dedicated bind IPs + dual bind/detect ports (#445)
Multiple Virtual Printers: - Each VP gets a dedicated bind IP with independent FTP, MQTT, SSDP, and Bind services - New VirtualPrinter DB model, CRUD API (/api/virtual-printers), React UI - VirtualPrinterList, VirtualPrinterCard, VirtualPrinterAddDialog components - Per-instance TLS certificates (shared CA), 11 printer models, all 4 modes - Auto-incremented serial suffixes, network interface override per VP Dual Bind/Detect Ports (#445): - Listen on both ports 3000 and 3002 for slicer bind/detect handshake - Different BambuStudio/OrcaSlicer versions use different ports - Applies to BindServer (server mode) and SlicerProxyManager (proxy mode) - Updated Dockerfile, docker-compose.yml, firewall rules in wiki Also: - Rewrote VP test suite for new multi-instance architecture (75 tests) - Rewritten "How it works" section with 3-step workflow explanation - Updated all 5 locales (en, de, ja, fr, it) - Updated wiki and website for multi-VP + dual ports - New multi-VP screenshot |
||
|
|
df83250ff8 |
feat: add dedicated clear_plate permission + full-page group editor (#446)
Add a new `printers:clear_plate` permission so admins can grant plate-clearing ability without full `printers:control` access. Existing groups with `printers:control` automatically receive the new permission on startup via migration. Replace the cramped permission modal in Settings with a dedicated full-page group editor (`/groups/new`, `/groups/:id/edit`) featuring search filtering, select all/clear all, category-level toggles, and a responsive 2-column permission grid. Remove dead GroupsPage code that was never routed. - Backend: new Permission enum, category, defaults, endpoint guard, migration - Frontend: GroupEditPage, updated routes, removed modal from SettingsPage - Tests: 10 backend + 10 frontend tests for new permission and editor - Docs: updated wiki (auth, printer-control, API), website, changelog - i18n: added group editor keys to all 6 locale files (en/de/ja/fr/pt-BR/it) |
||
|
|
ec751424b6 |
Fix AMS slot mapping for A1 Mini (#364)
Add color-matching fallback for slot-to-tray mapping on printers that don't provide the MQTT mapping field (snow encoding) or reject request topic subscription. Matches 3MF filament slot colors against AMS tray colors to resolve the correct physical tray. Returns no match when colors are ambiguous (duplicate tray colors) to safely fall through to existing fallbacks. Mapping priority chain: print_cmd → MQTT snow → queue → color match → tray_now → slot_id-1. |
||
|
|
2fd90e9dce |
refactor(api): rename /filaments/ to /filament-catalog/ for clarity (#427)
The /filaments/ endpoint manages material type definitions (cost, temps, density) but shares its name with the UI's "Filament" page which shows the spool inventory (/inventory/spools/). This caused users to expect the API to return their spool inventory. Rename to /filament-catalog/ to make the distinction clear. No frontend behavior change — these API methods are defined but unused in the UI. |
||
|
|
713a3e931a |
fix(usage-tracker): decode MQTT mapping field for correct spool tracking on multi-AMS printers (#364)
On dual-nozzle printers (H2C, H2D Pro) with multiple AMS units, usage tracking attributed filament consumption to the wrong spools. The MQTT mapping field — a snow-encoded array mapping slicer slots to physical AMS trays — was preserved in state but never parsed. Add _decode_mqtt_mapping() to convert snow encoding (ams_hw_id * 256 + slot) to bambuddy global tray IDs. Insert as priority 2 in the mapping resolution chain, after print_cmd ams_mapping but before queue/tray_now fallbacks. Works for all printer models and print sources. |
||
|
|
c19de47ce5 |
test(mqtt): add tray_now disambiguation regression tests (28 tests)
Replay realistic MQTT message sequences through _process_message() to cover all tray_now disambiguation paths: single-nozzle passthrough (X1E/P2S), H2D dual-nozzle snow field, pending target, ams_extruder_map fallback, active extruder switching, and full multi-color lifecycles. |
||
|
|
29e9593f6c |
AMS mapping fixes (7 bugs):
- backend/app/services/print_scheduler.py — hard nozzle filter + external spool extruder - backend/app/api/routes/printers.py — ams_extruder_map race condition - backend/app/utils/threemf_tools.py — group_id priority + dual-nozzle detection - frontend/src/hooks/useFilamentMapping.ts — external spool extruder - frontend/src/pages/PrintersPage.tsx — AMS-HT globalTrayId - frontend/src/components/PrintModal/FilamentMapping.tsx — dropdown nozzle filter Usage tracking fix: - backend/app/services/bambu_mqtt.py — capture last valid progress/layer - backend/app/services/usage_tracker.py — use captured values on cancel UI fix: - frontend/src/components/spool-form/ColorSection.tsx — color tooltip z-index Tests: - backend/tests/unit/test_scheduler_ams_mapping.py — 63 tests - frontend/src/__tests__/hooks/useFilamentMapping.test.ts — 43 tests Static assets: - static/ — rebuilt frontend bundles |
||
|
|
20e06bcf0c |
feat(virtual-printer): add port 3000 bind/detect server for slicer connectivity
Recent BambuStudio/OrcaSlicer updates require a bind/detect handshake on port 3000 before connecting via MQTT/FTP. Without this, slicers cannot discover or connect to the virtual printer in any mode. - Add BindServer for server modes (immediate/review/print_queue) - Add TCPProxy for raw TCP forwarding (proxy mode) - Update Dockerfile (EXPOSE 3000) and docker-compose.yml (bridge port) - Add 10 new tests for BindServer protocol and integration |
||
|
|
a4fad2d2f5 |
fix(mqtt): fail-safe request topic subscription for ams_mapping capture (#405)
Some printer MQTT brokers (e.g. P1S) reject subscriptions to the request topic by killing the TCP connection, causing a disconnect loop. The request topic subscription for ams_mapping capture is now fail-safe with two detection paths: - SUBACK rejection: on_subscribe callback detects failure code 0x80 - Broker kills connection: on_disconnect detects disconnect within 10s of unconfirmed subscription attempt After detection, the request topic is disabled for that printer and reconnection succeeds with only the report topic. Printers that support the request topic (e.g. X1E, H2D) get ams_mapping capture; printers that don't (e.g. P1S) gracefully degrade to tray_now-based tracking. |
||
|
|
bc78f3f456 |
feat(timelapse): add upload and remove timelapse management (#406)
When the auto-scan attached the wrong timelapse (e.g. from a different print), there was no way to fix it — the file couldn't be removed and re-scanning was disabled once a timelapse was attached. |
||
|
|
c82521efc9 |
fix(timelapse): support AVI format from P1-series printers (#405)
P1S/P1P save timelapses as AVI (MJPEG), but the scanner only looked for MP4 files — so P1-series timelapses were never found or attached. |
||
|
|
12399abfea |
fix(usage-tracker): capture ams_mapping from MQTT request topic for slicer-initiated prints
Subscribe to the MQTT request topic (device/{serial}/request) to intercept
print commands from any source (BambuStudio, OrcaSlicer, Bambu Handy, or
Bambuddy itself). Captures ams_mapping from project_file commands and passes
it through print start/complete callbacks. Fixes wrong tray attribution on
H2D Pro when prints are started from external slicers.
|
||
|
|
ca9ffbba5d |
feat(usage-tracker): add diagnostic logging for slot-to-tray mapping investigation
Usage tracking works on X1E but fails on H2D Pro — the wrong tray is identified, attributing usage to the wrong spool. The root cause is unknown because we don't know what MQTT mapping data each printer model reports. Adds INFO-level logging at print start and completion: - state.raw_data["mapping"] (unknown format, preserved but never parsed) - tray_now, last_loaded_tray values - All raw_data keys containing "map" (discovery) - Per-AMS-tray summary: tray_type, tray_color, tray_now, tray_tar This enables comparing MQTT behavior across printer models without requiring DEBUG mode, so testers can send normal logs. |
||
|
|
cf7c459099 |
fix(inventory): fix usage tracking for remapped AMS slots and slicer prints
Three fixes for inventory spool usage not updating after prints: 1. Store ams_mapping from print command (reprint, library print, queue) so the usage tracker maps 3MF slots to the actual physical trays the user selected, not the default slicer mapping. 2. Track last_loaded_tray on printer state — the last valid tray_now (0-253) seen during printing. On H2D printers, tray_now is always 255 in AMS data; the real tray resolves via snow field ~44s after print start but reverts to "unloaded" at completion. The fallback chain is: tray_now_at_start > current tray_now > last_loaded_tray. 3. Use color similarity (Euclidean RGB distance, threshold 50) instead of exact hex match for auto-unlink fingerprint checks. RFID sensors report slightly different shades across reads (e.g. distance ~43.6 for the same spool), causing false assignment unlinks after prints. |
||
|
|
bc15d49a7e |
feat: add clear HMS errors button to dismiss stale print errors
Add a "Clear Errors" button to the HMS error modal that sends clean_print_error via MQTT and locally clears hms_errors for immediate UI feedback. Useful for dismissing stale print_error values that persist after print cancellation or transient events. |
||
|
|
0774130994 | Merge branch '0.2.0b' into 0.2.0b |