Problem with PN5180

Hi I’m fairly new to electronics and have tried following a tutorial to get a PN5180 to work for an escape room style puzzle. I’ve used the code below and keep getting the following error in the Serial Monitor
“*** FATAL reading more than 508 bytes is not supported!”
I was wondering if someone might be able to let me know where I’m going wrong and how to fix it.

/**

  • Multi-PN5180
  • An “escape room”-style puzzle in which a number of RFID tags must be placed in front
  • of the correct PN5180 RFID readers in order to be detected and solve the puzzle.
    */

// DEFINES
// #define DEBUG

// INCLUDES
// Download from GitHub - playfultechnology/PN5180-Library: PN5180 library for Arduino
#include <PN5180.h>
#include <PN5180ISO15693.h>

// CONSTANTS
// The number of PN5180 readers connected
const byte numReaders = 1;
// What is the “correct” UID that should be detected by each reader
uint8_t correctUid[8] = {
{0xD1,0xD2,0x48,0x2A,0x50,0x1,0x4,0xE0}
};
// This pin will be driven LOW when the puzzle is solved
const byte relayPin = A0;

// GLOBALS
// Each PN5180 reader requires unique NSS, BUSY, and RESET pins,
// as defined in the constructor below
PN5180ISO15693 nfc = {
PN5180ISO15693(10,9,8),
};
// Array to record the value of the last UID read by each reader
uint8_t lastUid[numReaders][8];

void setup() {
// Configure the relay pin
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH);

// Initialise serial connection
Serial.begin(115200);

for(int i=0; i<numReaders; i++){
Serial.print(“Reader #”);
Serial.println(i);
Serial.println(F(“Initialising…”));
nfc*.begin();*

  • Serial.println(F(“Resetting…”));*
    _ nfc*.reset();_
    _
    Serial.println(F(“Enabling RF field…”));_
    _ nfc.setupRF();
    }
    Serial.println(F(“Setup Complete”));
    }
    void loop() {
    for(int i=0; i<numReaders; i++) {
    // Variable to store the ID of any tag read by this reader*
    * uint8_t thisUid[8];*
    * // Try to read a tag ID (or “get inventory” in ISO15693-speak)
    ISO15693ErrorCode rc = nfc.getInventory(thisUid);
    // If the result code was that a card had been read*

    * if(rc == ISO15693_EC_OK) {*
    * // If this is the same ID as we read last frame*
    if(memcmp(thisUid, lastUid*, 8) == 0) {
    // Nothing to do - move on to the next reader*

    * continue;
    }
    // If it’s a different ID*

    * else {
    Serial.print(F("New Card Detected on Reader “));
    Serial.print(i);
    Serial.print(F(”… “));
    for (int j=0; j<sizeof(thisUid); j++) {
    Serial.print(thisUid[j],HEX);
    Serial.print(” ");
    }
    Serial.println();
    // Update the array that keeps track of most recent ID*

    memcpy(lastUid, thisUid, sizeof(lastUid[0])8);
    // Has placing this card solved the puzzle?
    checkIfPuzzleSolved();
    }
    }
    // If a card cannot be read*

    * else {
    // Test if we previously knew about a card (in which case it’s just been removed*

    * // The most significant (last) byte of a valid UID should always be 0xE0. e.g. E007C4A509C247A8*
    if(lastUid*[7] == 0xE0){
    Serial.print("Card “);
    for (int j=0; j<sizeof(lastUid); j++) {
    Serial.print(lastUid[j], HEX);
    }
    Serial.print(” removed from Reader ");
    Serial.println(i);
    // Update the array that keeps track of last known ID*

    memset(lastUid, 0, sizeof(lastUid[0])8);
    }*_

* #ifdef DEBUG*
* Serial.print(F("Error in getInventory: "));*
_ Serial.println(nfc*.strerror(rc));
#endif*

* }*_

* // Slight delay before checking the next reader*
* delay(100);*
* }*
}
// Action to take when the puzzle is solved
void onPuzzleSolved() {
* // Activate the relay*
* digitalWrite(relayPin, LOW);*
* // Loop forever*
* while(true) { delay(1000); }*
}
// Check whether all PN5180s have detected the correct tag
void checkIfPuzzleSolved() {
* // Test each reader in turn*
* for(int i=0; i<numReaders; i++){*
* // If this reader hasn’t detected the correct tag*
if(memcmp(lastUid_, correctUid*, 8) != 0){
// Exit*

* return false;
}
}
onPuzzleSolved();
}*_

Hi Newbee,
here is a link with tips how to speed up getting good answers
best regards Stefan

I'm quite sure you didn't read the sticky post at the top of the topic "How to use this forum".

Edit your post and insert code tags! As you can see in your post the code is not readable because the forum system interpreted some content.

Post a link to the used library as the library isn't available in the IDE Library Manager.

Post the complete serial output you get as that might hint where the error occurred.