Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

card not detected #48

Open
lenkapolaskova opened this issue Dec 1, 2021 · 8 comments
Open

card not detected #48

lenkapolaskova opened this issue Dec 1, 2021 · 8 comments

Comments

@lenkapolaskova
Copy link

May I ask a question? I realized that in case a card is not detected you reset module and repeat whole transaction. Why? I tried to wait for the card in "wait for data" state but card can't be detected. It seems like some kind of a workaround. Is there an issue with the module?

@ATrappmann
Copy link
Owner

You are right. The reset is done unintentionally, because the state EC_NO_CARD is part of the return codes. This could be filtered out, so that no reset is done. On the other hand, if a real error occurces, the reset seems to be a good idea to get everything back to a defined state.
So always resetting the device is not part of a workaround of some other issue.

@lenkapolaskova
Copy link
Author

Hi, thank for your response. If I send reqA command and card is not present at that time the module is not able to detect it later. So now I am searching what is wrong with the code or with the circuit. So I send reqA command and if card is not present I switch off transceive state and try it again. It seems it works reliably.

@ATrappmann
Copy link
Owner

What do you mean be sending a "reqA command"? Which library function are you using?

@tueddy
Copy link
Contributor

tueddy commented Dec 10, 2021

REQA is an ISO-14443 comannd and implemented here:
uint8_t PN5180ISO14443::activateTypeA

REQA = request 14443 TypeA card
WUPA = wakeup 14443 TypeA card

@lenkapolaskova
Copy link
Author

Hi, I follow AN12650 - Using PN5180 without library. in this guide there are steps to send REQA command. I am stuck on point waitForCardResponse because if the card is not present immediatelly it is not possible to read it then.
Have you tested reading a card without reseting the device?

@tueddy
Copy link
Contributor

tueddy commented Dec 13, 2021

In my fork there are some demos for ISO-14443 card polling: https://github.com/tueddy/PN5180-Library/blob/master/examples/PN5180-ISO14443/PN5180-ISO14443.ino
and a sample for polling both ISO-15693 / 14443 cards: https://github.com/tueddy/PN5180-Library/blob/master/examples/PN5180-ReadUID/PN5180-ReadUID.ino

Maybe a starting point to get rid off resetting the PN5180 and optimize polling times?

@lenkapolaskova
Copy link
Author

In the examples there is nfc.reset() and nfc.setupRF() commands in the loop. I wonder to know why? The reset and setup should be only in the setup part am I right?

@tueddy
Copy link
Contributor

tueddy commented Dec 20, 2021

If reader receives corrupted response due to card gets out of field the PN5180 can get unresponsible.
14443 cards that are in field but do not response to REQA have to be resetted by disable/reactivate the RF field.
Therefore loop makes a complete reset + field reactivation to be on the safe side. This is slow and maybe not everytime needed.

@lenkapolaskova Feel free to optimize the loop to get a better/faster card recognition!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants