Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help Wanted] Relaying PC/SC to a PN532 NFC controller? #140

Closed
Frederick888 opened this issue Apr 9, 2019 · 11 comments
Closed

[Help Wanted] Relaying PC/SC to a PN532 NFC controller? #140

Frederick888 opened this issue Apr 9, 2019 · 11 comments
Labels

Comments

@Frederick888
Copy link

I've got an ITEAD PN532 NFC controller, which is compatible with libnfc, to communicate with my YubiKey. But since PC/SC doesn't recognise the controller by default, I'm wondering whether it's possible to use pcsc-relay to relay the APDUs so that GnuPG can detect YubiKey in the end.

I've installed both virtualsmartcard and pcsc-relay but couldn't get it to work. Tbh I'm still a bit confused about the concepts here so it would be greatly appreciated if you guys can explain it to me.

Here are the commands I ran and the outputs. I actually wonder whether I need to run vicc as well?

$ sudo pcscd -f -d
00000000 [139776631433152] debuglog.c:299:DebugLogSetLevel() debug level=debug
00000071 [139776631433152] configfile.l:284:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00000015 [139776631433152] configfile.l:360:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00000023 [139776631433152] configfile.l:321:DBGetReaderListDir() Skipping non regular file: .
00000003 [139776631433152] configfile.l:360:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/vpcd
00000015 [139776631433152] configfile.l:210:evaluatetoken() Add reader: Virtual PCD
00000006 [139776631433152] configfile.l:321:DBGetReaderListDir() Skipping non regular file: ..
00000007 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 00 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000133 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000019 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35963
00000015 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000004 [139776631433152] readerfactory.c:391:RFAddReader() Using the pcscd polling thread
00000034 [139776631433152] readerfactory.c:524:RFAddReader() Driver is slot thread safe
00000004 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 01 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000005 [139776631433152] readerfactory.c:864:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000006 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000013 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35964
00000011 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000004 [139776631433152] readerfactory.c:558:RFAddReader() Using the pcscd polling thread
00000039 [139776631433152] readerfactory.c:524:RFAddReader() Driver is slot thread safe
00000005 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 02 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000005 [139776631433152] readerfactory.c:864:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000006 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000010 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35965
00000009 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000003 [139776631433152] readerfactory.c:558:RFAddReader() Using the pcscd polling thread
00000023 [139776631433152] readerfactory.c:524:RFAddReader() Driver is slot thread safe
00000005 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 03 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000002 [139776631433152] readerfactory.c:864:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000008 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35966
00000008 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000002 [139776631433152] readerfactory.c:558:RFAddReader() Using the pcscd polling thread
00000023 [139776631433152] readerfactory.c:524:RFAddReader() Driver is slot thread safe
00000006 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 04 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000002 [139776631433152] readerfactory.c:864:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000008 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35967
00000007 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000002 [139776631433152] readerfactory.c:558:RFAddReader() Using the pcscd polling thread
00000023 [139776631433152] readerfactory.c:524:RFAddReader() Driver is slot thread safe
00000004 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 05 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:864:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000009 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35968
00000008 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000003 [139776631433152] readerfactory.c:558:RFAddReader() Using the pcscd polling thread
00000021 [139776631433152] readerfactory.c:524:RFAddReader() Driver is slot thread safe
00000004 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 06 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000003 [139776631433152] readerfactory.c:864:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000009 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35969
00000008 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000004 [139776631433152] readerfactory.c:558:RFAddReader() Using the pcscd polling thread
00000023 [139776631433152] readerfactory.c:524:RFAddReader() Driver is slot thread safe
00000003 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 07 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:864:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000009 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35970
00000009 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000003 [139776631433152] readerfactory.c:558:RFAddReader() Using the pcscd polling thread
00000023 [139776631433152] readerfactory.c:524:RFAddReader() Driver is slot thread safe
00000003 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 08 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:864:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000010 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35971
00000008 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000003 [139776631433152] readerfactory.c:558:RFAddReader() Using the pcscd polling thread
00000026 [139776631433152] readerfactory.c:524:RFAddReader() Driver is slot thread safe
00000003 [139776631433152] readerfactory.c:1075:RFInitializeReader() Attempting startup of Virtual PCD 00 09 using /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:864:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/serial/libifdvpcd.so
00000004 [139776631433152] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000009 [139776631433152] ifd-vpcd.c:48:IFDHCreateChannel() Waiting for virtual ICC on port 35972
00000008 [139776631433152] ifd-vpcd.c:195:IFDHGetCapabilities() unknown tag 4019
00000003 [139776631433152] readerfactory.c:558:RFAddReader() Using the pcscd polling thread
00000024 [139776631433152] pcscdaemon.c:662:main() pcsc-lite 1.8.25 daemon ready.
00003705 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000094 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000089 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0025, path: /dev/bus/usb/001/008
00000086 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0025, path: /dev/bus/usb/001/008
00000078 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000087 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x2109, PID: 0x2812, path: /dev/bus/usb/001/002
00000091 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x10C4, PID: 0xEA60, path: /dev/bus/usb/001/014
00000086 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x2109, PID: 0x2812, path: /dev/bus/usb/001/002
00000078 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000084 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1770, PID: 0xFF00, path: /dev/bus/usb/001/003
00000078 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000085 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x046D, PID: 0xC52B, path: /dev/bus/usb/001/005
00000083 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x046D, PID: 0xC52B, path: /dev/bus/usb/001/005
00000083 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x046D, PID: 0xC52B, path: /dev/bus/usb/001/005
00000077 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000084 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x0451, PID: 0x2036, path: /dev/bus/usb/001/007
00000090 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1377, PID: 0xC1D3, path: /dev/bus/usb/001/009
00000084 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x0451, PID: 0x2036, path: /dev/bus/usb/001/007
00000134 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0003, path: /dev/bus/usb/002/001
00000077 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0003, path: /dev/bus/usb/002/001
00000083 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x2109, PID: 0x0812, path: /dev/bus/usb/002/002
00000229 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/003/001
00000223 [139776631433152] hotplug_libudev.c:301:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0003, path: /dev/bus/usb/004/001



// pcsc-relay
12881641 [139776631433152] winscard_msg_srv.c:255:ProcessEventsServer() Common channel packet arrival
00000018 [139776631433152] winscard_msg_srv.c:267:ProcessEventsServer() ProcessCommonChannelRequest detects: 17
00000003 [139776631433152] pcscdaemon.c:133:SVCServiceRunLoop() A new context thread creation is requested: 17
00000056 [139776530716416] winscard_svc.c:340:ContextThread() Authorized PC/SC client
00000007 [139776530716416] winscard_svc.c:344:ContextThread() Thread is started: dwClientID=17, threadContext @0x562b25b84df0
00000008 [139776530716416] winscard_svc.c:362:ContextThread() Received command: CMD_VERSION from client 17
00000004 [139776530716416] winscard_svc.c:374:ContextThread() Client is protocol version 4:4
00000003 [139776530716416] winscard_svc.c:394:ContextThread() CMD_VERSION rv=0x0 for client 17
00000091 [139776530716416] winscard_svc.c:362:ContextThread() Received command: ESTABLISH_CONTEXT from client 17
00000012 [139776530716416] winscard.c:215:SCardEstablishContext() Establishing Context: 0x2ABA1181
00000003 [139776530716416] winscard_svc.c:459:ContextThread() ESTABLISH_CONTEXT rv=0x0 for client 17
00000118 [139776530716416] winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 17
00000144 [139776530716416] winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 17
00000048 [139776530716416] winscard_svc.c:832:MSGSendReaderStates() Send reader states: 17
00000149 [139776530716416] winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 17
00000012 [139776530716416] winscard_svc.c:440:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 17



