Multi-printer: filament profiles aren't isolated per printer (shared [filament_profiles] section + dropdown mixes printers) #74
Reference in New Issue
Block a user
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?
Hey, running 0.9.27 with two Kobra X printers in one bridge (printer_1 on :7125, printer_2 on :7126). I hit two problems with the per-slot filament profiles that turned out to be related — both come down to the filament side not being split per printer the way the connection is.
1) The slot → profile mapping lives in one global [filament_profiles] section
It's shared between both printers. If I set up the slots on printer 1 and then on printer 2, printer 2 clobbers printer 1, and after a restart (Watchtower updates mine hourly) both come back up with the same mapping — whichever I saved last. visible_vendors does the same thing.
Quick repro:
You can also see it live without a restart: GET /kx/filament/slots on both ports returns identical filament_id / vendor / name per slot, even though each printer has different filaments loaded.
Looks like the connection got namespaced per printer ([printer_N] + self._printer_id) but the filament config didn't:
2) The header dropdown shows the other printer's profiles
This one only becomes visible once #1 is worked around and the two printers actually have different mappings. Open the :7125 page, pick "Kobra 2" in the dropdown, and the filament panel shows Kobra 2's real AMS colors but Kobra 1's profile names. In my case K2's gates are yellow/brown/white/black, but the names read KINGROON / KINGROON / SUNLU / CONJURE, which are K1's profiles.
The dropdown links are href="/printerN", so they navigate within the same port (you end up on :7125/printer2). The page then has to pull Kobra 2's data cross-instance from :7126 via bridge_url, but the /kx/filament/slots (profile name) fetch ends up hitting the local origin (:7125 = K1) — either it isn't using bridge_url or it races initPrinters() setting _activePrinter. So you get K2's colors with K1's names. The mmu/AMS data itself is correct per port; it's just the profile names that leak. Opening :7126 directly is always correct (same origin).
Suggested fixes
I patched both on my box with a boot-time hook and it's been solid — happy to share if it helps.
Thanks for the bridge, it's great otherwise.
Sorry about the AI write up, not very technical and Claude helped me fix this issue
Opened #75 with a fix for this — per-printer
[filament_profiles_<id>]sections plus the dropdown port fix. Targetsnightly.