miguelbalboa / rfid

Arduino RFID Library for MFRC522
The Unlicense
2.74k stars 1.43k forks source link

Not able to read cards (specifically) unless a card/tag is present while the board starts #581

Open moussie369 opened 2 years ago

moussie369 commented 2 years ago

Step 1: Describe your environment

Step 2: Describe the problem

Cards won't be read unless one is present when the program starts, if trying to read a card after some times it won't detect anything. It works fine when using older versions (1.3.6 is the last to work)

Affected file(s) or example(s):

All examples/any code using this library DumpInfo

Steps to reproduce:

  1. Reset the board
  2. Wait ~10-15s
  3. Place a card in front of the reader

Observed Results:

Nothing happens and it won't read anything until the board is reseted. It works fine if only using tags or if a card/tag is present while it's rebooting.

Expected Results:

Rotzbua commented 2 years ago

Did you test 1.4.0?

moussie369 commented 2 years ago

Yes, 1.3.6 was the last to work

Rotzbua commented 2 years ago

Can you test current version without connected reset pin and replace code with:

MFRC522 mfrc522(SS_PIN, UNUSED_PIN);   // Create MFRC522 instance
moussie369 commented 2 years ago

The arduino IDE and platformio won't build with UNUSED_PIN

Rotzbua commented 2 years ago

Sry, ofc with scope MFRC522 mfrc522(SS_PIN, MFRC522::UNUSED_PIN);

moussie369 commented 2 years ago

Well I think I found the culprit, since then I bought a few more nano clones and it seems to work ok with them. I was kind of freaking out trying to figure out what had changed since march until I realized it. I still don't get why it's working only with 1.3.6 and earlier, but unplugging rst and putting MFRC522::UNUSED_PIN didn't do anything

edit: unfortunately trying to flash the bootloader from the other boards I didn't pay attention and blocked the nano, I remember it was quite an adventure to get them to work when new so I won't try today