1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[GH-ISSUE #1121] [Bug Report] Prints from queue seem to follow AMS slot of the printer the file was originally #803

Closed
opened 2026-05-07 00:13:57 +02:00 by BreizhHardware · 4 comments

Originally created by @maziggy on GitHub (Apr 24, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1121

Originally assigned to: @maziggy on GitHub.

Prints from queue seem to follow AMS slot of the printer the file was originally sliced with. If the AMS has a different filament it will use that disregarding the specified filament. If the slot is empty it will complain about filament ran out, even though the proper filament is in another spot.

Reporter Contact

Email: grussell@itape.com

System Information
{
  "generated_at": "2026-04-24T16:47:25.880095",
  "app": {
    "version": "0.2.3.2",
    "debug_mode": true
  },
  "system": {
    "platform": "Linux",
    "platform_release": "6.6.28+rpt-rpi-v8",
    "platform_version": "#1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22)",
    "architecture": "aarch64",
    "python_version": "3.11.2"
  },
  "environment": {
    "docker": false,
    "data_dir": "/opt/[user]/data",
    "log_dir": "/opt/[user]/logs",
    "timezone": "America/New_York"
  },
  "database": {
    "archives_total": 148,
    "archives_completed": 109,
    "printers_total": 3,
    "filaments_total": 0,
    "projects_total": 3,
    "smart_plugs_total": 0
  },
  "printers": [
    {
      "index": 1,
      "model": "P1S",
      "nozzle_count": 1,
      "is_active": true,
      "mqtt_connected": true,
      "state": "RUNNING",
      "firmware_version": "01.10.00.00",
      "wifi_signal": -68,
      "reachable": true,
      "ams_unit_count": 1,
      "ams_tray_count": 1,
      "has_vt_tray": true,
      "external_camera_configured": false,
      "plate_detection_enabled": false,
      "hms_error_count": 0,
      "developer_mode": true,
      "nozzle_rack_count": 0
    },
    {
      "index": 2,
      "model": "P1S",
      "nozzle_count": 1,
      "is_active": true,
      "mqtt_connected": true,
      "state": "PAUSE",
      "firmware_version": "01.10.00.00",
      "wifi_signal": -70,
      "reachable": true,
      "ams_unit_count": 1,
      "ams_tray_count": 1,
      "has_vt_tray": true,
      "external_camera_configured": false,
      "plate_detection_enabled": false,
      "hms_error_count": 2,
      "developer_mode": true,
      "nozzle_rack_count": 0
    },
    {
      "index": 3,
      "model": "P1S",
      "nozzle_count": 1,
      "is_active": true,
      "mqtt_connected": true,
      "state": "FINISH",
      "firmware_version": "01.10.00.00",
      "wifi_signal": -47,
      "reachable": true,
      "ams_unit_count": 1,
      "ams_tray_count": 1,
      "has_vt_tray": true,
      "external_camera_configured": false,
      "plate_detection_enabled": false,
      "hms_error_count": 0,
      "developer_mode": true,
      "nozzle_rack_count": 0
    }
  ],
  "settings": {
    "auth_enabled": "true",
    "setup_completed": "true",
    "auto_archive": "true",
    "save_thumbnails": "true",
    "capture_finish_photo": "true",
    "default_filament_cost": "12.0",
    "currency": "USD",
    "energy_cost_per_kwh": "0.15",
    "energy_tracking_mode": "total",
    "check_updates": "true",
    "check_printer_firmware": "true",
    "include_beta_updates": "false",
    "notification_language": "en",
    "bed_cooled_threshold": "35.0",
    "ams_humidity_good": "40",
    "ams_humidity_fair": "60",
    "ams_temp_good": "28.0",
    "ams_temp_fair": "35.0",
    "ams_history_retention_days": "30",
    "per_printer_mapping_expanded": "false",
    "date_format": "system",
    "time_format": "system",
    "default_printer_id": "None",
    "ftp_retry_enabled": "true",
    "ftp_retry_count": "3",
    "ftp_retry_delay": "2",
    "ftp_timeout": "30",
    "mqtt_enabled": "false",
    "mqtt_broker": "",
    "mqtt_port": "1883",
    "mqtt_username": "",
    "mqtt_password": "",
    "mqtt_topic_prefix": "bambuddy",
    "mqtt_use_tls": "false",
    "external_url": "[REDACTED]",
    "ha_enabled": "false",
    "ha_url": "",
    "ha_token": "",
    "library_archive_mode": "ask",
    "library_disk_warning_gb": "5.0",
    "camera_view_mode": "window",
    "preferred_slicer": "bambu_studio",
    "prometheus_enabled": "false",
    "prometheus_token": "",
    "dark_background": "slate",
    "dark_accent": "purple",
    "dark_style": "vibrant",
    "light_background": "cool",
    "light_accent": "purple",
    "light_style": "vibrant",
    "advanced_auth_enabled": "false",
    "smtp_auth_enabled": "true",
    "disable_filament_warnings": "false",
    "prefer_lowest_filament": "false",
    "queue_drying_enabled": "false",
    "queue_drying_block": "false",
    "ambient_drying_enabled": "false",
    "drying_presets": "",
    "user_notifications_enabled": "true",
    "default_bed_levelling": "true",
    "default_flow_cali": "false",
    "default_vibration_cali": "true",
    "default_layer_inspect": "false",
    "default_timelapse": "false",
    "stagger_group_size": "2",
    "stagger_interval_minutes": "5",
    "require_plate_clear": "true",
    "debug_logging_enabled": "false",
    "debug_logging_enabled_at": "",
    "queue_shortest_first": "false"
  },
  "virtual_printers": [],
  "integrations": {
    "notification_providers": [],
    "spoolman": {
      "enabled": false,
      "reachable": false
    },
    "mqtt_relay": {
      "enabled": false,
      "connected": false,
      "broker": "",
      "port": 0,
      "topic_prefix": "bambuddy"
    },
    "spoolbuddy": {
      "device_count": 0,
      "online_count": 0,
      "devices": []
    },
    "homeassistant": {
      "enabled": false
    }
  },
  "database_health": {
    "backend": "sqlite",
    "journal_mode": "wal",
    "quick_check": "ok",
    "db_size_bytes": 4407296,
    "wal_size_bytes": 4152992
  },
  "dependencies": {
    "fastapi": "0.135.1",
    "uvicorn": "0.41.0",
    "pydantic": "2.12.5",
    "sqlalchemy": "2.0.48",
    "paho-mqtt": "2.1.0",
    "psutil": "7.2.2",
    "httpx": "0.28.1",
    "aiofiles": "25.1.0",
    "cryptography": "46.0.7",
    "opencv-python-headless": "4.13.0.92",
    "numpy": "2.4.3"
  },
  "log_file": {
    "size_bytes": 1292892,
    "size_formatted": "1.2 MB"
  },
  "network": {
    "interface_count": 1,
    "interfaces": [
      {
        "name": "eth0",
        "subnet": "x.x.0.0/8"
      }
    ]
  },
  "websockets": {
    "active_connections": 2
  }
}

Logs (sanitized): bambuddy.log


Submitted via BamBuddy Bug Report

Originally created by @maziggy on GitHub (Apr 24, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1121 Originally assigned to: @maziggy on GitHub. Prints from queue seem to follow AMS slot of the printer the file was originally sliced with. If the AMS has a different filament it will use that disregarding the specified filament. If the slot is empty it will complain about filament ran out, even though the proper filament is in another spot. <details> <summary>Reporter Contact</summary> Email: grussell@itape.com </details> <details> <summary>System Information</summary> ```json { "generated_at": "2026-04-24T16:47:25.880095", "app": { "version": "0.2.3.2", "debug_mode": true }, "system": { "platform": "Linux", "platform_release": "6.6.28+rpt-rpi-v8", "platform_version": "#1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22)", "architecture": "aarch64", "python_version": "3.11.2" }, "environment": { "docker": false, "data_dir": "/opt/[user]/data", "log_dir": "/opt/[user]/logs", "timezone": "America/New_York" }, "database": { "archives_total": 148, "archives_completed": 109, "printers_total": 3, "filaments_total": 0, "projects_total": 3, "smart_plugs_total": 0 }, "printers": [ { "index": 1, "model": "P1S", "nozzle_count": 1, "is_active": true, "mqtt_connected": true, "state": "RUNNING", "firmware_version": "01.10.00.00", "wifi_signal": -68, "reachable": true, "ams_unit_count": 1, "ams_tray_count": 1, "has_vt_tray": true, "external_camera_configured": false, "plate_detection_enabled": false, "hms_error_count": 0, "developer_mode": true, "nozzle_rack_count": 0 }, { "index": 2, "model": "P1S", "nozzle_count": 1, "is_active": true, "mqtt_connected": true, "state": "PAUSE", "firmware_version": "01.10.00.00", "wifi_signal": -70, "reachable": true, "ams_unit_count": 1, "ams_tray_count": 1, "has_vt_tray": true, "external_camera_configured": false, "plate_detection_enabled": false, "hms_error_count": 2, "developer_mode": true, "nozzle_rack_count": 0 }, { "index": 3, "model": "P1S", "nozzle_count": 1, "is_active": true, "mqtt_connected": true, "state": "FINISH", "firmware_version": "01.10.00.00", "wifi_signal": -47, "reachable": true, "ams_unit_count": 1, "ams_tray_count": 1, "has_vt_tray": true, "external_camera_configured": false, "plate_detection_enabled": false, "hms_error_count": 0, "developer_mode": true, "nozzle_rack_count": 0 } ], "settings": { "auth_enabled": "true", "setup_completed": "true", "auto_archive": "true", "save_thumbnails": "true", "capture_finish_photo": "true", "default_filament_cost": "12.0", "currency": "USD", "energy_cost_per_kwh": "0.15", "energy_tracking_mode": "total", "check_updates": "true", "check_printer_firmware": "true", "include_beta_updates": "false", "notification_language": "en", "bed_cooled_threshold": "35.0", "ams_humidity_good": "40", "ams_humidity_fair": "60", "ams_temp_good": "28.0", "ams_temp_fair": "35.0", "ams_history_retention_days": "30", "per_printer_mapping_expanded": "false", "date_format": "system", "time_format": "system", "default_printer_id": "None", "ftp_retry_enabled": "true", "ftp_retry_count": "3", "ftp_retry_delay": "2", "ftp_timeout": "30", "mqtt_enabled": "false", "mqtt_broker": "", "mqtt_port": "1883", "mqtt_username": "", "mqtt_password": "", "mqtt_topic_prefix": "bambuddy", "mqtt_use_tls": "false", "external_url": "[REDACTED]", "ha_enabled": "false", "ha_url": "", "ha_token": "", "library_archive_mode": "ask", "library_disk_warning_gb": "5.0", "camera_view_mode": "window", "preferred_slicer": "bambu_studio", "prometheus_enabled": "false", "prometheus_token": "", "dark_background": "slate", "dark_accent": "purple", "dark_style": "vibrant", "light_background": "cool", "light_accent": "purple", "light_style": "vibrant", "advanced_auth_enabled": "false", "smtp_auth_enabled": "true", "disable_filament_warnings": "false", "prefer_lowest_filament": "false", "queue_drying_enabled": "false", "queue_drying_block": "false", "ambient_drying_enabled": "false", "drying_presets": "", "user_notifications_enabled": "true", "default_bed_levelling": "true", "default_flow_cali": "false", "default_vibration_cali": "true", "default_layer_inspect": "false", "default_timelapse": "false", "stagger_group_size": "2", "stagger_interval_minutes": "5", "require_plate_clear": "true", "debug_logging_enabled": "false", "debug_logging_enabled_at": "", "queue_shortest_first": "false" }, "virtual_printers": [], "integrations": { "notification_providers": [], "spoolman": { "enabled": false, "reachable": false }, "mqtt_relay": { "enabled": false, "connected": false, "broker": "", "port": 0, "topic_prefix": "bambuddy" }, "spoolbuddy": { "device_count": 0, "online_count": 0, "devices": [] }, "homeassistant": { "enabled": false } }, "database_health": { "backend": "sqlite", "journal_mode": "wal", "quick_check": "ok", "db_size_bytes": 4407296, "wal_size_bytes": 4152992 }, "dependencies": { "fastapi": "0.135.1", "uvicorn": "0.41.0", "pydantic": "2.12.5", "sqlalchemy": "2.0.48", "paho-mqtt": "2.1.0", "psutil": "7.2.2", "httpx": "0.28.1", "aiofiles": "25.1.0", "cryptography": "46.0.7", "opencv-python-headless": "4.13.0.92", "numpy": "2.4.3" }, "log_file": { "size_bytes": 1292892, "size_formatted": "1.2 MB" }, "network": { "interface_count": 1, "interfaces": [ { "name": "eth0", "subnet": "x.x.0.0/8" } ] }, "websockets": { "active_connections": 2 } } ``` </details> **Logs (sanitized):** [bambuddy.log](https://raw.githubusercontent.com/maziggy/bambuddy/bug-report-assets/logs/1bf4c7835b084d828d0519a354aeed27.log) --- *Submitted via BamBuddy Bug Report*
Author
Owner

@maziggy commented on GitHub (Apr 25, 2026):

https://wiki.bambuddy.cool/features/print-queue/#ams-filament-mapping

Image
<!-- gh-comment-id:4318351431 --> @maziggy commented on GitHub (Apr 25, 2026): https://wiki.bambuddy.cool/features/print-queue/#ams-filament-mapping <img width="648" height="835" alt="Image" src="https://github.com/user-attachments/assets/fb39857c-f771-4541-8fb7-70deab7aa728" />
Author
Owner

@GRussell94 commented on GitHub (Apr 27, 2026):

Image

This is not completed. when scheduling a print to use ANY printer, it completely ignores AMS slots per printer. Force color match does nothing. The only thing I have found to work is to use "Specific Printer" and choose all the printers, then choose custom mapping. I would think this is also a bug as I don't need "custom mapping" if the filament of the file matches filament in any AMS slot.

<!-- gh-comment-id:4327783868 --> @GRussell94 commented on GitHub (Apr 27, 2026): <img width="678" height="843" alt="Image" src="https://github.com/user-attachments/assets/68b7f26b-55b8-413d-9c17-65d03090fa5b" /> This is not completed. when scheduling a print to use ANY printer, it completely ignores AMS slots per printer. Force color match does nothing. The only thing I have found to work is to use "Specific Printer" and choose all the printers, then choose custom mapping. I would think this is also a bug as I don't need "custom mapping" if the filament of the file matches filament in any AMS slot.
Author
Owner

@maziggy commented on GitHub (Apr 27, 2026):

Sorry the close felt premature. Let me explain what the code actually does so we can pin where it's going wrong for you.

When you queue a print to a model (Any printer of model X) on a recent build, two things happen automatically without you needing custom mapping OR force color match:

  1. The scheduler skips any printer of that model that doesn't have the required filament types loaded. It pulls the type list from your 3MF when the job is queued.
  2. When a printer is picked and dispatch fires, the scheduler reads the 3MF's "slot 1 wants PLA Black, slot 2 wants PETG White" requirements and remaps them onto whatever slots that specific printer actually has loaded — match priority is unique tray_info_idx -> exact color -> similar color -> type-only. So a 3MF sliced with PLA Black in slot 1 should print from slot 3 if that's where the destination printer has its PLA Black.

That's exactly what you're describing as the expected behaviour, and it's what the code is meant to do — without Force Color Match and without picking a specific printer.

Force Color Match is a stricter knob on top: it tells the scheduler "don't even pick a printer for this slot unless it has this exact type+color loaded right now." Useful when colour matters more than wait time. If the scheduler can't find one, the job sits waiting instead of dispatching to the wrong colour.

A few things worth confirming so we can isolate the actual failure:

  1. Are you still on 0.2.3.2? I don't want to spend cycles on a path that may already have changed. Could you retest on the dev branch / latest daily build first? If it works there, we close this out as fixed-in-newer.
  2. If it's still wrong on latest: can you share, for one failing job:
    - The queue item's filament_overrides (visible in the DB or via GET /api/v1/print-queue/{id}),
    - The printer's AMS state at dispatch time (what was actually loaded in each tray),
    - The line from bambuddy.log that looks like Queue item N: Computed AMS mapping for printer P: [...].

That triplet — what the file asked for, what the printer had, what Bambuddy decided — tells us in one shot whether the picker chose wrong, the mapping logic chose wrong, or the right mapping was computed but the print used a different one.

  1. One known gotcha I'd rule out first: if tray_color is empty/missing on a slot (older firmware or after a partial load), the matcher falls back to type-only and picks the first slot of that type — which can absolutely look like "it ignored the colour." Worth checking your printer's MQTT report.

Reopening the issue while we wait for the debug data.

<!-- gh-comment-id:4328014007 --> @maziggy commented on GitHub (Apr 27, 2026): Sorry the close felt premature. Let me explain what the code actually does so we can pin where it's going wrong for you. When you queue a print to a model (Any printer of model X) on a recent build, two things happen automatically without you needing custom mapping OR force color match: 1. The scheduler skips any printer of that model that doesn't have the required filament types loaded. It pulls the type list from your 3MF when the job is queued. 2. When a printer is picked and dispatch fires, the scheduler reads the 3MF's "slot 1 wants PLA Black, slot 2 wants PETG White" requirements and remaps them onto whatever slots that specific printer actually has loaded — match priority is unique tray_info_idx -> exact color -> similar color -> type-only. So a 3MF sliced with PLA Black in slot 1 should print from slot 3 if that's where the destination printer has its PLA Black. That's exactly what you're describing as the expected behaviour, and it's what the code is meant to do — without Force Color Match and without picking a specific printer. Force Color Match is a stricter knob on top: it tells the scheduler "don't even pick a printer for this slot unless it has this exact type+color loaded right now." Useful when colour matters more than wait time. If the scheduler can't find one, the job sits waiting instead of dispatching to the wrong colour. A few things worth confirming so we can isolate the actual failure: 1. Are you still on 0.2.3.2? I don't want to spend cycles on a path that may already have changed. Could you retest on the dev branch / latest daily build first? If it works there, we close this out as fixed-in-newer. 2. If it's still wrong on latest: can you share, for one failing job: - The queue item's filament_overrides (visible in the DB or via GET /api/v1/print-queue/{id}), - The printer's AMS state at dispatch time (what was actually loaded in each tray), - The line from bambuddy.log that looks like Queue item N: Computed AMS mapping for printer P: [...]. That triplet — what the file asked for, what the printer had, what Bambuddy decided — tells us in one shot whether the picker chose wrong, the mapping logic chose wrong, or the right mapping was computed but the print used a different one. 3. One known gotcha I'd rule out first: if tray_color is empty/missing on a slot (older firmware or after a partial load), the matcher falls back to type-only and picks the first slot of that type — which can absolutely look like "it ignored the colour." Worth checking your printer's MQTT report. Reopening the issue while we wait for the debug data.
Author
Owner

@maziggy commented on GitHub (May 2, 2026):

?

<!-- gh-comment-id:4363762457 --> @maziggy commented on GitHub (May 2, 2026): ?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy-maziggy-1#803
No description provided.