Skip to content

Commit 0a5c228

Browse files
committed
Add spool_id support to RFID filament protocol
Add `spool_id` field to OpenSpool protocol for integration with spool management systems. The `spool_id` is stored in `print_task_config` and can be set via RFID tags or `SET_PRINT_FILAMENT_CONFIG` command.
1 parent 3af2058 commit 0a5c228

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

docs/rfid_support.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ Example payload:
6161
"min_temp": 190,
6262
"max_temp": 220,
6363
"bed_min_temp": 50,
64-
"bed_max_temp": 60
64+
"bed_max_temp": 60,
65+
"spool_id": 1
6566
}
6667
```
6768

@@ -101,6 +102,7 @@ Using the non-standard OpenSpool `subtype` field it is possible to specify a mat
101102
- `additional_color_hexes` - Additional colors for multicolor spools (up to 4)
102103
- `weight` - Spool weight in grams
103104
- `diameter` - Filament diameter in mm (e.g., 1.75)
105+
- `spool_id` - Spoolman spool ID for integration with spool management systems
104106

105107
### Snapmaker Orca Naming Convention
106108

overlays/firmware-extended/13-patch-rfid/root/home/lava/klipper/klippy/extras/filament_protocol_ndef.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ def openspool_parse_payload(payload, card_uid=[]):
224224
info['OFFICIAL'] = True
225225
info['CARD_UID'] = card_uid
226226

227+
try:
228+
info['SPOOL_ID'] = int(data.get('spool_id', 0))
229+
except (ValueError, TypeError):
230+
info['SPOOL_ID'] = 0
231+
227232
return filament_protocol.FILAMENT_PROTO_OK, info
228233

229234
except json.JSONDecodeError as e:

overlays/firmware-extended/13-patch-rfid/test/openspool-pla-basic.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
"min_temp": 190,
88
"max_temp": 220,
99
"bed_min_temp": 50,
10-
"bed_max_temp": 60
10+
"bed_max_temp": 60,
11+
"spool_id": 1
1112
}

0 commit comments

Comments
 (0)