0

I have been all over the internet to try and find a solution to this, but after one solid week of intense Google searching I have come up with nothing.

What I'm trying to accomplish:

I am simply trying to use the RFID-RC522 NFC reader on an NodeMCU development board (built in ESP8266) with the mfrc522 library.

Problem:

Upon initiating the mfrc522 library, reaching the line mfrc522.PCD_Init(); the Serial outputs the following "error":

Soft WDT reset

ctx: cont 
sp: 3ffefa10 end: 3ffefc40 offset: 01b0

>>>stack>>>
3ffefbc0:  00241001 00000001 3ffeec20 40106895  
3ffefbd0:  00000002 3ffee9d8 3ffee9f4 40202794  
3ffefbe0:  402010b2 00000001 00000032 402010a7  
3ffefbf0:  3fffdad0 00000010 3ffee9d8 4020290d  
3ffefc00:  402010b2 3ffee9d8 3ffee9d8 40202a01  
3ffefc10:  feefeffe 00000000 3ffeebec 40202080  
3ffefc20:  feefeffe 00000000 3ffeec08 40203e08  
3ffefc30:  feefeffe feefeffe 3ffeec20 40100108  
<<<stack<<<
R+⸮⸮⸮

I found a tool that can translate the error EspExceptionDecoder, translated error:

Decoding 10 results
0x40106895: __digitalWrite at C:\Users\my_user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0\cores\esp8266/core_esp8266_wiring_digital.c line 84
0x40202794: MFRC522::PCD_ReadRegister(MFRC522::PCD_Register) at C:\Users\my_user\Documents\Arduino\libraries\MFRC522\src/MFRC522.cpp line 1141
0x402010b2: delay at C:\Users\my_user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0\cores\esp8266/core_esp8266_wiring.c line 54
0x402010a7: delay at C:\Users\my_user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0\cores\esp8266/core_esp8266_wiring.c line 51
0x4020290d: MFRC522::PCD_Reset() at C:\Users\my_user\Documents\Arduino\libraries\MFRC522\src/MFRC522.cpp line 1141
0x402010b2: delay at C:\Users\my_user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0\cores\esp8266/core_esp8266_wiring.c line 54
0x40202a01: MFRC522::PCD_Init() at C:\Users\my_user\Documents\Arduino\libraries\MFRC522\src/MFRC522.cpp line 1141
0x40202080: setup at C:\Users\my_user\OneDrive\Arduino\projekter\RFID_DumpInfo_test/RFID_DumpInfo_test.ino line 53
0x40203e08: loop_wrapper at C:\Users\my_user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0\cores\esp8266/core_esp8266_main.cpp line 57
0x40100108: cont_norm at C:\Users\my_user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0\cores\esp8266/cont.S line 109

When the mfrc522.PCD_init(); line is commented out the stack-error does not appear. Reading the NFC tags has worked before on the NodeMCU unit, and I sometimes stubmled upon this error when adding one simple line like var1 = var2; somewhere in the loop, but now the error is there constantly, even with code that once worked - however I did change the pin-loadout, and I suspect that this is the problem.

What I have tried:

  • With the configurable pins I have tried most combinations I could think of, trying both the SS and the RST in every available pin.
  • this Github example suggets
  • this instructables tutorial.
  • 3 different RFID-RC522 modules (same model)
  • 2 different NodeMCU units (same model)

Pin layout:

My pin layout for the RFID-RC522 module is as follows;

  • SDA (SS): D4
  • RST: D3
  • SCK: D5
  • MOSI: D7
  • MISO: D6
  • GND: GND
  • 3v3: 3v3

Arduino project info:

  • Arduino IDE 1.8.5
  • Latest MFRC522 from the Library Manager
  • Board: NodeMCU 1.0 (ESP-12E Module)

Code:

#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN          D4
#define RST_PIN         D3

MFRC522 mfrc522(SS_PIN, RST_PIN);

void setup() {
    Serial.begin(9600);
    delay(100);
    SPI.begin();
  delay(100);
    mfrc522.PCD_Init();
    mfrc522.PCD_DumpVersionToSerial();
    Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}

I've been on this issue for days now, and my Google searches tell me that I'm not the only one who has had this problem before. Any input is very welcome.

2

can you also try to increase the serial boud rate to fe. 115200 instead of 9600? In some cases I had some issues with 9600, because some buffers were not cleared fast enough and forces some WDT resets.

Cheers, Jorgen

  • now this is interesting! i had this issue backwards. I thought that slower was "better". UPVOTED! :) – tony gil Jul 26 at 15:59
1

I have come to the conclusion that using RFID with NodeMCU is not going to work - I can't confirm this, but I'm pretty sure the two libraries (ESP8266 and mfrc522) have some complications caused by one another.

A good workaround is using the TX and RX pins to communicate from an Arduino Nano which has the RFID reader to a NodeMCU board - this way you can send the NFC data to your WiFi board without complications.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.