Can't get UID or indentifier

Asked by A

I can't seem to print out the UID from the tag.
I can get the tag object successfully but can't seem to print the UID.
Can anyone see what's wrong?

def connected(tag):
        return False

clf = nfc.ContactlessFrontend('tty:AMA0:pn532')
tag = clf.connect(rdwr={'on-connect': connected})

Traceback (most recent call last):
  File "", line 27, in <module>
    tag = clf.connect(rdwr={'on-connect': connected})
  File "/home/pi/dev/toy/app/python/nfc/clf/", line 547, in connect
    result = self._rdwr_connect(rdwr_options, terminate)
  File "/home/pi/dev/toy/app/python/nfc/clf/", line 573, in _rdwr_connect
    if options['on-connect'](tag):
  File "", line 13, in connected
AttributeError: 'NTAG213' object has no attribute 'uid'

Question information

English Edit question
nfcpy Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :

Since version 0.10.0 there is a 'tag.identifier' attribute for all tag types. In case of a Type 2 Tag it contains the UID.

Can you help with this problem?

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

To post a message you must log in.