nfc-tools / libnfc

Platform independent Near Field Communication (NFC) library
http://nfc-tools.org
GNU Lesser General Public License v3.0
1.64k stars 436 forks source link

Cannot detect Yubikey 5 NFC with PN532 #690

Open agorgl opened 1 year ago

agorgl commented 1 year ago

I have a PN532 module plugged in HSU (UART) mode with a usb serial adapter. Using nfc-poll -v and scanning various RFID cards and tags works flawlessly, but trying to scan a YubiKey 5 NFC doesn't read anything.

I tried two different PN532 modules, one ITEAD PN532 NFC MODULE and an ELECHOUSE NFC RFID MODULE V3 that exhibit same behavior.

Any idea on how to debug / diagnose the problem?

agorgl commented 1 year ago

Scanning yubikey with NFC Tools on Android it shows up as having a tag type of ISO 14443-4 with the description NXP - Mifare Plus. Same behavior is observed with another (train) nfc card that I have with tag type of ISO 14443-4 and description NXP - Mifare DESFire EV1 4k.

Are these kinds of cards supported by libnfc / nfc-poll? I also tried using another USB UART / TTL adapter, even serial over BT with a HC-05 module, powering module with separate supply etc. just to be sure that it was not the problem of any other component in the equation.

gianklug commented 7 months ago

Did you find out anything?

agorgl commented 7 months ago

Nop, I kinda gave up after a while (I even tried to make my own NFC antenna!). I think that these cheap PN532 modules are not powerful enough to interact with Yubikey NFC / Mifare DESFire EV1 4k cards

3rdIteration commented 7 months ago

I have it detecting a Yubikey 5 NFC just fine, even via pcsc_scan. (Running on a Raspberry Pi 4 with PN532 connected via i2c) It also works just fine with a Codewave NFC Micro Sticker Tag, so this isn't a size or antenna issue.

libnfc + ifdnfc built from source using latest master of both repos.

agorgl commented 7 months ago

I tried only using uart, can you try and tell us if it works with uart too? If so, what board do you have exactly?

3rdIteration commented 7 months ago

Can't test UART at the moment, but it's this board here https://a.aliexpress.com/_mqQRXte

It also detects the yubikey with plain old nfc-poll.

agorgl commented 7 months ago

Are you sure this is your board? Because I have a similar chinese board that looks exactly the same, and I could not make yubikey scanning work with it in UART mode

3rdIteration commented 7 months ago

That's the exact board that I am using.

I actually have a second one coming in a few days, so can see if ur works the same and also test UART mode.

3rdIteration commented 7 months ago

So I just checked and basically the quality varies dramatically between these cheap clone boards from AliExpress or Amazon... One of them ones that I have here has very poor range and struggles to even reliability detect full sized smart card, let alone a Yubikey...

agorgl commented 7 months ago

Even from the same seller/vendor?

3rdIteration commented 7 months ago

Haven't tried but I would imagine so, these clones are never consistent...