Skip to content

Install klipper-nfc-daemon

For any Klipper-style host in the fleet — Voron, Snapmaker J1S behind the bridge, or any other printer running Moonraker (real or bridge).

Prerequisites

Install (real Klipper host)

cd ~
git clone https://github.com/goeland86/klipper-nfc-daemon.git
cd klipper-nfc-daemon
./install.sh

install.sh will:

  • Create a venv at ~/nfc-spoolman-env
  • pip install pyserial requests
  • Copy nfc_spoolman.py + the readers/ package to ~/
  • Copy nfc_spoolman.cfg.example to ~/printer_data/config/nfc_spoolman.cfg (only if not already present)
  • Install + enable the nfc-spoolman systemd unit
  • Append nfc-spoolman to ~/printer_data/moonraker.asvc so Moonraker can manage the service

Install (J1S Pi image)

Already installed — the image build runs the same install steps in-chroot. Just edit the config and restart the service.

Configure

~/printer_data/config/nfc_spoolman.cfg:

[nfc]
reader = pn532
pn532_device = /dev/ttyUSB0
pn532_baudrate = 115200

poll_interval = 0.5
debounce_time = 5.0

# single | multi_tool
mode = multi_tool

# multi_tool only: which tool indices to offer in the prompt
tools = 0,1,2,3,4

# auto-create Spoolman spool from unrecognized OpenPrintTag
auto_create = false

# update Mainsail preheat preset
mainsail_preset = true

# write to Klipper save_variables
klipper_variables = true

[spoolman]
url = http://your-spoolman-host:7912

[moonraker]
url = http://localhost:7125

Add Klipper config (real Klipper only)

# printer.cfg
[respond]
[save_variables]
filename: ~/printer_data/config/saved_variables.cfg
[include nfc_macros.cfg]

Copy nfc_macros.cfg from the repo to ~/printer_data/config/:

cp ~/klipper-nfc-daemon/nfc_macros.cfg ~/printer_data/config/

Restart Klipper to pick up the config changes:

sudo systemctl restart klipper

Skip this section on the J1S — the bridge has all of this built in.

Reader-specific extras

No extra packages. Set DIP switches / solder jumpers on the PN532 breakout to UART mode (not I2C, not SPI). Connect via a USB-UART bridge (PL2303, FTDI, CH340) or directly to GPIO UART pins.

Verify the OS sees it:

ls -l /dev/ttyUSB*
sudo apt install -y libnfc-bin
nfc-list
~/nfc-spoolman-env/bin/pip install spidev gpiod
# or, if gpiod isn't packaged:
~/nfc-spoolman-env/bin/pip install RPi.GPIO

Wiring is controller- and breakout-specific. Refer to your controller's GPIO/SPI documentation and your PN5180 reader's documentation for the correct pin assignments. Then set pn5180_busy_pin and pn5180_reset_pin in nfc_spoolman.cfg to match.

sudo apt install -y pcscd libpcsclite-dev
~/nfc-spoolman-env/bin/pip install pyscard
sudo systemctl enable --now pcscd

Verify:

sudo apt install -y pcsc-tools
pcsc_scan

Start the service

sudo systemctl start nfc-spoolman
sudo systemctl status nfc-spoolman
journalctl -u nfc-spoolman -f

Scan a known tag — expect a log line like:

NFC: detected TigerTag UID=04:12:34:56:78:9A:BC
NFC: matched spool_id=42 (PolyTerra PLA Red)
NFC: prompt sent for multi-tool assignment

Troubleshooting

Symptom Likely cause Fix
Config file not found at startup nfc_spoolman.cfg missing cp ~/klipper-nfc-daemon/nfc_spoolman.cfg.example ~/printer_data/config/nfc_spoolman.cfg
Tag scans but no Spoolman match Tag not registered in Spoolman, or Spoolman NFC env vars not set Check Spoolman SPOOLMAN_NFC_ENABLED=TRUE + SPOOLMAN_TIGERTAG_ENABLED=TRUE
Prompt dialog never appears in Mainsail [respond] missing in printer.cfg (real Klipper) Add [respond], restart Klipper
NFC_ASSIGN_TOOL: unknown command nfc_macros.cfg not included (real Klipper) Add [include nfc_macros.cfg], restart Klipper
Same tag triggers repeatedly debounce_time too low for your reader's poll rate Raise to 5–10 s
Python errors about | in type hints Pre-Python-3.9 host Upgrade Python; the daemon supports 3.9+