MFRC522-python icon indicating copy to clipboard operation
MFRC522-python copied to clipboard

AUTH ERROR

Open afkham opened this issue 10 years ago • 12 comments

The following error is printed when running this Python code:


Card detected Card read UID: 13,136,60,202,115 Size: 8 AUTH ERROR!! AUTH ERROR(status2reg & 0x08) != 0

AUTH ERROR

afkham avatar May 25 '14 19:05 afkham

I've fixed the issue with authentication. Until the maintainer of this repo answers the issue I created, you can get the working code from: https://github.com/mj3052/MFRC522-Pi

mj3052 avatar Jun 23 '14 10:06 mj3052

@mj3052 hey Mat already i have reported in your repo https://github.com/mj3052/MFRC522-Pi still this Auth Error exist can you please look into that, because when i try to use dump.py it reads once and later it prints only auth error msg which is shared already by @afkham-azeez . I am using nodejs to python-shell to run this library.

whitehorse5353 avatar Jul 07 '14 06:07 whitehorse5353

Hi, Did you fix the authentication problem? I've the same problem with the MFCrypto1ON bit of the register "Status2Reg"

Denisfmartinez avatar Apr 02 '15 19:04 Denisfmartinez

I have fixed the issue with auth error, so you can try my fork: https://github.com/mikicaivosevic/MFRC522-python

mikicaivosevic avatar Oct 04 '16 11:10 mikicaivosevic

@mikicaivosevic Hello,I found https://github.com/mikicaivosevic/MFRC522-python still this Auth Error exist,what can i do?

xcxz1994 avatar Mar 31 '17 13:03 xcxz1994

Also having the same issue. I've tried all the common auth keys as well as all the different forks out there of this library with no success. I have at least verified that the MFRC522 can for sure read the NTAG213 and NTAG216 rfid tags using the arduino MRFC522 library. Maybe comparing the way that library works vs this one would help.

TheRealBanana avatar Apr 22 '17 08:04 TheRealBanana

I also have this autherror and it is the same error like afkham. The error only came if i used the small rfid tag, it didn't happened with the big card.

doppelhund-developer avatar Jan 28 '19 19:01 doppelhund-developer

the tag may not support authentication. Try something like:

nfc.SelectTag(uid) for i in range(16): nfc.Read(i)

robertmuth avatar Mar 31 '19 20:03 robertmuth

Where do I put that @robertmuth ?

nfc.SelectTag(uid) for i in range(16): nfc.Read(i)

CosmaP avatar Jun 17 '19 10:06 CosmaP

If the tag does not support authentication, you should simply not call MIFAREReader.MFRC522_Auth(MIFAREReader.PICC_AUTHENT1A, 8, key, uid). For example around line 85 in the Read.py example. If you would out comment that line and just call MIFAREReader.MFRC522_Read(8) instead, it will work for cards without authentication (or at least it seems so in my first checks).

In a broader sense, this is not a great solution, as you will now no longer support tags that require auth. So, doing a try, catch etc (or some other design) is better, but requires some other changes as well.

I hope I will be able to pull that off soon.

Kobes avatar Dec 08 '19 09:12 Kobes

Thanks Kobes, I will try that tomorrow.

CosmaP avatar Dec 08 '19 20:12 CosmaP

Hello there, I had the same issue when reading the 13.56 Mhz tags. What I did is to go to the SimpleMFRC522.py file located in /usr/local/lib/python3.7/dist-packages/mfrc522/SimpleMFRC522.py, I commented the following lines. ` # Check if an error occurred

if not (status == self.MI_OK):

self.logger.error("AUTH ERROR!!")

if not (self.Read_MFRC522(self.Status2Reg) & 0x08) != 0:

self.logger.error("AUTH ERROR(status2reg & 0x08) != 0")`

so far so goo!

Sologaistoa avatar May 12 '21 02:05 Sologaistoa