Spoolman + Snapmaker U1
Multi-Tool Setup

How to connect Spoolman, Moonraker, Snapmaker Orca, and FilaSpool for automatic multi-tool spool tracking.

Third-Party Software Notice

FilaSpool is not affiliated with, endorsed by, or a contributor to Spoolman, Moonraker, Klipper, Snapmaker, or any other third-party project mentioned on this page. These are independent open-source projects with their own maintainers, licenses, and support channels. FilaSpool simply integrates with their APIs. For support with those tools, please refer to their respective documentation and communities.

Important Disclaimer

This setup has only been tested on a Snapmaker U1 running the PAXX12 extended firmware. Other printers, stock firmware versions, or other Klipper/Moonraker setups may behave differently.

Use this at your own risk. Always test with a small print first and confirm that tool changes, filament loading, and Spoolman updates are working correctly before relying on this for a long multi-color print.

What This Setup Does

This setup lets FilaSpool assign Spoolman spool IDs to the slicer's tool/color slots, then lets Snapmaker Orca automatically update Spoolman whenever the print changes tools.

  • Spoolman stores the filament inventory and spool IDs.
  • Moonraker connects the printer to Spoolman.
  • Klipper macros store the current tool-to-spool mapping.
  • Snapmaker Orca injects a macro after each tool change.
  • FilaSpool sends the correct spool ID to the printer before the print starts.

Key Concept: Tool Number = Slicer Color Slot

On the Snapmaker U1 with Snapmaker Orca, TOOL=0 does not necessarily mean physical toolhead #1. It means the first slicer tool/color slot used by the print.

For example, if the first color in the print is physically loaded into the second toolhead, the slicer may still call that color T0. In that case, the app must assign that spool to TOOL=0.

What to map Correct?
Slicer tool/color slot → Spoolman spool ID Yes
Physical toolhead number → Spoolman spool ID No, not reliably

Prerequisites

  • Spoolman is already running and reachable from your network.
  • The Snapmaker U1 is running PAXX12 extended firmware.
  • You can edit the printer's Klipper and Moonraker configuration files.
  • You know your printer IP address.
  • FilaSpool knows the Spoolman spool ID stored on the NFC tag.

Example values used in this guide:

Spoolman URL: http://199.0.0.158:7912
Printer IP:   199.0.0.44

Step 1 — Configure Moonraker

On the printer, edit moonraker.conf and add:

[spoolman]
server: http://199.0.0.158:7912
sync_rate: 5

Restart Moonraker after saving the file.

Use the IP address and port for your own Spoolman server. Do not include a trailing slash at the end of the URL.

Step 2 — Add the Multi-Tool Macro File

Create a new Klipper config file named:

spoolman_multi.cfg

Paste the following contents into it:

#############################################
# SPOOLMAN MULTI-TOOL SETUP - U1 SAFE VERSION
# Tested on Snapmaker U1 with PAXX12 extended firmware
#############################################

[gcode_macro SET_TOOL_SPOOL]
description: Assign Spoolman spool ID to a slicer tool/color slot
variable_spool_map: {0: None, 1: None, 2: None, 3: None}
gcode:
  {% set tool = params.TOOL|int %}
  {% set spool = params.ID|int %}
  {% set new_map = printer["gcode_macro SET_TOOL_SPOOL"].spool_map.copy() %}
  {% set _ = new_map.update({tool: spool}) %}
  SET_GCODE_VARIABLE MACRO=SET_TOOL_SPOOL VARIABLE=spool_map VALUE="{new_map}"
  {action_respond_info("Tool %d assigned to Spool %d" % (tool, spool))}


[gcode_macro ACTIVATE_SPOOL_FOR_TOOL]
description: Set Spoolman active spool based on slicer tool/color slot
gcode:
  {% set tool = params.TOOL|int %}
  {% set spool_map = printer["gcode_macro SET_TOOL_SPOOL"].spool_map %}
  {% set spool_id = spool_map[tool] %}

  {% if spool_id != None %}
    {action_call_remote_method(
       "spoolman_set_active_spool",
       spool_id=spool_id
    )}
    {action_respond_info("Spoolman active spool set: Tool %d -> Spool %d" % (tool, spool_id))}
  {% else %}
    {action_respond_info("Tool %d has no Spoolman spool assigned" % tool)}
  {% endif %}


[gcode_macro CLEAR_TOOL_SPOOL]
description: Clear assigned Spoolman spool ID from a slicer tool/color slot
gcode:
  {% set tool = params.TOOL|int %}
  {% set new_map = printer["gcode_macro SET_TOOL_SPOOL"].spool_map.copy() %}
  {% set _ = new_map.update({tool: None}) %}
  SET_GCODE_VARIABLE MACRO=SET_TOOL_SPOOL VARIABLE=spool_map VALUE="{new_map}"
  {action_respond_info("Tool %d spool assignment cleared" % tool)}


[gcode_macro USE_TOOL_SPOOL]
description: Switch slicer tool/color slot and activate its assigned Spoolman spool
gcode:
  {% set tool = params.TOOL|int %}

  {% if tool == 0 %}
    T0
  {% elif tool == 1 %}
    T1
  {% elif tool == 2 %}
    T2
  {% elif tool == 3 %}
    T3
  {% else %}
    {action_raise_error("Invalid tool. Use TOOL=0, TOOL=1, TOOL=2, or TOOL=3")}
  {% endif %}

  ACTIVATE_SPOOL_FOR_TOOL TOOL={tool}

Step 3 — Include the Macro File

Open printer.cfg and add this line:

[include spoolman_multi.cfg]

Save the file and restart Klipper:

