From 234693a306b9434b4e4294c32ae3c04665f490e6 Mon Sep 17 00:00:00 2001 From: maziggy Date: Sun, 1 Feb 2026 16:26:55 +0100 Subject: [PATCH] Fix external spool ams_mapping2 slot_id (Issue #213) The ams_mapping2 format was incorrectly using the tray_id (254/255) as the slot_id for external spools. The printer expects slot_id to be the actual slot index (0 for main nozzle, 1 for deputy nozzle), not the tray_id value. Before: {"ams_id": 255, "slot_id": 254} <- invalid slot index After: {"ams_id": 255, "slot_id": 0} <- correct slot index This caused prints using external spool to fail immediately with error code 07FF_8007. Closes #213 --- backend/app/services/bambu_mqtt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/services/bambu_mqtt.py b/backend/app/services/bambu_mqtt.py index ece44bb81..ec27a3dc4 100644 --- a/backend/app/services/bambu_mqtt.py +++ b/backend/app/services/bambu_mqtt.py @@ -2038,8 +2038,9 @@ class BambuMQTTClient: ams_mapping2.append({"ams_id": 255, "slot_id": 255}) elif tray_id >= 254: # External spool: 254 = main nozzle, 255 = deputy nozzle - # External spools use ams_id=255 with slot_id matching tray_id - ams_mapping2.append({"ams_id": 255, "slot_id": tray_id}) + # For ams_mapping2, slot_id is 0 (main) or 1 (deputy), not the tray_id + external_slot = 0 if tray_id == 254 else 1 + ams_mapping2.append({"ams_id": 255, "slot_id": external_slot}) else: # Regular AMS tray: Global tray ID = (ams_id * 4) + slot_id ams_id = tray_id // 4