Commit Graph
165 Commits
Author SHA1 Message Date
maziggy 53eff03fb5 Added debug logging for printer's hour counter and current active AMS slot mapping 2026-01-04 08:08:10 +01:00
maziggy 3c336b0da2 Fixed bug in camera stream stuck detection 2026-01-03 11:03:00 +01:00
maziggy a308248880 Camera stream is now reconnecting if stream stucks 2026-01-03 10:51:37 +01:00
maziggy 226094982d Fixed active AMS slot display 2026-01-03 10:38:26 +01:00
maziggy 5dae3d3021 Fixed bug in skip objects modal, where the object ID markers are not correctly positioned over their corresponding objects in the build plate preview 2026-01-03 10:26:06 +01:00
maziggy 55ec08d4d1 Improved cover image retrieval 2026-01-03 10:02:00 +01:00
maziggy c9ad09864d Minor GCode viewer improvements 2026-01-03 09:59:17 +01:00
maziggy 410924a94f Fixed bug where printer card was showing wrong cover image, if print file has multiple plates 2026-01-03 08:36:59 +01:00
maziggy d03fe7598f Fixed bug in Spoolman sync 2026-01-03 08:11:55 +01:00
maziggy 74e2d95ea8 Changed version to 0.1.6b6 2026-01-02 17:22:05 +01:00
maziggy 94c961dbaf Add real-time fan status monitoring to printer cards
- Controls section: New section before Filaments with fan status and printer controls
  - Part cooling fan (Fan icon, cyan)
  - Auxiliary fan (Wind icon, blue)
  - Chamber fan (AirVent icon, green)
  - Stop/Pause/Resume buttons moved from Temperature section
- Real-time updates: Fan speeds now broadcast via WebSocket
- Backend: Parse MQTT fan data (cooling_fan_speed, big_fan1_speed, big_fan2_speed)
  - Convert 0-15 scale to 0-100%
- Always-visible badges with dynamic coloring based on fan state
- Removed horizontal dividers before Controls and Filaments sections
2026-01-02 16:05:20 +01:00
maziggy 83cbac04b7 - Add interactive API Browser to Settings > API Keys
- New APIBrowser component with full OpenAPI schema integration
    - Fetches and parses /openapi.json automatically
    - Groups endpoints by API tags (printers, archives, settings, etc.)
    - Expandable endpoint sections with color-coded method badges
    - Path parameter, query parameter, and JSON body editors
    - Auto-populates request body with schema examples
    - Live API request execution with response display
    - Response shows status code, timing, and formatted JSON
    - Copy response button with clipboard fallback
    - Search to filter endpoints across all categories
    - Expand All / Collapse All buttons
    - Link to Swagger UI (/docs)

  - Two-column layout for API Keys tab
    - Left: API key management + webhook documentation
    - Right: API Browser with dedicated test key input

  - Parameter validation
    - Shows warning for missing required parameters
    - Validates before sending requests to avoid 422 errors

  - UX improvements
    - "Use in API Browser" button on newly created keys
    - Responsive layout (stacked on mobile, side-by-side on xl+)
