mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 05:35:30 +02:00
[GH-ISSUE #853] [Bug]: When using the external spool on a Bambu Lab P2S + AMS 2 Pro, filament usage is incorrectly attributed to AMS Slot 1 instead of the external spool. #579
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy#579
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @anunayk on GitHub (Mar 31, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/853
Originally assigned to: @maziggy on GitHub.
Bug Description
In
usage_tracker.py:872-882,when determining which tray a print used:When you have an AMS 2 Pro with 4 trays (IDs 0, 1, 2, 3) plus the external spool (ID 254), the sorted list becomes:
available_trays = [0, 1, 2, 3, 254]If the slicer says you're using slot 1 (the first slot, which should be the external spool), the code does:
global_tray_id = available_trays[1 - 1] # = available_trays[0] = 0This maps the external spool usage to AMS 0, Tray 0 (the first AMS slot) instead of global_tray_id 254 (the external spool). The position-based mapping assumes that:
For a P2S with AMS 2 Pro + External Spool, the slicer sees:
But Bambuddy's sorted list is [0, 1, 2, 3, 254], so:
BUT if you print using only the external spool (slot 1 in the 3MF, because it's the only filament), the mapping becomes:
Expected Behavior
Bambuddy should correctly map the used filament from the external spool.
Steps to Reproduce
Printer Model
P2S
Bambuddy Version
0.2.2.2
Printer Firmware Version
01.01.03.00
Installation Method
Docker
Operating System
Docker
Relevant Logs / Support Package
No response
Screenshots
No response
Additional Context
No response
Checklist
@maziggy commented on GitHub (Mar 31, 2026):
Thanks for the detailed analysis! The position-based fallback code you identified (lines 872-882) is indeed conceptually flawed — sorted tray IDs don't always map 1:1 to slicer slot positions, and your walkthrough of that logic is correct.
However, for the specific scenario you describe (single-filament 3MF using only the external spool), a different code path should handle it:
Could you share a support package (-> https://wiki.bambuddy.cool/features/system-info/?h=debug#enable-debug-logging) from a print where this happened? The [UsageTracker] 3MF: log lines at print completion will show exactly which mapping source and code path was used, so I can confirm whether the position-based fallback was actually hit or if something else went wrong.
@anunayk commented on GitHub (Mar 31, 2026):
I loaded filament from an external spool but Bambuddy assigned the loaded filament to AMS slot 1 (see screenshot). This is prior to printing from the external spool.
Here is a support package: bambuddy-support-20260401-022055.zip. I hope it helps!
@maziggy commented on GitHub (Apr 1, 2026):
Please use ghcr.io/maziggy/bambuddy:daily and check again.
@anunayk commented on GitHub (Apr 1, 2026):
Tried
ghcr.io/maziggy/bambuddy:dailyjust now (I was on 0.2.2.2) but to no avail. Upon loading filament from the external spool, Bambuddy incorrectly recognizes it as AMS Slot 1.@maziggy commented on GitHub (Apr 2, 2026):
Available/Fixed in branch dev and available with the next release or daily build. Please let me know if it works for ou now.