Get UID for database query

Asked by Christian on 2015-05-29

Hi there,

is it possible to get the UID for a database query.
I tried :

import nfc

#oeffent den NFC-Reader ueber URAT
clf = nfc.ContactlessFrontend('tty:AMA0:pn53x')

#liest die NFC-Karte aus und uebergibt den Wert in eine Variable
tag= clf.connect(rdwr={'on-connect': connected})

for data in tag:
 test = str(data[0])

print test

But the only result is: " TypeError 'Type4Tag' object is not iterable"

Thx 4 help

Question information

English Edit question
nfcpy Edit question
No assignee Edit question
Last query:
Last reply:

The tag identifier is available as "tag.uid" for Type 1, 2, and 4 Tags, and "tag.idm" for a Type 3 Tag. In the next release nfcpy 0.10 it will be accessible as "tag.identifier".

Regarding your code example, it is only possible to iterate memory on a Type 1 and 2 Tag as you tried. Type 3 and 4 Tags doe not have a flat memory structure that would allow such mapping.

Can you help with this problem?

Provide an answer of your own, or ask Christian for more information if necessary.

To post a message you must log in.