// gpg --card-status
13741288 [139776631433152] winscard_msg_srv.c:255:ProcessEventsServer() Common channel packet arrival
00000018 [139776631433152] winscard_msg_srv.c:267:ProcessEventsServer() ProcessCommonChannelRequest detects: 18
00000004 [139776631433152] pcscdaemon.c:133:SVCServiceRunLoop() A new context thread creation is requested: 18
00000089 [139776522323712] winscard_svc.c:340:ContextThread() Authorized PC/SC client
00000012 [139776522323712] winscard_svc.c:344:ContextThread() Thread is started: dwClientID=18, threadContext @0x562b25b8d040
00000014 [139776522323712] winscard_svc.c:362:ContextThread() Received command: CMD_VERSION from client 18
00000008 [139776522323712] winscard_svc.c:374:ContextThread() Client is protocol version 4:4
00000006 [139776522323712] winscard_svc.c:394:ContextThread() CMD_VERSION rv=0x0 for client 18
00000096 [139776522323712] winscard_svc.c:362:ContextThread() Received command: ESTABLISH_CONTEXT from client 18
00000013 [139776522323712] winscard.c:215:SCardEstablishContext() Establishing Context: 0xEDF68BF
00000004 [139776522323712] winscard_svc.c:459:ContextThread() ESTABLISH_CONTEXT rv=0x0 for client 18
00000025 [139776522323712] winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 18
00000030 [139776522323712] winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 18
00000083 [139776522323712] winscard_svc.c:362:ContextThread() Received command: CONNECT from client 18
00000016 [139776522323712] winscard_svc.c:497:ContextThread() Authorized client for 'Virtual PCD 00 00'
00000007 [139776522323712] winscard.c:259:SCardConnect() Attempting Connect to Virtual PCD 00 00 using protocol: 3
00000006 [139776522323712] readerfactory.c:821:RFReaderInfo() RefReader() count was: 1
00000006 [139776522323712] winscard.c:312:SCardConnect() Card Not Inserted
00000005 [139776522323712] winscard.c:518:SCardConnect() UnrefReader() count was: 2
00000006 [139776522323712] winscard_svc.c:511:ContextThread() CONNECT rv=0x8010000C for client 18
00000027 [139776522323712] winscard_svc.c:362:ContextThread() Received command: RELEASE_CONTEXT from client 18
00000010 [139776522323712] winscard.c:229:SCardReleaseContext() Releasing Context: 0xEDF68BF
00000006 [139776522323712] winscard_svc.c:474:ContextThread() RELEASE_CONTEXT rv=0x0 for client 18
00000024 [139776522323712] winscard_svc.c:354:ContextThread() Client die: 18
00000037 [139776522323712] winscard_svc.c:1055:MSGCleanupClient() Thread is stopping: dwClientID=18, threadContext @0x562b25b8d040
00000006 [139776522323712] winscard_svc.c:1061:MSGCleanupClient() Freeing SCONTEXT @0x562b25b8d040
$ pcsc-relay -e libnfc -f -vvv
pcsc.c:119      Could not find reader number 4294967295
pcsc.c:136      Unknown reader specified.

$ pcsc-relay -e libnfc -f -r 0 -vvv
pcsc.c:113      No card present in Virtual PCD 00 00
Connected to ITEAD PN532
Waiting for a command that is not part of the anti-collision...
$ gpg --card-status
gpg: selecting openpgp failed: No such device
gpg: OpenPGP card not available: No such device
@frankmorgner
Copy link
Owner

gpg uses PC/SC to access smart cards. You should try https://github.com/nfc-tools/ifdnfc, which makes the libnfc device (PN532) available via PC/SC.

@Frederick888
Copy link
Author

@frankmorgner Yup, I just installed ifdnfc and finally GPG can detect my YubiKey now! Thanks for your help!

@ronie19
Copy link

ronie19 commented Aug 1, 2020

gpg uses PC/SC to access smart cards. You should try https://github.com/nfc-tools/ifdnfc, which makes the libnfc device (PN532) available via PC/SC.

Does it also work with pn532 connected via SPI port ? If yes, how to configure ?

@ronie19
Copy link

ronie19 commented Dec 14, 2023

gpg uses PC/SC to access smart cards. You should try https://github.com/nfc-tools/ifdnfc, which makes the libnfc device (PN532) available via PC/SC.

I did configure pn532_uart. Now main issue is that pcsc_scan detects the card but the ATR response is not complete. ATR response is partial 5 bytes for a Mifare 4k+ card

@frankmorgner
Copy link
Owner

Mifare 4k is not a smart card. It is more like a memory card with some broken home grown crypto. You don't want to use that in gpg or any other security related context

@ronie19
Copy link

ronie19 commented Dec 14, 2023

Mifare 4k is not a smart card. It is more like a memory card with some broken home grown crypto. You don't want to use that in gpg or any other security related context

I am trying to read sample cards. I also have ACR122U reader and it is giving full ATR but the PN532 based on IFDNFC gives only first 5 bytes and then stops. It is not getting read by smartcardio library java. But the ACR122U is working fine.
I am using Raspbian linux 64 bit legacy.

