We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In my loop() I have the following:
void loop() { if ( ! mfrc522.PICC_IsNewCardPresent() || ! mfrc522.PICC_ReadCardSerial() ){ delay(30); return; } Serial.print(F("Card UID:")); for (byte i = 0; i < mfrc522.uid.size; i++) { if(mfrc522.uid.uidByte[i] < 0x10) Serial.print(F(" 0")); else Serial.print(F(" ")); Serial.print(mfrc522.uid.uidByte[i], HEX); } Serial.println(); readstatus = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, 4, &key, &(mfrc522.uid)); if (readstatus != MFRC522::STATUS_OK) { Serial.print(F("Authentication failed: ")); Serial.println(mfrc522.GetStatusCodeName(readstatus)); //reset everything for the next card mfrc522.PCD_StopCrypto1(); return; } byte buffer[18]; readstatus = mfrc522.MIFARE_Read(block, buffer, &len); if (readstatus != MFRC522::STATUS_OK) { Serial.print(F("Reading failed: ")); Serial.println(mfrc522.GetStatusCodeName(readstatus)); //reset everything for the next card mfrc522.PCD_StopCrypto1(); return; } //reset everything for the next card mfrc522.PCD_StopCrypto1(); String value = ""; for (uint8_t i = 0; i < 16; i++) { value += (char)buffer[i]; } value.trim(); Serial.println(value); }
I am reading the content of block 4 of the card.
In general things work well but eventually (after about 20-30 reads) I get the following error.
Reading failed: The CRC_A does not match.
Which in itself is not a problem. Only issue is that on all following reads I get the this error:
Reading failed: A buffer is not big enough.
I then have to restart my Arduino (D1 mini). Is this a bug or a problem with how I have set the code up?
Thanks,
Pete.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In my loop() I have the following:
I am reading the content of block 4 of the card.
In general things work well but eventually (after about 20-30 reads) I get the following error.
Reading failed: The CRC_A does not match.
Which in itself is not a problem. Only issue is that on all following reads I get the this error:
Reading failed: A buffer is not big enough.
I then have to restart my Arduino (D1 mini). Is this a bug or a problem with how I have set the code up?
Thanks,
Pete.
The text was updated successfully, but these errors were encountered: