3

I am using ACR 122u NFC Reader/Writer and Mifare Ultralight C tag to authenticate and read block data, but encountering an issue while doing so:

When I use following command:

FF 00 00 00 04 D4 42 1A 00

For Auth0 i.e get challenge I receive following response:

D5 43 01 90

However if I put Thread.Sleep before using this command for approx 1.7 seconds, it receives challenge request successfully, did someone else encountered same problem as well? Please let me know if I am doing something wrong here.

Community
  • 1
  • 1
FaizanHussainRabbani
  • 3,256
  • 3
  • 26
  • 46
  • You might need to show some of your code to see what might be going wrong. Could it be that you are using the ACR122 on Windows 7 (or later)? If yes, did you open the reader in exclusive mode? See [Smart Card Get Response Returns Status 6D00](http://stackoverflow.com/q/35582950/2425802). – Michael Roland Apr 12 '16 at 14:35
  • @MichaelRoland I am using it in shared mode. Could this be the reason? – FaizanHussainRabbani Apr 12 '16 at 15:07
  • But if so? Why does it work when I place Thread.Sleep(1650)? – FaizanHussainRabbani Apr 12 '16 at 15:08
  • 4
    Yes, this is likely the reason if using Windows. The problem is that Windows starts to send commands to tags as soon as it receives a card insertion event (that's called smartard plug & play). This "plug & play" will take a few seconds from the point that the card is placed on the reader and it will interrupt/disturb communication with the reader/card. After that phase, communication should work as expected. – Michael Roland Apr 12 '16 at 15:22
  • Is there is any other mode other then shared and exclusive? if yes Michael will changing that help? – Kamran Shahid Apr 13 '16 at 05:05
  • @MichaelRoland When I try to connect using exclusive mode I receive: 0x8010000b The smart card cannot be accessed because of other connections outstanding. Can you help me a bit on this? – FaizanHussainRabbani Apr 13 '16 at 14:50
  • This means that some other application is already connected to the reader. Is there any other application running that might try to use the smartcard reader? Are you trying to access the reader from two threads within your application (or otherwise reopening the connection to the reader)? You might need to reveal some of your code... – Michael Roland Apr 13 '16 at 20:45
  • 1
    @MichaelRoland I successfully connected to the Mifare Ultralight C card in exclusive mode and Auth0 command now runs without any delay, but now when sending Auth1 command i.e Authentication request I receive D5 43 02 90. Can you suggest a bit on this please? – FaizanHussainRabbani Apr 14 '16 at 06:33

0 Answers0