Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NDEF URL gets mangled for some tags #247

Open
Hoggy78 opened this issue Jan 20, 2024 · 0 comments
Open

NDEF URL gets mangled for some tags #247

Hoggy78 opened this issue Jan 20, 2024 · 0 comments

Comments

@Hoggy78
Copy link

Hoggy78 commented Jan 20, 2024

Hello

I have the code:

    #read the tag ID
    tag = nfc.tag.activate(clf, target)
    tag_id = str(tag).split('ID=')[1]

    if last_tag != tag_id:

        #write the URL
        time.sleep(0.2)
        url_address= 'https://app.xxxxxxxxxxxxxx.com/index.php?uid='+tag_id
        print (url_address)
        uri, title = url_address, "My Title"
        time.sleep(0.1)
        tag.ndef.records = [ndef.SmartposterRecord(uri, title)]
        time.sleep(0.1)

This pretty much works 50/50, some tags it writes well, others the URI is mangled for example:

https://app.xxxxxxxxxxxxxx.com0448551a2e1291448551a2e1291/

where the UUID of the tag is 0448551A2E1291

I put some sleeps in in case it wasn't completing the write before my loops but that made no difference, i also printed the URL to screen to make sure that is being formulated correctly and it is so it is the write part that is inconsistent.

With some tags it works perfectly, but others do not, they are all Ntag213, the same spec tags

I also tried erasing the tags

Ideally, I would like to just do this by enabling mirroring on the NTag 21x protocol if that is a cleaner method, but I can't find documentation for that on nfcpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant