NFC data transfer too slow using nfcpy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nfcpy |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi guys,
I have written a python application, based on nfcpy, that transfers a binary file onto a type 2 tag.
So far everything worked fine besides the transfer speed. On windows the transfer rate is around 200Bytes/second and on Linux slightly better, 280Bytes/second whereas I would expect a closer values to the theoretical value of 800Bytes/second.
I have stripped completely my python script and my Tag code, so basically I can't blame any of the two applications.
When debugging I do see that the messages take quite a while to write, around 0.8 seconds per record, which is quite a lot. My records have 150 bytes.
So at this point I am inclined to blame the USB driver or the nfcpy which are the only black boxes in this setup.
I have used two different card readers, the Sony S380 and the ACR122, the results on the Sony are slightly better, maybe because it uses a newer version of the PN5XX (PN533) and the ACR122 uses the PN532.
Regarding the drivers I have been using the native drivers, which don't work, and the lisbusb v1.2.6.0, libusbkcv3.0.7.0 which give the above results.
On Linux, the performance increases a bit, to around 250bytes/second, still far from the intended speed.
Does someone have an idea how I can improve the transfer rate on my setup?
my code:
...
if __name__ == '__main__':
...
msg = None
with nfc.Contactless
nfctag = None
while not nfctag or not nfctag.ndef:
def onconnect(tag):
def onrelease(tag):
nfctag = clf.connect(
if (packageDebugEn
...
with open(BinaryFile, "rb") as binaryFile:
while (transfer == TRANSFER_ONGOING):
...
if (readyForNextPa
...
...
...
....
Can you please measure transfer speed with tagtool.py. For read use "tagtool.py -d nfc.tag --reltime -v" and calculate the data rate from a number of consecutive read ops. Similar for write with "tagtool.py load <binary- ndef-file> ".
With an NTAG216 I get about 670 byte/sec for reading and 435 byte/sec for writing.