Adafruit - THE MUSICAL - is here! Get a musical tour of Becky's favorite tools around the Adafruit factory (video) and subscribe!

Can't Re-Write to my RFID tag?
Moderators: adafruit_support_bill, adafruit

Can't Re-Write to my RFID tag?

by ollienx on Fri Nov 09, 2012 7:00 pm

Hey guys,

I just bought the RFID shield, and then when I tried to my tag, I accidentally wrote adafruit.com to it. I thought, no big deal, I'll just reformat it. However, now it only redirects to adafruit.com even if I change the code. Any ideas?
ollienx
 
Posts: 1
Joined: Fri Nov 09, 2012 6:58 pm

Re: Can't Re-Write to my RFID tag?

by ktownsend on Fri Nov 09, 2012 9:46 pm

There is an NXP app for NFC that should allow you to manipulate tags, though I don't have my phone right here in front of me to find it. Just search for NXP in the app store, they don't have 50 apps.
User avatar
ktownsend
 
Posts: 378
Joined: Thu Nov 05, 2009 2:18 am

Re: Can't Re-Write to my RFID tag?

by Ga_Gpa on Thu Feb 14, 2013 8:06 pm

Hi,

I recently bought the arduino shield, I used the mifareclassic_formatndef example sketch. I wrote the sample adafruit.com url, and tried to re-write to an email. I have had no success, I have commented out the adafurit and un-commented the "mailto" statement.
Still no luck. Can anyone tell me what I am doing wrong.
Ga_Gpa
 
Posts: 2
Joined: Sat Feb 02, 2013 11:03 am

Re: Can't Re-Write to my RFID tag?

by ktownsend on Fri Apr 19, 2013 6:19 am

The problem here is the authentication keys in the format example.

Format starts with a blank Mifare Classic card, with the authentication key set to 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF.

NDEF formatted tags use a different authentication key, which is written to the sector during the format process.

So ... when you try to rewrite to the same sector the sample format code uses the old authentication key which won't work.

I just added a new example that should allow you to update records on previously formatted card: mifareclassic_updatendef

Be sure to only use the next example on cards that have already been formatted via mifareclassic_formatednef or you will have similar authentication key issues.

You'll need to get the latest code from github, but you can see the source here if you are curious: https://github.com/adafruit/Adafruit_NF ... updatendef
User avatar
ktownsend
 
Posts: 378
Joined: Thu Nov 05, 2009 2:18 am