Closed PinkFreud closed 2 years ago
Never mind - this was my own problem. I had the pn532's pins configured incorrectly, but running an external libnfc-based util between runs of the script enabled the reader and left me chasing a red herring.
Configuring CS on D8 and RST on D17 for this reader works, without need to modify adafruit_pn532.py.
With an itead pn532 reader connected to a Raspberry Pi via SPI and the default example script from https://learn.adafruit.com/adafruit-pn532-rfid-nfc/python-circuitpython configured for SPI, running the example would result in the error More than one card detected! being thrown.
Turning on debug, I see that reading from this device w/ no cards results in: Read frame: ['0x0', '0x0', '0xff', '0x3', '0xfd', '0xd5', '0x4b', '0x0', '0xe0', '0x0', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa']
In adafruit_pn532.py, the error is triggered by:
Changing the first if to:
appears to resolve the issue - adafruit_pn532.py no longer erroneously detects a response of '0' as > 1 card present.