PN532 Unresponsive After One Successful Scan
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nfcpy |
Invalid
|
Undecided
|
Unassigned |
Bug Description
My setup:
Raspberry Pi 2 running Raspbian with a PN532 Breakout Board connected using the USB to FTDI cable sold by Adafruit.
Success case #1:
Using NFC Tools version 0.10.0, running tagtool.py, I am able to successfully read MIFARE Ultralight C tags.
Example:
$ python examples/tagtool.py --device tty:USB0:pn532
[nfc.clf] searching for reader on path tty:USB0:pn532
[nfc.clf] using PN532v1.6 at /dev/ttyUSB0
** waiting for a tag **
Type2Tag 'NXP NTAG213' ID=04C461224B3F80
NDEF Capabilities:
readable = yes
writeable = yes
capacity = 137 byte
message = 3 byte
NDEF Message:
record 1
type = ''
name = ''
data = ''
Success case #2:
If I **downgrade** to version 0.9.2, I am able to successfully read MIFARE Ultralight C tags, using a script as follows
import nfc
def on_connected(tag):
print(tag)
clf = nfc.Contactless
clf.connect(
Note the use of the pn53x driver, not sure if that's significant.
Failure Case:
If, however, using nfcpy 0.10.0 I try to run the same script above except with pn532 in place of pn53x, I am able to read a tag successfully exactly once.
pi@raspberry ~/nfcpy $ python test.py
Type2Tag 'NXP NTAG213' ID=04C461224B3F80
pi@raspberry ~/nfcpy $ python test.py
Traceback (most recent call last):
File "test.py", line 6, in <module>
clf = nfc.Contactless
File "/home/
if path and not self.open(path):
File "/home/
self.device = device.
File "/home/
device = driver.init(tty)
File "/home/
if (transport.
File "/home/
raise IOError(
IOError: [Errno 110] Connection timed out
After this happens, tagtool, the script in success case #2, and nfc-poll are all also unable to read tags from the PN532 until I unplug the USB to Serial adapter from the Pi and plug it back in.
This may be related to the apparent regression in Florian's 2015-09-19 post here https:/ /answers. launchpad. net/nfcpy/ +question/ 237349 .