Skip to content

Feature/spoolman card uid#6

Open
Rocka84 wants to merge 3 commits into
masterfrom
feature/spoolman-card-uid
Open

Feature/spoolman card uid#6
Rocka84 wants to merge 3 commits into
masterfrom
feature/spoolman-card-uid

Conversation

@Rocka84

@Rocka84 Rocka84 commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

This PR completely migrates tag lookup and spool association from relying on legacy fields like lot_nr or SPOOL_ID to utilizing the physical NFC Tag UID (hardware_uid mapped to CARD_UID). This provides a much cleaner, robust, and native way to track physical spools.

It introduces the following major changes:

  • Snapmaker U1 Webhook Update: Sends CARD_UID directly to the filament_detect/set webhook for the SpoolLink agent during spool loading.
  • Auto-Population of UIDs on Manual Load: If a spool is selected manually from the Spoolman list on the display (without an active NFC scan), the first associated card_uid of that spool is automatically loaded and transmitted to the printer.
  • Interactive "Link Spool" UI: Scanning an unlinked, empty NFC tag now displays a "Link Spool" button. Clicking this opens the Spoolman list, and selecting a spool immediately associates the tag's hardware_uid with that spool in Spoolman (appending it to extra.card_uids).
  • Auto-Migration & Fallbacks: The display will automatically fetch Spoolman data upon scanning any physical tag. If it resolves the tag, it will display the correct spool_id. It also supports comma-separated values for multiple tags per spool and auto-appends to the list if migration is needed.
  • Vanilla Spoolman Compatibility: Implements an automatic client-side pagination fallback mechanism. If the Spoolman instance does not support filtering by extra fields (i.e., vanilla Spoolman without PR #904), the ESP32 will automatically fetch spools in chunks and resolve the UID locally, ensuring full compatibility without requiring users to run custom forks.
  • Removed Legacy Hacks: The workarounds generating fake lot_nr identifiers for proprietary Bambu Lab and Snapmaker tags have been completely removed. These tags now natively match via their physical hardware_uid or via the legacy lot_nr fallback if they were saved in the old format.
  • UI Adjustments: Adds a read-only Card UID field to the extended info view so users can easily read the hardware UID.

⚠️ Dependencies & Notes

This PR cannot be merged yet, as it relies on an unmerged upstream feature. It is currently waiting for SnapmakerU1-Extended-Firmware PR #491 which introduces the SpoolLink agent and changes the spool mapping format to use CARD_UID.

Note on Spoolman: We no longer block on Spoolman PR #904 because we implemented a local pagination fallback for vanilla Spoolman instances. Once PR #904 is merged, the fallback code may be removed.

Rocka84 added 2 commits June 21, 2026 13:54
Adds client-side pagination to fetchSpoolmanByExternalId to support Spoolman instances without PR #904. Also adds a note to AGENTS.md.
@Rocka84 Rocka84 force-pushed the feature/spoolman-card-uid branch from 8eeda96 to 44031cb Compare June 21, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant