diff --git a/README.md b/README.md index da2b3ef..42b9bca 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,10 @@ SPDX-License-Identifier: GPL-3.0-or-later [![REUSE status](https://api.reuse.software/badge/github.com/bofh69/nfc2klipper)](https://api.reuse.software/info/github.com/bofh69/nfc2klipper) ![GitHub Workflow Status](https://github.com/bofh69/nfc2klipper/actions/workflows/pylint.yml/badge.svg) + # nfc2klipper -Set loaded spool & filament in klipper from NFC tags. +Set loaded spool & filament in klipper from NFC/RFID tags. ## Preparing an NFC reader @@ -29,20 +30,32 @@ for how to configure a raspberry pi for it. ## Preparing klipper -Klipper should have two gcode macros: +When a tag has been read, it will send these gcodes to Klipper: + +* SET_ACTIVE_FILAMENT ID=n1 +* SET_ACTIVE_SPOOL ID=n2 + + +See [klipper-spoolman.cfg] for the klipper config for them. + + +## Preparing the slicer + +For every filament, add a custom start gcode that calls: + +`ASSERT_ACTIVE_FILAMENT ID=` -* SET_ACTIVE_FILAMENT ID=n -* SET_ACTIVE_SPOOL ID=n +where `` is its filament id in Spoolman. +This can be done automatically by using [sm2ss](https://github.com/bofh69/sm2ss). -See [klipper-spoolman.cfg] for klipper config for them. ## Preparing tags The tags should contain an NDEF record with a text block like this: ``` -SPOOL: 3 -FILAMENT: 2 +SPOOL:3 +FILAMENT:2 ``` The numbers are the id numbers that will be sent to the macros in @@ -51,5 +64,5 @@ klipper via the [Moonraker](https://github.com/Arksine/moonraker) API. This can be written via NXP's TagWriter on a phone, or better yet, use the `write_tags.py` program. The later fetches Spoolman's filaments, -shows a simple GUI, press return on the chosen spool and it will be -written to the tag. +shows a simple text interface where the spool can be chosen, then press +return to write to the tag.