Can someone help me what is the meaning of this sketch? It always outputs in the serial monitor:
Firmware Version: 0x1C = (unknown)
Scan PICC to see UID, SAK, type, and data blocks...
This is the code of the MFRC522 library I use:
#include <SPI.h>
#include <MFRC522.h>
constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above
constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522
mfrc522.PCD_DumpVersionToSerial(); // Show details of PCD - MFRC522 Card Reader details
Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}
void loop() {
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}
// Dump debug info about the card; PICC_HaltA() is automatically called
mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}
2 Answers 2
The mention of unknown
in the output line:
Firmware Version: 0x1C = (unknown)
isn't a good sign.
Run the firmware_check
example to verify that first, before trying to run other code.
The unknown
is output by line 1302 of MFRC522.cpp:
default: Serial.println(F(" = (unknown)"));
The firmware_check
example states on line 49:
Serial.println(F("Only known versions supported"));
So, your hardware (i.e. the reader) may not be supported.
The only thing I can suggest is try another reader. Also, read the README, there maybe some thing there, or contact the author and/or raise an issue to see if you can get support for your version of the firmware (0x1C
) added.
Put a delay(5)
after
mfrc522.PCD_Init(); // Init MFRC522
and it will show the correct firmware version.
Firmware Version:
line is obviously output byPCD_DumpVersionToSerial()
. Do you get any other output other than that? You should also seeScan PICC to see...
. Are you not seeing that? Please be more explicit, and include a few more lines of output, to illustrate any repetition of output.firmware_check
example. In that sketch, it does say that only known versions are supported (Serial.println(F("Only known versions supported"));
), so your first output line doesn't bode well