I am using NodeMCU ESP8266 with MFRC522 RFID module. Getting below error when using DumpInfo example from RFID_MFRC522v2.
WARNING: Communication failure, is the MFRC522 properly connected?
Connection setting are as follows -
NodeMCU - MFRC522
D3 - RST
3V3 - 3.3V
D8 - SDA (Tried with D4 - SDA as well, didn't work)
D5 - SCK
D6 - MISO
D7 -MOSI
GND - GND
IRQ on MFRC522 is not connected to any pin on NodeMCU
I tried with 2 other MFRC522 RFID modules and 1 other NodeMCU board, getting the same error. I have already gone through troubleshooting for this error from github - GitHub - OSSLibraries/Arduino_MFRC522v2, nothing has worked so far.
NodeMCU is connected to my MAC OS through micro USB. I have tried using breadboard as well. Arduino IDE - 2.2.1
Code below -
#include <MFRC522.h>
#include <SPI.h>
#define RST_PIN D3 // Configurable, see typical pin layout above
#define SS_PIN D8 // Configurable, see typical pin layout above
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
void setup() {
Serial.begin(115200);
Serial.println("Hello"); // 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
delay(1000); // 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));
}
Screenshot of the connection from MAC - NodeMCU - MFRC522
Any help would be appreciated.
Thanks