I had the RC522 read/write module working well with a LOLIN32 two weeks back. I'm running the "Dumpinfo" example code with modifications for my pinout. I tried today and now I'm getting the error message:
"WARNING: Communication failure, is the MFRC522 properly connected?"
My connections are hard-wired so there's no way the connections could have changed. The RC522 works correctly when hooked up to an Arduino UNO so that's not the issue.
Any thoughts will be greatly appreciated.
[Codebox]
#include <SPI.h>
#include <MFRC522.h>
#define RST_PIN 22 //GPIO22
#define SS_PIN 21 //GPIO21
#define MISO_PIN 19 //GPIO27
#define MOSI_PIN 23 //GPIO26
#define SCK_PIN 18 //GIPO25
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
void setup() {
Serial.begin(115200); // 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
SPI.begin(SCK_PIN, MISO_PIN, MOSI_PIN); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522
delay(4); // Optional delay. Some board do need more time after init to be ready, see Readme
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() {
// Reset the loop if no new card present on the sensor/reader. This saves the entire process when idle.
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));
}
[/Codebox]
Problem with RC522 RFID read/write module
Re: Problem with RC522 RFID read/write module
Hi,
I have the exact same problem with the same sketch, did you find out why it didn't work?
I have the exact same problem with the same sketch, did you find out why it didn't work?
Who is online
Users browsing this forum: No registered users and 344 guests