miguelbalboa / rfid

Arduino RFID Library for MFRC522
The Unlicense
2.77k stars 1.44k forks source link

NTAG21x timeout during authentification #409

Closed ChrisLSaar closed 6 years ago

ChrisLSaar commented 6 years ago

Step 1: Describe your environment

Step 2: Describe the problem

I am trying to use a NTAG213. Reading and writing works without problems. I use the normal "mfrc522.MIFARE_Read" and the "mfrc522.MIFARE_Ultralight_Write" without errors. I changed the password and also the ACK as described in the example. Of course I adapted the addresses for the NTAG213. Setting the write protection also worked. Now my problem...

I cannot authenticate with the command "mfrc522.PCD_NTAG216_AUTH". I always get a communication timeout.

    Serial.println(F("Authenticate NTAG"));
    byte abyACK[2];
    status = (MFRC522::StatusCode)mfrc522.PCD_NTAG216_AUTH(abyNTAGPwd, abyACK);

    if (status != MFRC522::STATUS_OK)
    {
      #if defined(DEBUG) 
        Serial.print(F("NTAG_Authenticate() failed: "));
        Serial.println(mfrc522.GetStatusCodeName(status));
      #endif
      return;
    }       
  }

Can anyone help me? Does anyone have authentication with a NTAG21x running?

Thank you in advance. Christian