feat: add NTAG215/216 NDEF text record parser for filament#1
Open
bonduodevs wants to merge 2 commits into
Open
feat: add NTAG215/216 NDEF text record parser for filament#1bonduodevs wants to merge 2 commits into
bonduodevs wants to merge 2 commits into
Conversation
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
Add NTAG215/216 (NFC Forum Type 2 Tag) support to the FM175xx RFID reader, enabling automatic filament identification from third-party NFC-tagged spools.
Motivation
The current RFID system only recognizes MIFARE Classic M1 cards (SAK=0x08), which limits filament auto-detection to official Snapmaker-tagged spools. Many third-party filament manufacturers/personal use NTAG215/216 NFC tags. This change allows those tags to be read and parsed automatically, providing material type and color information to the printer.
How It Works
SAK=0x08→ existing M1 flow (unchanged)SAK=0x00→ new NTAG flow: read user memory pages, parse NDEF Text RecordMATERIAL#RRGGBBstring to the NTAG tag using any NFC app (e.g. NFC Tools)PLA#FF5733(orange PLA),PETG#FFFFFF(white PETG)filament_parametersdatabase for temperature and flow defaultsFor basic users
Changes (Too simple)
klippy/extras/filament_protocol.pyntag_ndef_data_parse()— NDEF TLV + Text Record parser, returnsfilament_infodict withVENDOR='Generic',OFFICIAL=Falseklippy/extras/fm175xx_reader.pyFM175XX_MIFARE_CARD_TYPE_NTAGconstant,__reader_a_ntag_read_user_data()page reader, and SAK-basedelifbranch in background threadklippy/extras/filament_detect.pyelifrouting for NTAG card type in_fm175xx_card_info_deal_callback3 files changed, 203 insertions(+), 0 deletions(-)
Backward Compatibility
elifbranches and new functionsprinter.cfgworks as-is)Supported Tag Format
T)enMATERIAL#RRGGBBPLA#FF5733Supported materials: PLA, PLA-CF, PETG, PETG-CF, PETG-HF, PCTG, ABS, ASA, TPU, PVA, PA, PA-CF, PA6-CF, PA-GF, PA6-GF, PC, PC-ABS, EVA