mxgxw / MFRC522-python

A small class to interface with the NFC reader Module MFRC522
GNU Lesser General Public License v3.0
524 stars 418 forks source link

7 byte UID #4

Open michellampo opened 10 years ago

michellampo commented 10 years ago

I tried the your lib and it works great (haven't tried the reading and writing data yet).

My problem is that when I use my Mifare Ultralight cards that have a 7 Byte UID instead of the 4 Bytes of a Mifare 1K. I've been searching myself for hours but I can't figure out how to change the code or what to call.

According to the datasheet the Mifare Ultralight cards are supported so I don't know why I can't get it fixed. Any chance you could add support for it?

rena2019 commented 10 years ago

Check my arduino RC522 code commit for the difference between 4-/7-bit https://github.com/rena2019/myarduino/commit/8a98131179390f31e10ab5d032c12e64788c3b43

mxgxw commented 10 years ago

Thanks Rena2019!

I'll try to migrate your detection code.

Regards, Mario.

rena2019 commented 10 years ago

One more info: only the first 4 bytes of print "Card read UID: "+str(backData[0])+","+str(backData[1])+","+str(backData[2])+","+str(backData[3])+","+str(backData[4])

are the UID -> please remove "str(backData[4]"

dektiram commented 9 years ago

I use library writing in C and compiled on my RasPi and success. http://bsd.ee/~hadara/blog/?p=1017 So use shell command to drive it from python.

BlesB commented 8 years ago

Hello, maybe can somebody use this "litte+dirty" example for read UID of DESFire cards. With both files (changed MFRC522.py and rewrited Read.py to uidRead.py) I read both UID from Mifare Classic and DESFire 8k EV1. Yours Bles MFRC522.py.txt uidRead.py.txt