Add Spoolman card_uid lookup, Snapmaker U1 CARD_UID API, and wifi_ssid/wifi_pass commands#5
Open
ChrisBGL wants to merge 2 commits into
Open
Conversation
…s commands
Spoolman card_uid lookup (NetworkManager.cpp, main.cpp):
- fetchSpoolmanByExternalId now fetches /api/v1/spool?allow_archived=true
in a single request and searches all spools in one pass - no extra HTTP call
- Checks spool.extra.card_uids first (comma-separated, JSON-encoded strings)
against data.hardware_uid; normalises both sides (uppercase, strip
colons/hyphens/spaces/quotes/0x prefix) before comparing
- Falls back to lot_nr match if no card_uid hit is found
- fetchSpoolmanData gate widened: hardware_uid OR lot_nr triggers the lookup
- main.cpp Spoolman fetch condition extended to also fire on hardware_uid
Snapmaker U1 CARD_UID payload (NetworkManager.cpp):
- When hardware_uid is valid, sends {channel:N,info:{CARD_UID:[...]}}
instead of vendor/material/colour data; U1 Extended Firmware resolves the
spool from Spoolman itself via CARD_UID
- UID normalisation: strips 0x, colons, hyphens, spaces, quotes; uppercases;
splits into decimal byte array
- Validation: non-empty, even hex length, only [0-9A-F] chars; logs error
and skips request if invalid
- Falls back to existing VENDOR/MAIN_TYPE/RGB_1/... payload when no valid
UID is present (backwards compatible)
- Serial debug logs show raw UID, normalised UID, byte array, HTTP response
Wi-Fi SSID/password with spaces (SerialTerminal.cpp):
- New commands: set wifi_ssid <ssid> and set wifi_pass <password>
accept the full remainder of the line, so SSIDs or passwords containing
spaces work without quoting
- Existing set wifi <ssid> <password> unchanged (backwards compatible)
- get config outputs set wifi_ssid / set wifi_pass when SSID contains spaces
- help text updated to document all three variants
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This was referenced Jun 10, 2026
- Added static labelHardwareUid member to DisplayUI - create_ext_row for Card UID in buildExtendedInfoScreen, placed after Lot Nr - set_field for hardware_uid in showExtendedInfoScreen - Row is hidden automatically when no UID is present Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
1. Spoolman
card_uidslookup (NetworkManager.cpp,main.cpp)fetchSpoolmanByExternalIdfetches/api/v1/spool?allow_archived=truein a single HTTP request and iterates all spools in one passspool.extra.card_uids(Spoolman JSON-encoded string, comma-separated) againstdata.hardware_uid— normalises both sides (uppercase, strip colons/hyphens/spaces/quotes/0xprefix) before comparinglot_nrmatch if nocard_uidhit is foundfetchSpoolmanDatagate widened:hardware_uidorlot_nrnow triggers the lookup (previously requiredhardware_uid)main.cppSpoolman fetch condition extended to also fire whenhardware_uidis set2. Snapmaker U1
CARD_UIDpayload (NetworkManager.cpp)hardware_uidis valid, sends{"channel":N,"info":{"CARD_UID":[86,132,77,206]}}instead of vendor/material/colour fields — the U1 Extended Firmware resolves the spool from Spoolman automatically viaCARD_UID0x, colons, hyphens, spaces, quotes; uppercases; splits into decimal byte array (e.g.56:84:4D:CE→[86,132,77,206])[0-9A-F]— logs error and skips request if invalidVENDOR/MAIN_TYPE/RGB_1/... payload when no valid UID is present3. Wi-Fi SSID/password with spaces (
SerialTerminal.cpp)set wifi_ssid <ssid>andset wifi_pass <password>accept the full remainder of the line, so SSIDs or passwords containing spaces work without quotingset wifi <ssid> <password>is unchanged (backwards compatible)get configoutputsset wifi_ssid/set wifi_passwhen the stored SSID contains spaces, so the output is always directly re-enterablehelptext updated to document all three variantsTest plan
pio test -e desktop— 18/18 tests pass (verified)pio run -e pn5180— builds and flashes successfully (verified)spool.extra.card_uidsin Spoolman — spool resolves correctlyCARD_UIDbyte array, U1 accepts requestset wifi_ssid My Network Name+set wifi_pass secret— connects successfullyset wifi simpleSSID password— still works as before🤖 Generated with Claude Code