From d341b867480403a6250f702882a11bdb82d52e8c Mon Sep 17 00:00:00 2001 From: maziggy Date: Thu, 26 Mar 2026 10:31:18 +0100 Subject: [PATCH] Fix Read Tag diagnostic failing on NTAG tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The read_tag.py diagnostic script had stale PN5180 NTAG methods: TX CRC was off (should be on), no Crypto1 clear, no IDLE→TRANSCEIVE state reset. Multi-batch reads failed because the PN5180 enters an unrecoverable state after an NTAG READ — requires a full GPIO hardware reset between 4-page batches. Also rejected SAK 0x04 as unsupported. Synced write methods with daemon. --- spoolbuddy/scripts/read_tag.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spoolbuddy/scripts/read_tag.py b/spoolbuddy/scripts/read_tag.py index b0b333f64..0bd62a361 100644 --- a/spoolbuddy/scripts/read_tag.py +++ b/spoolbuddy/scripts/read_tag.py @@ -373,16 +373,18 @@ class PN5180: return self.read_data(16) def _ntag_reactivate(self) -> bool: - """RF cycle with extended timing for NTAG re-selection between reads.""" - self.rf_off() - time.sleep(0.050) # 50ms RF gap — NTAG needs longer than MIFARE Classic + """Full hardware reset + RF activation for NTAG re-selection between reads. - self.write_reg(0x03, 0xFFFFFFFF) # Clear IRQs + The PN5180 enters an unrecoverable state after an NTAG READ command — + simple RF off/on cycles cannot re-select the tag. A full GPIO hardware + reset is required to clear the internal transceiver state. + """ + self.reset() self.load_rf_config(0x00, 0x80) # ISO 14443A time.sleep(0.010) - self.rf_on() - time.sleep(0.050) # Let tag power up fully + time.sleep(0.030) + self.set_transceive_mode() return self.activate_type_a() is not None