@dengert
Copy link

dengert commented Dec 14, 2023

What device are you using? does it also have contacts? What is its ATR using?

On Ubuntu, when installing I use this to turn off libnfs:

# DEE 2023 on 22.04
# to get pcsc to use contactless readers
# add this file to /etc/modprobe.d
blacklist pn533
blacklist nfc
blacklist pn533_usb

Contactless (NFC) devices do not return an ATR. PCSC, CCID or IFD will makeup an ATR so calling middleware will have something to work with. The first few bytes have iso 7816 voltage and timing info, which are not not needed for NFC.

PN532 may be doing something similar but presenting it as Mifair device.

Using a dual contact smartcard with ACR122U returns ATR: 3B 86 80 01 80 31 C1 52 41 12 76 in 86 the 6 is number of historical bytes at end. The rest is the made up ATR which appears to match an intermediate step in ATR negations which would never be seen with a contact reader.

Using a contact reader with same card returns ATR: 3b:d6:97:00:81:b1:fe:45:1f:87:80:31:c1:52:41:12:23 Note same historical bytes as this can be obtained from the card in in other ways when using contactless.

        /* see if contactless */
        if (card->reader->atr.len >= 4 
                        && card->reader->atr.value[0] == 0x3b 
                        && (card->reader->atr.value[1] & 0xF0) == 0x80 
                        && card->reader->atr.value[2] == 0x80 
                        && card->reader->atr.value[3] == 0x01) {
                priv->init_flags |= PIV_INIT_CONTACTLESS;
        }

@ronie19
Copy link

ronie19 commented Dec 14, 2023

What device are you using? does it also have contacts? What is its ATR using?

On Ubuntu, when installing I use this to turn off libnfs:

# DEE 2023 on 22.04
# to get pcsc to use contactless readers
# add this file to /etc/modprobe.d
blacklist pn533
blacklist nfc
blacklist pn533_usb

Contactless (NFC) devices do not return an ATR. PCSC, CCID or IFD will makeup an ATR so calling middleware will have something to work with. The first few bytes have iso 7816 voltage and timing info, which are not not needed for NFC.

PN532 may be doing something similar but presenting it as Mifair device.

Using a dual contact smartcard with ACR122U returns ATR: 3B 86 80 01 80 31 C1 52 41 12 76 in 86 the 6 is number of historical bytes at end. The rest is the made up ATR which appears to match an intermediate step in ATR negations which would never be seen with a contact reader.

Using a contact reader with same card returns ATR: 3b:d6:97:00:81:b1:fe:45:1f:87:80:31:c1:52:41:12:23 Note same historical bytes as this can be obtained from the card in in other ways when using contactless.

        /* see if contactless */
        if (card->reader->atr.len >= 4 
                        && card->reader->atr.value[0] == 0x3b 
                        && (card->reader->atr.value[1] & 0xF0) == 0x80 
                        && card->reader->atr.value[2] == 0x80 
                        && card->reader->atr.value[3] == 0x01) {
                priv->init_flags |= PIV_INIT_CONTACTLESS;
        }

I am using PN532 with USB to UART converter. It's NFC reader. Any tips ? I have installed libnfc and ifdnfc as pcsc handler for libnfc.

@dengert
Copy link

dengert commented Dec 14, 2023

I would use the ACR122U and don't use pn533 at all.

You still did not say what what card/token you are using. Is it really smart card?
Does it have dual access?

See what: https://smartcard-atr.apdu.fr
says about the ATR when using ACR122U and when using the PN532.

@ronie19
Copy link

ronie19 commented Dec 14, 2023

I would use the ACR122U and don't use pn533 at all.

You still did not say what what card/token you are using. Is it really smart card? Does it have dual access?

See what: https://smartcard-atr.apdu.fr says about the ATR when using ACR122U and when using the PN532.

I am using Mifare 4k+ cards with a pn532 reader connected through usb to UART converter
I am running a Java program using smartcardio library. It reads the card from ACR122U reader easily.
But it doesn't do the same with the PN532 with ifdnfc and pcsc enabled. I just want the pn532 to work same as the ACR122U.

@dengert
Copy link

dengert commented Dec 14, 2023

A Mifare card is not a smart card. OpenSC only supports smartcards. I can not help. Sorry.

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

No branches or pull requests

4 participants