RESTART
Do not try to override or rename T0, T1, T2, or T3 on the Snapmaker U1. On this firmware they are not normal Klipper macros, and attempting to wrap them may halt the printer with a macro registration error.

Step 4 — Test the Printer Macros

From the printer console, run:

SET_TOOL_SPOOL TOOL=0 ID=27
ACTIVATE_SPOOL_FOR_TOOL TOOL=0

If everything is working, Spoolman should switch its active spool to ID 27.

You can also test from another computer using Moonraker:

curl -X POST http://199.0.0.44/printer/gcode/script \
  --data-urlencode $'script=SET_TOOL_SPOOL TOOL=0 ID=27\nACTIVATE_SPOOL_FOR_TOOL TOOL=0'
If this updates the active spool in Spoolman, Moonraker, Klipper, and Spoolman are connected correctly.

Step 5 — What the App Sends Before Printing

FilaSpool reads the NFC tag, determines the Spoolman spool ID, and assigns that spool ID to the correct slicer tool/color slot.

Example: assign four slicer tool/color slots before a print:

curl -X POST http://199.0.0.44/printer/gcode/script \
  --data-urlencode $'script=SET_TOOL_SPOOL TOOL=0 ID=14'

curl -X POST http://199.0.0.44/printer/gcode/script \
  --data-urlencode $'script=SET_TOOL_SPOOL TOOL=1 ID=27'

curl -X POST http://199.0.0.44/printer/gcode/script \
  --data-urlencode $'script=SET_TOOL_SPOOL TOOL=2 ID=31'

curl -X POST http://199.0.0.44/printer/gcode/script \
  --data-urlencode $'script=SET_TOOL_SPOOL TOOL=3 ID=20'
Slicer tool/color slot Spoolman spool ID
TOOL=0 14
TOOL=1 27
TOOL=2 31
TOOL=3 20
The app does not need to call Spoolman directly for normal operation. It should send G-code to Moonraker. Moonraker and the Klipper macro will update Spoolman.

Step 6 — Update Machine Start G-code

In Snapmaker Orca, go to the printer profile and find the Machine start G-code section.

Find this section:

G28 X Y
;===== 床面异物检测 ========
T{initial_extruder}
G90

Change it to:

G28 X Y
;===== 床面异物检测 ========
T{initial_extruder}
ACTIVATE_SPOOL_FOR_TOOL TOOL={initial_extruder}
G90

This activates the correct Spoolman spool for the first slicer tool/color slot at the start of the print.

Step 7 — Update Change Filament G-code

In Snapmaker Orca, find the Change filament G-code section.

Find this part:

"M400" + "
";
"T" + next_extruder + "
";
if filament_type[next_extruder] == "PVA" then

Change it to:

"M400" + "
";
"T" + next_extruder + "
";
"ACTIVATE_SPOOL_FOR_TOOL TOOL=" + next_extruder + "
";
if filament_type[next_extruder] == "PVA" then

Now every time Snapmaker Orca switches slicer tool/color slots, it will tell Spoolman to activate the spool assigned to that slot.

Step 8 — Expected Workflow

  1. Create or select the spool in Spoolman.
  2. Write the Spoolman spool ID to the NFC tag using FilaSpool.
  3. Load the filament into the printer.
  4. Before printing, FilaSpool sends SET_TOOL_SPOOL commands to Moonraker.
  5. Snapmaker Orca starts the print and calls ACTIVATE_SPOOL_FOR_TOOL for the initial tool.
  6. Whenever the print changes tools, Snapmaker Orca calls ACTIVATE_SPOOL_FOR_TOOL again.
  7. Spoolman tracks usage against the correct active spool.

Testing Checklist

  • Confirm Spoolman is reachable in a browser.
  • Confirm [spoolman] exists in moonraker.conf.
  • Confirm spoolman_multi.cfg is included in printer.cfg.
  • Run SET_TOOL_SPOOL TOOL=0 ID=27.
  • Run ACTIVATE_SPOOL_FOR_TOOL TOOL=0.
  • Confirm Spoolman switches to spool ID 27.
  • Slice a small multi-color test print.
  • Open the generated G-code and confirm it contains ACTIVATE_SPOOL_FOR_TOOL TOOL= after tool changes.

Troubleshooting

Moonraker returns "Missing Argument [script]"

Use --data-urlencode instead of sending JSON:

curl -X POST http://199.0.0.44/printer/gcode/script \
  --data-urlencode $'script=SET_TOOL_SPOOL TOOL=0 ID=27\nACTIVATE_SPOOL_FOR_TOOL TOOL=0'

Printer halts with "gcode command T0 already registered"

Do not create your own T0, T1, T2, or T3 macros. Use the safe macro file above and inject ACTIVATE_SPOOL_FOR_TOOL from Snapmaker Orca instead.

Printer halts with "G-Code macro rename of different types"

This means the firmware's tool-change commands are not normal Klipper macros. Do not use rename_existing on T0, T1, T2, or T3.

Spoolman changes only at print start, not during tool changes

Confirm the Snapmaker Orca Change Filament G-code includes:

"ACTIVATE_SPOOL_FOR_TOOL TOOL=" + next_extruder + "
";

Wrong spool is selected

Check whether the app is mapping physical toolheads instead of slicer tool/color slots. The correct mapping is slicer tool/color slot → Spoolman spool ID.

Summary

The final setup is:

FilaSpool → Moonraker → Klipper macro → Spoolman

FilaSpool assigns spool IDs to slicer tool/color slots. Snapmaker Orca activates the correct spool at print start and after each tool change. Spoolman then tracks filament usage against the correct spool.