Problem “Didn't find PN53x board” Arduino NFC Card Reader i am using the elechouse PN532 RFID Module with an Wemos D1 mini in the Arduino IDE.
I use the ISO1443a_uid example from the elechouse library. All works fine if i plug the USB Cable into the wemos and the demo runs. But if i press the reset button on the Wemos D1 mini then the Serial brings this output: 

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v0fd86a07
~ld
Hello!
Didn't find PN53x board


Sometimes it works fine but mostly comes this error.

Here is the sample code (i am using the I2C Mode):

* When the number after #if set as 1, it will be switch to SPI Mode*/
if 0
 #include &lt;SPI.h&gt;
 #include &lt;PN532_SPI.h&gt;
 #include "PN532.h"

 PN532_SPI pn532spi(SPI, 10);
 PN532 nfc(pn532spi);

* When the number after #elif set as 1, it will be switch to HSU Mode*/
elif 0
 #include &lt;PN532_HSU.h&gt;
 #include &lt;PN532.h&gt;

 PN532_HSU pn532hsu(Serial1);
 PN532 nfc(pn532hsu);

* When the number after #if &amp; #elif set as 0, it will be switch to I2C Mode*/
else 
 #include &lt;Wire.h&gt;
 #include &lt;PN532_I2C.h&gt;
 #include &lt;PN532.h&gt;
 #include &lt;NfcAdapter.h&gt;

 PN532_I2C pn532i2c(Wire);
 PN532 nfc(pn532i2c);
endif

oid setup(void) {
 Serial.begin(115200);
 Serial.println("Hello!");
 pinMode(D2,INPUT_PULLUP);
 pinMode(D1,INPUT_PULLUP);  
 nfc.begin();

 uint32_t versiondata = nfc.getFirmwareVersion();
 if (! versiondata) {
   Serial.print("Didn't find PN53x board");
   while (1); // halt
 }

 // Got ok data, print it out!
 Serial.print("Found chip PN5"); Serial.println((versiondata&gt;&gt;24) &amp; 0xFF, HEX); 
 Serial.print("Firmware ver. "); Serial.print((versiondata&gt;&gt;16) &amp; 0xFF, DEC); 
 Serial.print('.'); Serial.println((versiondata&gt;&gt;8) &amp; 0xFF, DEC);

 // Set the max number of retry attempts to read from a card
 // This prevents us from waiting forever for a card, which is
 // the default behaviour of the PN532.
 nfc.setPassiveActivationRetries(0xFF);

 // configure board to read RFID tags
 nfc.SAMConfig();

 Serial.println("Waiting for an ISO14443A card");


oid loop(void) {
 boolean success;
 uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };  // Buffer to store the returned UID
 uint8_t uidLength;                        // Length of the UID (4 or 7 bytes depending on ISO14443A card type)

 // Wait for an ISO14443A type cards (Mifare, etc.).  When one is found
 // 'uid' will be populated with the UID, and uidLength will indicate
 // if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)
 success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &amp;uid[0], &amp;uidLength);

 if (success) {
   Serial.println("Found a card!");
   Serial.print("UID Length: ");Serial.print(uidLength, DEC);Serial.println(" bytes");
   Serial.print("UID Value: ");
   for (uint8_t i=0; i &lt; uidLength; i++) 
   {
     Serial.print(" 0x");Serial.print(uid[i], HEX); 
   }
   Serial.println("");
   // Wait 1 second before continuing
   delay(1000);
 }
 else
 {
   // PN532 probably timed out waiting for a card
   Serial.println("Timed out waiting for a card");
 }


What is wrong? why is it not alltimes working after a reset?
EDIT:
Try using Elechouse library, it worked better for me.



This might be irrelevant, but I wanted to share.

I had a similar issue, not related to the sketch code.

So make sure:


Connect wires to the NFC module at 90 degrees - there should be angular headers included. Also the wires should be above the antenna - the white strip.
There shouldn't be any wires underneath the NFC module or they should on significant distance.
Soldered wires work better on the NFC module.