2026-01-02 15:00:21 +01:00
maziggy 0f65fb9484 - Bugfixes
- AMS "Unexpected format" warnings fixed - P1S/P1P send partial updates without full tray list (per https://github.com/Doridian/OpenBambuAPI/blob/main/mqtt.md). Now handled correctly.
  - FTP improvements:
    - Added timeouts (60s download, 30s listing)
    - Better logging at INFO level
    - Shows what files exist in /cache
  - Fallback archive - When 3MF can't be downloaded, creates minimal archive so prints are tracked
2026-01-02 13:21:57 +01:00
maziggy e356d03ee1 - Added new settings tab Filament and moved Spoolman Sync card 2026-01-02 12:00:57 +01:00
maziggy 32bd11ad82 - Fixed bug in update module for Docker based installations 2026-01-02 11:43:48 +01:00
maziggyandClaude Opus 4.5 a1c12331db Add Spoolman integration tests and update spool comment
Backend tests:
- 21 integration tests for all Spoolman API endpoints
- Status, connect/disconnect, spools, filaments, link, sync

Frontend tests:
- 20 component tests for SpoolmanSettings
- Rendering, disabled/enabled states, connection status, sync UI

Also changed auto-created spool comment to "Created by Bambuddy"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 10:42:43 +01:00
maziggy ea0bf5f932 - Add print quantity tracking for project progress
- Track number of items per print job (default: 1)
  - Project stats now show total items vs print jobs
  - Progress bar counts items toward target, not just archives
  - "Items Printed" field in archive edit modal

  Backend:
  - Added quantity field to PrintArchive model
  - Database migration for quantity column
  - Updated project stats to use SUM(quantity)
  - Updated backup/restore to include quantity
  - Updated CSV/Excel export with quantity field

  Frontend:
  - Added quantity input to EditArchiveModal
  - Updated ProjectsPage to display total_items
  - Updated ProjectDetailPage stats
  - Fixed project delete not refreshing the list
2026-01-02 10:24:31 +01:00
maziggy 5b8d24f2ce - Spoolman: Add link spool feature, UUID display, and sync feedback
- Link to Spoolman: Manually link existing Spoolman spools to AMS trays
    - Hover over AMS slot to see "Link to Spoolman" button
    - Select from list of unlinked Spoolman spools
    - Automatically sets extra.tag field in Spoolman
  - Spool UUID display: View and copy Bambu Lab spool UUID in AMS hover card
    - Shows first 8 chars with copy button (full UUID to clipboard)
    - Fallback copy method for HTTP contexts
  - Sync feedback: Shows synced count and skipped spools with reasons
    - Expandable list when more than 5 skipped
    - Color swatches for identification
  - Fixed Spoolman 400 Bad Request: extra field values must be valid JSON
  - Updated documentation (wiki, website)
2026-01-02 09:20:24 +01:00
maziggy fd3919574b - Major fixes for skip objects feature 2026-01-01 18:31:59 +01:00
maziggy 2dcd1a2ef2 - Enhanced skip objects feature with visual improvements and better UX
- Skip Objects Modal:
    - Object ID markers overlaid on preview image (grid layout)
    - Large prominent ID badges to match printer display
    - Info banner explaining to match IDs with printer screen
    - Layer warning when skip unavailable (layer <= 1)
    - Red badge on button showing skipped count
    - Preview image now shown when paused (not just running)
    - Close with ESC key or click outside modal
    - Full light/dark theme support

  - Backend:
    - Extract object positions from 3MF (include_positions=True)
    - API returns x/y coordinates for objects (when available)
    - Parse s_obj from printer MQTT for skipped state persistence
    - Cover URL available in PAUSE/PAUSED states

  - Tests:
    - Added test for objects with position data
2026-01-01 18:01:41 +01:00
maziggy fe250b9b7f - Added frontnend/backend tests for printer controls 2026-01-01 16:02:25 +01:00
maziggy 2c61ba930a Updated version to 0.1.6b4 2026-01-01 14:10:41 +01:00
maziggyandClaude Opus 4.5 1234e44eb2 - Docker update detection for in-app updates
- Added _is_docker_environment() function
  - Check endpoint returns is_docker and update_method fields
  - Apply endpoint rejects Docker with helpful instructions
- Added updates API tests
- Updated CHANGELOG

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 14:06:06 +01:00
maziggy ccdb084f23 - Refactored printer card's AMS section for better experience 2026-01-01 12:08:55 +01:00
maziggy 569dbc3d21 - Printer Hour Counter:
- Fix runtime_seconds never incrementing during prints
  - Bug: first timestamp was set but never committed (updated_count was 0)
  - Add needs_commit flag to ensure timestamp is saved on first iteration
2026-01-01 07:58:23 +01:00
maziggy 2457577f54 - Added frontend/backend tests for new theme functions
- Fixed some bugs, where settings were not backed up or restored
- Docker: Fixed mounting of database for persistence
2025-12-31 17:07:15 +01:00
maziggy bca1a80172 * Add customizable theme system with style, background, and accent options
Implement comprehensive theme customization with independent settings for
  dark and light modes:

  - Style layer: Classic (clean shadows), Glow (accent-colored glow effects),
    Vibrant (dramatic deep shadows)
  - Background layer: Neutral, Warm, Cool (light mode); plus OLED, Slate,
    Forest (dark mode only)
  - Accent colors: Green, Teal, Blue, Orange, Purple, Red

  All combinations work independently (e.g., Glow + Forest + Teal). Settings
  sync across devices via database and show toast confirmations on change.

  Backend:
  - Add 6 new settings fields (dark_style, dark_background, dark_accent,
    light_style, light_background, light_accent)
  - Add integration test for theme settings API

  Frontend:
  - Refactor index.css with 3-layer CSS variable system
  - Update ThemeContext for dual-mode theme management
  - Add Appearance section to Settings page with 6 dropdowns
  - Update components for new ThemeContext API
2025-12-31 15:44:52 +01:00
maziggy 219d26b8ab - Fixed bug in printer's hour counter 2025-12-31 12:01:17 +01:00
maziggy 22222e502c - Excluded Bambuddy virtual printer from SSDP discovery 2025-12-30 15:58:11 +01:00
maziggy 9a9ef36a33 Changed version to 0.1.6b3 2025-12-30 10:28:57 +01:00
maziggy 88e84ca45a - Add Virtual Printer feature - emulate Bambu printer on network
- Virtual printer appears in Bambu Studio/Orca Slicer via SSDP discovery
  - Secure TLS/MQTT communication with auto-generated certificates
  - Queue mode (pending uploads) or auto-start mode
  - Configurable access code for authentication
  - Docker support with network_mode: host and certificate persistence
  - Fix backup/restore for virtual printer settings (auto-save no longer overwrites)
2025-12-29 15:52:48 +01:00
maziggy c3c36719a5 Changed version to 0.1.6b2 2025-12-29 10:16:54 +01:00
maziggy 1dff7ceae1 Added frontend/backend tests for archive card ams mapping 2025-12-29 10:15:19 +01:00
maziggy 3cba1c0989 - Fix AMS filament matching in reprint modal
- Add fuzzy color matching for filament comparison
    Colors within RGB threshold of 40 are considered a match, fixing
    cases where 3MF and printer report slightly different hex values
    for the same filament color (e.g., beige #F5F5DC vs #FCECD6)

  - Add POST /printers/{id}/refresh-status endpoint
    Sends MQTT pushall command to request fresh AMS data from printer

  - Improve Re-read button in filament check section
    - Now triggers backend refresh before refetching status
    - More prominent styling with text label and border
    - 500ms delay after pushall to allow printer to respond

  - Add AMS slot labels to matched filament display
    Shows location like "PLA (AMS-B Slot 3)" instead of just "PLA"

  - Add color hex tooltips on filament color circles
2025-12-29 10:03:51 +01:00
maziggy e97d697d90 - Archive card: fixed a cache bug, where wrong cover image was shown 2025-12-29 09:05:10 +01:00
maziggy 0bcedd2c16 - Add Tasmota device discovery and switchbar quick access
- Features:
    - Tasmota device discovery: Auto-detect network and scan for Tasmota devices
      in Add Smart Plug modal. Supports devices with/without authentication.
    - Switchbar: Quick access widget in sidebar footer for controlling smart plugs
      from anywhere in the app. Shows real-time status and power consumption.
2025-12-28 15:02:42 +01:00
maziggy b3ef6ccb32 - Add AMS filament preview for reprints and file type badges
- AMS Filament Preview:
    - Add GET /archives/{id}/filament-requirements endpoint to extract
      filament data from archived 3MF slice_info.config
    - Show filament comparison in reprint modal when printer is selected
    - Compare both filament type AND color with visual indicators:
      - Green checkmark: Type and color match
      - Yellow warning: Same type, different color
      - Orange warning: Different type or empty slot
    - Handle AMS-HT units (id >= 128) and virtual tray (slot 254)
    - Normalize color formats between API (RRGGBBAA) and 3MF (#RRGGBB)

- File Type Badge:
  - Archive cards show GCODE (green) or SOURCE (orange) badge
  - Helps users identify which files have print data vs source-only
  - Badge appears next to printer name in card content area

- Camera Stream Stability:
  - Increase ffmpeg read timeout from 10s to 30s
  - Add ffmpeg RTSP options: -timeout, -buffer_size, -max_delay
  - Add frontend auto-reconnection with exponential backoff (2s-30s)
  - Show reconnection UI with countdown and attempt counter
2025-12-28 13:50:29 +01:00
maziggy 530a7a4608 - Fix camera stream stopping after a few minutes
- Backend:
    - Increase ffmpeg stdout read timeout from 10s to 30s
    - Add ffmpeg RTSP stability options: -timeout, -buffer_size, -max_delay
  - Frontend:
    - Add auto-reconnection with exponential backoff (2s→30s max)
    - Show reconnection UI with countdown and attempt counter
    - Maximum 5 reconnection attempts before showing error
    - "Reconnect now" button to skip countdown
    - Reset reconnection state on manual refresh or mode switch
2025-12-28 13:16:14 +01:00
maziggy b1be35ba8c - Add timelapse editor with trim, speed adjustment, and music overlay
- Add TimelapseEditorModal component with visual timeline scrubber
  - Add timelapse processing endpoints (info, thumbnails, process)
  - Add TimelapseProcessor service using FFmpeg for video processing
  - Support trim (start/end), speed (0.25x-4x), and audio overlay
  - Add Edit button to TimelapseViewer
  - Fix browser caching with timestamp query parameter
  - Change default timelapse playback speed from 2x to 1x
2025-12-28 13:06:30 +01:00
maziggy db5cb86d3a - Project page enhancements and bug fixes
- Add filament color swatches to project cards showing colors from assigned archives
  - Add "Hide done" toggle to filter completed BOM items
  - Include projects in backup/restore (with BOM items and attachments)
  - Add file type validation for project attachments
  - Enhance project card design with gradients, shadows, and glow effects
  - Improve layout spacing on project list and detail pages
  - Replace browser confirm dialogs with styled confirmation modals
  - Fix attachment uploads not persisting (SQLAlchemy JSON column mutation)
2025-12-28 12:04:33 +01:00
maziggy 8acc91d3cd - Add subnet scanning for printer discovery in Docker environments
- Detect Docker environment automatically via /.dockerenv and cgroup
  - Show subnet input field in Add Printer dialog when running in Docker
  - Scan IP range for Bambu printer ports (8883 MQTT, 990 FTPS)
  - Query SSDP to get printer name/serial/model from discovered IPs
  - Map raw SSDP model codes to friendly names (BL-P001→X1C, O1D→H2D)
2025-12-28 09:40:47 +01:00
maziggy 49b9fb854b - Fixed bug in notification module where notifictions were sent although printer is offline 2025-12-27 18:48:14 +01:00
maziggy e9193276a6 Summary of Fixes
1. "Unknown Status (255)" bug

  File: backend/app/services/printer_manager.py:291-293

  Problem: A1/P1 printers send stg_cur=255 when idle (unlike X1 which uses -1). The code treated 255 as a valid stage number and returned "Unknown stage (255)".

  Fix: Changed the condition from if state.stg_cur >= 0: to if 0 <= state.stg_cur < 255: so that 255 is now treated as "no calibration stage" (same as -1).

  2. AMS humidity/temp displaced on mobile

  File: frontend/src/pages/PrintersPage.tsx:1164-1212

  Problem: The AMS row used a rigid horizontal flex layout that didn't adapt to narrow mobile screens, causing humidity/temperature indicators to be displaced.

  Fix:
  - Added flex-wrap to allow wrapping on very narrow screens
  - Added ml-auto to humidity/temp section to keep it right-aligned
  - Added max-w-[60px] sm:max-w-none to truncate long filament names on mobile
  - Changed gap from fixed gap-3 to responsive gap-2 sm:gap-3

  Tests Added

  4 new unit tests for get_derived_status_name:
  - test_stg_cur_255_returns_none - Verifies A1/P1 idle state
  - test_stg_cur_negative_one_returns_none_when_idle - Verifies X1 idle state
  - test_valid_stage_returns_name - Verifies valid stages work
  - test_stg_cur_zero_returns_printing - Verifies printing state

  All 382 tests pass.
2025-12-27 15:53:37 +01:00
maziggy a66500b605 Fixed bug in mock_state 2025-12-27 15:46:13 +01:00
maziggy 11a6bb282a Key Discovery
A1/P1 printers don't support RTSP - they use a custom chamber image protocol on port 6000:
  - SSL/TLS connection
  - 80-byte binary auth payload (magic + "bblp" + access code)
  - 16-byte header with payload size + JPEG data

  Changes Made

  backend/app/services/camera.py

  - Added supports_rtsp() - detects X1/H2/P2 (RTSP) vs A1/P1 (chamber image)
  - Added is_chamber_image_model() - inverse check
  - Added _create_chamber_auth_payload() - builds 80-byte auth
  - Added _create_ssl_context() - SSL for self-signed certs
  - Added read_chamber_image_frame() - single frame capture
  - Added generate_chamber_image_stream() - persistent connection
  - Added read_next_chamber_frame() - read from stream
  - Updated capture_camera_frame() - uses correct protocol per model

  backend/app/api/routes/camera.py

  - Added generate_chamber_mjpeg_stream() - MJPEG from chamber protocol
  - Renamed generate_mjpeg_stream() → generate_rtsp_mjpeg_stream()
  - Updated camera_stream endpoint - chooses protocol based on model
  - Updated stop_camera_stream - cleans up both stream types
  - Added tracking for _active_chamber_streams

  Protocol Matrix

  | Model                       | Protocol      | Port |
  |-----------------------------|---------------|------|
  | X1, X1C, X1E, H2C, H2D, P2S | RTSP          | 322  |
  | A1, A1MINI, P1P, P1S        | Chamber Image | 6000 |
2025-12-25 07:44:53 +01:00
maziggy 01989b7182 - Fix A1/P1 camera streaming with extended timeouts and lower FPS cap
- Removed deprecated -stimeout option (renamed to -timeout in ffmpeg 5.0+).
2025-12-24 13:43:35 +01:00
maziggy 7622d2ae5c - Fix total print hours calculation in set_total_hours to include all
prints (not just completed), matching get_printer_total_hours behavior
  - Add option to keep or delete archives when deleting a printer
  - Custom maintenance types no longer auto-assign to all printers
  - Add UI to manually assign/remove custom maintenance types per printer
  - Add backend endpoints for assigning types to printers and removing items
  - Exclude static/assets from large file pre-commit check
  - Fix A1/P1 camera streaming with extended timeouts and lower FPS cap
2025-12-24 08:41:23 +01:00
maziggy 929c4c8cd6 - Fix total print hours calculation in set_total_hours to include all
prints (not just completed), matching get_printer_total_hours behavior
  - Add option to keep or delete archives when deleting a printer
  - Custom maintenance types no longer auto-assign to all printers
  - Add UI to manually assign/remove custom maintenance types per printer
  - Add backend endpoints for assigning types to printers and removing items
  - Exclude static/assets from large file pre-commit check
2025-12-23 09:00:36 +01:00
maziggyandClaude Opus 4.5 288a495041 - Fix dual nozzle temperature display for H2D printers
- Use extruder_info[0].temp for right nozzle instead of nozzle_temper field which incorrectly mirrors left nozzle
- Gate dual nozzle parsing with has_h2d_extruder_info to prevent single nozzle printers showing two temps
- Add nozzle_heating calculation for single nozzle printers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 13:07:06 +01:00
maziggy ef68804fa9 - Added printer auto discovery to add printer modal 2025-12-21 11:23:20 +01:00