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

pcsc_scan detection for SPI connected PN532 #6

Open
ronie19 opened this issue Aug 1, 2020 · 15 comments
Open

pcsc_scan detection for SPI connected PN532 #6

ronie19 opened this issue Aug 1, 2020 · 15 comments

Comments

@ronie19
Copy link

ronie19 commented Aug 1, 2020

I have connected a pn532 board via SPI port. I have successfully installed libnfc and it is able to get detected by nfc-list and nfc-poll.
What do I need to do so that it gets detected by pcsc_scan as well????

@ronie19
Copy link
Author

ronie19 commented Aug 11, 2020

I am using this with PN532 with SPI connected to Linux board GPIOs. NFC is working. How to integrate and do ifdnfc-activate for the same to integrate with pcsc ?

@YandiBanyuKarimaWaly
Copy link

YandiBanyuKarimaWaly commented Jan 18, 2021

EDIT:
I've got it working. See here


Having the same trouble here. Only difference is I connected it using i2c (should be no real significant difference i suspect). And I would like to apologise in advance if I attach many redundant info here. I'm fairly new to this thing.

Edit: I forgot, my architecture is arm64 in case it helps with something.

Here is my output:

nfc-scan-device -v:

nfc-scan-device uses libnfc 1.7.1
1 NFC device(s) found:
- pn532_i2c:/dev/i2c-1:
    pn532_i2c:/dev/i2c-1
chip: PN532 v1.6
initator mode modulations: ISO/IEC 14443A (106 kbps), FeliCa (424 kbps, 212 kbps), ISO/IEC 14443-4B (106 kbps), Innovision Jewel (106 kbps), D.E.P. (424 kbps, 212 kbps, 106 kbps)
target mode modulations: ISO/IEC 14443A (106 kbps), FeliCa (424 kbps, 212 kbps), D.E.P. (424 kbps, 212 kbps, 106 kbps)

nfc-list -v:

nfc-list uses libnfc 1.7.1
NFC device: pn532_i2c:/dev/i2c-1 opened
1 ISO14443A passive target(s) found:
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  04  
* UID size: single
* bit frame anticollision supported
       UID (NFCID1): b8  6e  5d  d9  
      SAK (SEL_RES): 08  
* Not compliant with ISO/IEC 14443-4
* Not compliant with ISO/IEC 18092

Fingerprinting based on MIFARE type Identification Procedure:
* MIFARE Classic 1K
* MIFARE Plus (4 Byte UID or 4 Byte RID) 2K, Security level 1
* SmartMX with MIFARE 1K emulation

Other possible matches based on ATQA & SAK values:
0 Felica (212 kbps) passive target(s) found.
0 Felica (424 kbps) passive target(s) found.
0 ISO14443B passive target(s) found.
0 ISO14443B' passive target(s) found.
0 ISO14443B-2 ST SRx passive target(s) found.
0 ISO14443B-2 ASK CTx passive target(s) found.
0 Jewel passive target(s) found.

ifdnfc-activate:

Could not find a reader named: IFD-NFC
Cannot find a smart card reader.

I also can't help but notice a config file for a reader at /etc/reader.conf.d/ so i made one
/etc/reader.conf.d/libifdnfc

FRIENDLYNAME      "IFD-NFC"
LIBPATH           /usr/local/lib/libifdnfc.so

and finally a config for the reader itself:
/etc/nfc/libnfc.conf

device.name = "IFD-NFC"
device.connstring = "pn532_i2c:/dev/i2c-1"

@YandiBanyuKarimaWaly
Copy link

@ronie19 I've got it working. I changed the config for the /etc/reader.conf.d/libifdnfc to this value:

FRIENDLYNAME      "IFD-NFC"
DEVICENAME        /dev/i2c-1
LIBPATH           /usr/local/lib/libifdnfc.so
CHANNELID         1

AND THEN i started the pcscd. If you'd like to debug it, run it with -s -f -d flag.
Now, here's the output of my pcsc_scan:

Using reader plug'n play mechanism
Scanning present readers...
0: IFD-NFC 00 00
 
Mon Jan 18 16:28:35 2021
 Reader 0: IFD-NFC 00 00
  Event number: 0
  Card state: Card removed,

@YandiBanyuKarimaWaly
Copy link

@ronie19 And finally, I've found this file README that isn't on the project home. So yes, it confuse me

@ronie19
Copy link
Author

ronie19 commented Jan 18, 2021

@ronie19 I've got it working. I changed the config for the /etc/reader.conf.d/libifdnfc to this value:

FRIENDLYNAME      "IFD-NFC"
DEVICENAME        /dev/i2c-1
LIBPATH           /usr/local/lib/libifdnfc.so
CHANNELID         1

AND THEN i started the pcscd. If you'd like to debug it, run it with -s -f -d flag.
Now, here's the output of my pcsc_scan:

Using reader plug'n play mechanism
Scanning present readers...
0: IFD-NFC 00 00
 
Mon Jan 18 16:28:35 2021
 Reader 0: IFD-NFC 00 00
  Event number: 0
  Card state: Card removed,

Awesome. Can you check once for SPI and let me know. I am out of my home lab till next month.

@YandiBanyuKarimaWaly
Copy link

Awesome. Can you check once for SPI and let me know. I am out of my home lab till next month.

Unfortunately, I can't. I've broken my SPI connection on the PN532 module. But now I've finally understood how all of this works. The good news is that it is fairly straighforward to do.

  1. Add a new device for the PCSC Daemon. It acts as a server in a sense, and libnfc is the client. It is the configuration file that I've attached earlier. See this for reference. Also, here is my final /etc/reader.conf.d/libifdnfc:
FRIENDLYNAME      "IFD-NFC"
LIBPATH           /usr/local/lib/libifdnfc.so
CHANNELID         0

The most important thing here is the FRIENDLYNAME and the LIBPATH. It'll tell the daemon to register the shared object as the provided name. ifdnfc-activate require a device named IFD-NFC on the server.

  1. Now, start the daemon. ifdnfc-activate will then communicate with the daemon to turn on the device used by libnfc. In this case, it is defined at /etc/nfc/libnfc.conf. Here's my final config:
device.name = "IFD-NFC"
device.connstring = "pn532_i2c:/dev/i2c-1"

Do note that the name doesn't need to be IFD-NFC here as it is not used by the ifdnfc-activate at this point. So in your case, change it to use the SPI protocol.

  1. Now here comes the odd thing. I don't know the cause either but my the device is working as intended. I do all of this on a Raspberry Pi OS 10 (Buster) arm64, and my ifdnfc-activate output tells me the device is not activated. However, running the libnfc with log level debug and the PCSC Daemon on the same log level, I can clearly see that the device is indeed working.
    ifdnfc-activate output:
debug   libnfc.general  log_level is set to 3
debug   libnfc.general  allow_autoscan is set to true
debug   libnfc.general  allow_intrusive_scan is set to true
debug   libnfc.general  1 device(s) defined by user
debug   libnfc.general    #0 name: "IFD-NFC", connstring: "pn532_i2c:/dev/i2c-1"
debug   libnfc.driver.arygon    Trying to find ARYGON device on serial port: /dev/ttyAMA0 at 9600 bauds.
debug   libnfc.bus.uart Serial port speed requested to be set to 9600 bauds.
debug   libnfc.bus.uart TX: 30 61 72 
debug   libnfc.bus.uart Timeout!
debug   libnfc.driver.arygon    No reply to 'reset TAMA' command.
debug   libnfc.general  0 device(s) found using arygon driver
debug   libnfc.driver.pn532_i2c Trying to find PN532 device on I2C bus /dev/i2c-1.
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.chip.pn53x       SAMConfiguration
debug   libnfc.chip.pn53x       Timeout value: 1000
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 14 01 17 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.i2c  TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug   libnfc.bus.i2c  wrote 16 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.general  1 device(s) found using pn532_i2c driver
debug   libnfc.general  0 device(s) found using pn532_spi driver
debug   libnfc.driver.pn532_uart        Trying to find PN532 device on serial port: /dev/ttyAMA0 at 115200 bauds.
debug   libnfc.bus.uart Serial port speed requested to be set to 115200 bauds.
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.bus.uart TX: 55 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
debug   libnfc.general  0 device(s) found using pn532_uart driver
debug   libnfc.driver.acr122s   Trying to find ACR122S device on serial port: /dev/ttyAMA0 at 9600 bauds.
debug   libnfc.bus.uart Serial port speed requested to be set to 9600 bauds.
debug   libnfc.general  0 device(s) found using ACR122S driver
debug   libnfc.general  0 device(s) found using acr122_usb driver
debug   libnfc.general  0 device(s) found using pn53x_usb driver
2 NFC devices found, please select one:
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.chip.pn53x       SAMConfiguration
debug   libnfc.chip.pn53x       Timeout value: 1000
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 14 01 17 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.i2c  TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug   libnfc.bus.i2c  wrote 16 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       GetFirmwareVersion
debug   libnfc.bus.i2c  TX: 00 00 ff 02 fe d4 02 2a 00 
debug   libnfc.bus.i2c  wrote 9 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       SetParameters
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 12 14 06 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.general  "pn532_i2c:/dev/i2c-1" (pn532_i2c:/dev/i2c-1) has been claimed.
[0] pn532_i2c:/dev/i2c-1          (pn532_i2c:/dev/i2c-1)
debug   libnfc.chip.pn53x       ReadRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 0c f4 d4 06 63 02 63 03 63 0d 63 38 63 3d b0 00 
debug   libnfc.bus.i2c  wrote 19 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PN53X_REG_CIU_TxMode (Defines the transmission data rate and framing during transmission)
debug   libnfc.chip.pn53x       PN53X_REG_CIU_RxMode (Defines the transmission data rate and framing during receiving)
debug   libnfc.chip.pn53x       WriteRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 08 f8 d4 08 63 02 80 63 03 80 59 00 
debug   libnfc.bus.i2c  wrote 15 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       InRelease
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 52 00 da 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       RFConfiguration
debug   libnfc.bus.i2c  TX: 00 00 ff 04 fc d4 32 01 00 f9 00 
debug   libnfc.bus.i2c  wrote 11 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PowerDown
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 16 f0 26 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.chip.pn53x       SAMConfiguration
debug   libnfc.chip.pn53x       Timeout value: 1000
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 14 01 17 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.i2c  TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug   libnfc.bus.i2c  wrote 16 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       GetFirmwareVersion
debug   libnfc.bus.i2c  TX: 00 00 ff 02 fe d4 02 2a 00 
debug   libnfc.bus.i2c  wrote 9 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       SetParameters
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 12 14 06 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.general  "pn532_i2c:/dev/i2c-1" (pn532_i2c:/dev/i2c-1) has been claimed.
[1] pn532_i2c:/dev/i2c-1          (pn532_i2c:/dev/i2c-1)
debug   libnfc.chip.pn53x       ReadRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 0c f4 d4 06 63 02 63 03 63 0d 63 38 63 3d b0 00 
debug   libnfc.bus.i2c  wrote 19 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PN53X_REG_CIU_TxMode (Defines the transmission data rate and framing during transmission)
debug   libnfc.chip.pn53x       PN53X_REG_CIU_RxMode (Defines the transmission data rate and framing during receiving)
debug   libnfc.chip.pn53x       WriteRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 08 f8 d4 08 63 02 80 63 03 80 59 00 
debug   libnfc.bus.i2c  wrote 15 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       InRelease
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 52 00 da 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       RFConfiguration
debug   libnfc.bus.i2c  TX: 00 00 ff 04 fc d4 32 01 00 f9 00 
debug   libnfc.bus.i2c  wrote 11 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PowerDown
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 16 f0 26 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
>> 0
Activating ifdnfc with "pn532_i2c:/dev/i2c-1"...
IFD-NFC is inactive.

And here's the log from the daemon:

debug   libnfc.general  log_level is set to 3
debug   libnfc.general  allow_autoscan is set to true
debug   libnfc.general  allow_intrusive_scan is set to true
debug   libnfc.general  1 device(s) defined by user
debug   libnfc.general    #0 name: "IFD-NFC", connstring: "pn532_i2c:/dev/i2c-1"
00000000 [548006926352] ifd-nfc.c:531:IFDHGetCapabilities() Tag 00000fb3 (4019) not supported
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.chip.pn53x       SAMConfiguration
debug   libnfc.chip.pn53x       Timeout value: 1000
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 14 01 17 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.i2c  TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug   libnfc.bus.i2c  wrote 16 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       GetFirmwareVersion
debug   libnfc.bus.i2c  TX: 00 00 ff 02 fe d4 02 2a 00 
debug   libnfc.bus.i2c  wrote 9 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       SetParameters
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 12 14 06 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.general  "pn532_i2c:/dev/i2c-1" (pn532_i2c:/dev/i2c-1) has been claimed.
debug   libnfc.chip.pn53x       target_is_present(): no saved target
18724070 [547981336912] ifd-nfc.c:531:IFDHGetCapabilities() Tag 00000fb2 (4018) not supported
debug   libnfc.chip.pn53x       ReadRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 0c f4 d4 06 63 02 63 03 63 0d 63 38 63 3d b0 00 
debug   libnfc.bus.i2c  wrote 19 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PN53X_REG_CIU_TxMode (Defines the transmission data rate and framing during transmission)
debug   libnfc.chip.pn53x       PN53X_REG_CIU_RxMode (Defines the transmission data rate and framing during receiving)
debug   libnfc.chip.pn53x       WriteRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 08 f8 d4 08 63 02 80 63 03 80 59 00 
debug   libnfc.bus.i2c  wrote 15 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       RFConfiguration
debug   libnfc.bus.i2c  TX: 00 00 ff 06 fa d4 32 05 00 01 02 f2 00 
debug   libnfc.bus.i2c  wrote 13 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       InListPassiveTarget
debug   libnfc.chip.pn53x       No timeout
debug   libnfc.bus.i2c  TX: 00 00 ff 04 fc d4 4a 01 00 e1 00 
debug   libnfc.bus.i2c  wrote 11 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
^Cdebug libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
04520202 [548006926352] ifd-nfc.c:531:IFDHGetCapabilities() Tag 00000fb2 (4018) not supported
debug   libnfc.chip.pn53x       InDeselect
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 44 00 e8 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       InRelease
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 52 00 da 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       RFConfiguration
debug   libnfc.bus.i2c  TX: 00 00 ff 04 fc d4 32 01 00 f9 00 
debug   libnfc.bus.i2c  wrote 11 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
^Cdebug libnfc.chip.pn53x       PowerDown

@ronie19
Copy link
Author

ronie19 commented Jan 19, 2021

Awesome. Can you check once for SPI and let me know. I am out of my home lab till next month.

Unfortunately, I can't. I've broken my SPI connection on the PN532 module. But now I've finally understood how all of this works. The good news is that it is fairly straighforward to do.

  1. Add a new device for the PCSC Daemon. It acts as a server in a sense, and libnfc is the client. It is the configuration file that I've attached earlier. See this for reference. Also, here is my final /etc/reader.conf.d/libifdnfc:
FRIENDLYNAME      "IFD-NFC"
LIBPATH           /usr/local/lib/libifdnfc.so
CHANNELID         0

The most important thing here is the FRIENDLYNAME and the LIBPATH. It'll tell the daemon to register the shared object as the provided name. ifdnfc-activate require a device named IFD-NFC on the server.

  1. Now, start the daemon. ifdnfc-activate will then communicate with the daemon to turn on the device used by libnfc. In this case, it is defined at /etc/nfc/libnfc.conf. Here's my final config:
device.name = "IFD-NFC"
device.connstring = "pn532_i2c:/dev/i2c-1"

Do note that the name doesn't need to be IFD-NFC here as it is not used by the ifdnfc-activate at this point. So in your case, change it to use the SPI protocol.

  1. Now here comes the odd thing. I don't know the cause either but my the device is working as intended. I do all of this on a Raspberry Pi OS 10 (Buster) arm64, and my ifdnfc-activate output tells me the device is not activated. However, running the libnfc with log level debug and the PCSC Daemon on the same log level, I can clearly see that the device is indeed working.
    ifdnfc-activate output:
debug   libnfc.general  log_level is set to 3
debug   libnfc.general  allow_autoscan is set to true
debug   libnfc.general  allow_intrusive_scan is set to true
debug   libnfc.general  1 device(s) defined by user
debug   libnfc.general    #0 name: "IFD-NFC", connstring: "pn532_i2c:/dev/i2c-1"
debug   libnfc.driver.arygon    Trying to find ARYGON device on serial port: /dev/ttyAMA0 at 9600 bauds.
debug   libnfc.bus.uart Serial port speed requested to be set to 9600 bauds.
debug   libnfc.bus.uart TX: 30 61 72 
debug   libnfc.bus.uart Timeout!
debug   libnfc.driver.arygon    No reply to 'reset TAMA' command.
debug   libnfc.general  0 device(s) found using arygon driver
debug   libnfc.driver.pn532_i2c Trying to find PN532 device on I2C bus /dev/i2c-1.
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.chip.pn53x       SAMConfiguration
debug   libnfc.chip.pn53x       Timeout value: 1000
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 14 01 17 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.i2c  TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug   libnfc.bus.i2c  wrote 16 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.general  1 device(s) found using pn532_i2c driver
debug   libnfc.general  0 device(s) found using pn532_spi driver
debug   libnfc.driver.pn532_uart        Trying to find PN532 device on serial port: /dev/ttyAMA0 at 115200 bauds.
debug   libnfc.bus.uart Serial port speed requested to be set to 115200 bauds.
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.bus.uart TX: 55 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
debug   libnfc.general  0 device(s) found using pn532_uart driver
debug   libnfc.driver.acr122s   Trying to find ACR122S device on serial port: /dev/ttyAMA0 at 9600 bauds.
debug   libnfc.bus.uart Serial port speed requested to be set to 9600 bauds.
debug   libnfc.general  0 device(s) found using ACR122S driver
debug   libnfc.general  0 device(s) found using acr122_usb driver
debug   libnfc.general  0 device(s) found using pn53x_usb driver
2 NFC devices found, please select one:
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.chip.pn53x       SAMConfiguration
debug   libnfc.chip.pn53x       Timeout value: 1000
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 14 01 17 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.i2c  TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug   libnfc.bus.i2c  wrote 16 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       GetFirmwareVersion
debug   libnfc.bus.i2c  TX: 00 00 ff 02 fe d4 02 2a 00 
debug   libnfc.bus.i2c  wrote 9 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       SetParameters
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 12 14 06 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.general  "pn532_i2c:/dev/i2c-1" (pn532_i2c:/dev/i2c-1) has been claimed.
[0] pn532_i2c:/dev/i2c-1          (pn532_i2c:/dev/i2c-1)
debug   libnfc.chip.pn53x       ReadRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 0c f4 d4 06 63 02 63 03 63 0d 63 38 63 3d b0 00 
debug   libnfc.bus.i2c  wrote 19 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PN53X_REG_CIU_TxMode (Defines the transmission data rate and framing during transmission)
debug   libnfc.chip.pn53x       PN53X_REG_CIU_RxMode (Defines the transmission data rate and framing during receiving)
debug   libnfc.chip.pn53x       WriteRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 08 f8 d4 08 63 02 80 63 03 80 59 00 
debug   libnfc.bus.i2c  wrote 15 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       InRelease
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 52 00 da 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       RFConfiguration
debug   libnfc.bus.i2c  TX: 00 00 ff 04 fc d4 32 01 00 f9 00 
debug   libnfc.bus.i2c  wrote 11 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PowerDown
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 16 f0 26 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.chip.pn53x       SAMConfiguration
debug   libnfc.chip.pn53x       Timeout value: 1000
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 14 01 17 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.i2c  TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug   libnfc.bus.i2c  wrote 16 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       GetFirmwareVersion
debug   libnfc.bus.i2c  TX: 00 00 ff 02 fe d4 02 2a 00 
debug   libnfc.bus.i2c  wrote 9 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       SetParameters
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 12 14 06 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.general  "pn532_i2c:/dev/i2c-1" (pn532_i2c:/dev/i2c-1) has been claimed.
[1] pn532_i2c:/dev/i2c-1          (pn532_i2c:/dev/i2c-1)
debug   libnfc.chip.pn53x       ReadRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 0c f4 d4 06 63 02 63 03 63 0d 63 38 63 3d b0 00 
debug   libnfc.bus.i2c  wrote 19 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PN53X_REG_CIU_TxMode (Defines the transmission data rate and framing during transmission)
debug   libnfc.chip.pn53x       PN53X_REG_CIU_RxMode (Defines the transmission data rate and framing during receiving)
debug   libnfc.chip.pn53x       WriteRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 08 f8 d4 08 63 02 80 63 03 80 59 00 
debug   libnfc.bus.i2c  wrote 15 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       InRelease
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 52 00 da 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       RFConfiguration
debug   libnfc.bus.i2c  TX: 00 00 ff 04 fc d4 32 01 00 f9 00 
debug   libnfc.bus.i2c  wrote 11 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PowerDown
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 16 f0 26 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
>> 0
Activating ifdnfc with "pn532_i2c:/dev/i2c-1"...
IFD-NFC is inactive.

And here's the log from the daemon:

debug   libnfc.general  log_level is set to 3
debug   libnfc.general  allow_autoscan is set to true
debug   libnfc.general  allow_intrusive_scan is set to true
debug   libnfc.general  1 device(s) defined by user
debug   libnfc.general    #0 name: "IFD-NFC", connstring: "pn532_i2c:/dev/i2c-1"
00000000 [548006926352] ifd-nfc.c:531:IFDHGetCapabilities() Tag 00000fb3 (4019) not supported
debug   libnfc.chip.pn53x       Diagnose
debug   libnfc.chip.pn53x       Timeout value: 500
debug   libnfc.chip.pn53x       SAMConfiguration
debug   libnfc.chip.pn53x       Timeout value: 1000
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 14 01 17 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.i2c  TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug   libnfc.bus.i2c  wrote 16 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       GetFirmwareVersion
debug   libnfc.bus.i2c  TX: 00 00 ff 02 fe d4 02 2a 00 
debug   libnfc.bus.i2c  wrote 9 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       SetParameters
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 12 14 06 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.general  "pn532_i2c:/dev/i2c-1" (pn532_i2c:/dev/i2c-1) has been claimed.
debug   libnfc.chip.pn53x       target_is_present(): no saved target
18724070 [547981336912] ifd-nfc.c:531:IFDHGetCapabilities() Tag 00000fb2 (4018) not supported
debug   libnfc.chip.pn53x       ReadRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 0c f4 d4 06 63 02 63 03 63 0d 63 38 63 3d b0 00 
debug   libnfc.bus.i2c  wrote 19 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       PN53X_REG_CIU_TxMode (Defines the transmission data rate and framing during transmission)
debug   libnfc.chip.pn53x       PN53X_REG_CIU_RxMode (Defines the transmission data rate and framing during receiving)
debug   libnfc.chip.pn53x       WriteRegister
debug   libnfc.bus.i2c  TX: 00 00 ff 08 f8 d4 08 63 02 80 63 03 80 59 00 
debug   libnfc.bus.i2c  wrote 15 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       RFConfiguration
debug   libnfc.bus.i2c  TX: 00 00 ff 06 fa d4 32 05 00 01 02 f2 00 
debug   libnfc.bus.i2c  wrote 13 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       InListPassiveTarget
debug   libnfc.chip.pn53x       No timeout
debug   libnfc.bus.i2c  TX: 00 00 ff 04 fc d4 4a 01 00 e1 00 
debug   libnfc.bus.i2c  wrote 11 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
^Cdebug libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       target_is_present(): Ping -4A
debug   libnfc.chip.pn53x       InCommunicateThru
debug   libnfc.chip.pn53x       Timeout value: 300
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 42 b2 38 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
04520202 [548006926352] ifd-nfc.c:531:IFDHGetCapabilities() Tag 00000fb2 (4018) not supported
debug   libnfc.chip.pn53x       InDeselect
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 44 00 e8 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       InRelease
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 52 00 da 00 
debug   libnfc.bus.i2c  wrote 10 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.chip.pn53x       RFConfiguration
debug   libnfc.bus.i2c  TX: 00 00 ff 04 fc d4 32 01 00 f9 00 
debug   libnfc.bus.i2c  wrote 11 bytes successfully.
debug   libnfc.chip.pn53x       PN53x ACKed
^Cdebug libnfc.chip.pn53x       PowerDown

No luck yet. I changed the /etc/nfc/libnfc.conf config file to:
devicename = "IFD-NFC"
device.connstring="pn532_spi:/dev/spidev0.0:50000"

and also /etc/reader.conf.d/libifdnfc to

FRIENDLYNAME "IFD-NFC"
LIBPATH /usr/local/lib/libifdnfc.so
CHANNELID 0

though it shows up in pcsc_scan as Reader 2 but doesn't read rfid card while running pcsc_scan
it shows is :
Reader 2 : IFD-NFC 00 00
Event number: 0
Card State: Card Removed

while ifdnfc-activate shows :
Insufficient buffer

Any leads ? Some ideas pls

@YandiBanyuKarimaWaly
Copy link

No luck yet. I changed the /etc/nfc/libnfc.conf config file to:
devicename = "IFD-NFC"
device.connstring="pn532_spi:/dev/spidev0.0:50000"

and also /etc/reader.conf.d/libifdnfc to

FRIENDLYNAME "IFD-NFC"
LIBPATH /usr/local/lib/libifdnfc.so
CHANNELID 0

though it shows up in pcsc_scan as Reader 2 but doesn't read rfid card while running pcsc_scan
it shows is :
Reader 2 : IFD-NFC 00 00
Event number: 0
Card State: Card Removed

while ifdnfc-activate shows :
Insufficient buffer

Any leads ? Some ideas pls

Hmmm, try to set the log level to debug, then post the output of the pcscd and the ifdnfc-activate here.

@ronie19
Copy link
Author

ronie19 commented Jan 19, 2021

No luck yet. I changed the /etc/nfc/libnfc.conf config file to:
devicename = "IFD-NFC"
device.connstring="pn532_spi:/dev/spidev0.0:50000"
and also /etc/reader.conf.d/libifdnfc to
FRIENDLYNAME "IFD-NFC"
LIBPATH /usr/local/lib/libifdnfc.so
CHANNELID 0
though it shows up in pcsc_scan as Reader 2 but doesn't read rfid card while running pcsc_scan
it shows is :
Reader 2 : IFD-NFC 00 00
Event number: 0
Card State: Card Removed
while ifdnfc-activate shows :
Insufficient buffer
Any leads ? Some ideas pls

Hmmm, try to set the log level to debug, then post the output of the pcscd and the ifdnfc-activate here.

pi@raspberrypi:~ $ sudo ifdnfc-activate
debug libnfc.general log_level is set to 3
debug libnfc.general allow_autoscan is set to true
debug libnfc.general allow_intrusive_scan is set to false
debug libnfc.general 1 device(s) defined by user
debug libnfc.general #0 name: "IFD-NFC", connstring: "pn532_spi:/dev/spidev0.0:50000"
debug libnfc.general 0 device(s) found using acr122_usb driver
debug libnfc.general 0 device(s) found using pn53x_usb driver
Activating ifdnfc with "pn532_spi:/dev/spidev0.0:50000"...
Insufficient buffer.

@ronie19
Copy link
Author

ronie19 commented Jan 19, 2021

No luck yet. I changed the /etc/nfc/libnfc.conf config file to:
devicename = "IFD-NFC"
device.connstring="pn532_spi:/dev/spidev0.0:50000"
and also /etc/reader.conf.d/libifdnfc to
FRIENDLYNAME "IFD-NFC"
LIBPATH /usr/local/lib/libifdnfc.so
CHANNELID 0
though it shows up in pcsc_scan as Reader 2 but doesn't read rfid card while running pcsc_scan
it shows is :
Reader 2 : IFD-NFC 00 00
Event number: 0
Card State: Card Removed
while ifdnfc-activate shows :
Insufficient buffer
Any leads ? Some ideas pls

Hmmm, try to set the log level to debug, then post the output of the pcscd and the ifdnfc-activate here.

this also happened now:
2 NFC devices found, please select one:
[0] pn532_spi:/dev/spidev0.0 (pn532_spi:/dev/spidev0.0:50000)
[1] pn532_spi:/dev/spidev0.0 (pn532_spi:/dev/spidev0.0:1000000)

0
Activating ifdnfc with "pn532_spi:/dev/spidev0.0:50000"...
Insufficient buffer.

@ronie19
Copy link
Author

ronie19 commented Jan 19, 2021

Detecting in pcsc_scan but not providing any ATR even with card near the pn532 reader

Tue Jan 19 15:42:00 2021
Reader 2: IFD-NFC 00 00
Event number: 32
Card state: Card removed,

Tue Jan 19 15:42:00 2021
Reader 2: IFD-NFC 00 00
Event number: 33
Card state: Card inserted, Unresponsive card,

Tue Jan 19 15:42:01 2021
Reader 2: IFD-NFC 00 00
Event number: 34
Card state: Card removed,

@YandiBanyuKarimaWaly
Copy link

pi@raspberrypi:~ $ sudo ifdnfc-activate
debug libnfc.general log_level is set to 3
debug libnfc.general allow_autoscan is set to true
debug libnfc.general allow_intrusive_scan is set to false
debug libnfc.general 1 device(s) defined by user
debug libnfc.general #0 name: "IFD-NFC", connstring: "pn532_spi:/dev/spidev0.0:50000"
debug libnfc.general 0 device(s) found using acr122_usb driver
debug libnfc.general 0 device(s) found using pn53x_usb driver
Activating ifdnfc with "pn532_spi:/dev/spidev0.0:50000"...
Insufficient buffer.

Hmmm, insufficient buffer implies that the program (in this case, the ifdnfc-activate) cannot allocate enought memory to be used. But the cause itself, I need to dig into the source code which I don't have the time for now as I also have my own schedule. Maybe someone else can help.

@ronie19
Copy link
Author

ronie19 commented Jan 20, 2021

pi@raspberrypi:~ $ sudo ifdnfc-activate
debug libnfc.general log_level is set to 3
debug libnfc.general allow_autoscan is set to true
debug libnfc.general allow_intrusive_scan is set to false
debug libnfc.general 1 device(s) defined by user
debug libnfc.general #0 name: "IFD-NFC", connstring: "pn532_spi:/dev/spidev0.0:50000"
debug libnfc.general 0 device(s) found using acr122_usb driver
debug libnfc.general 0 device(s) found using pn53x_usb driver
Activating ifdnfc with "pn532_spi:/dev/spidev0.0:50000"...
Insufficient buffer.

Hmmm, insufficient buffer implies that the program (in this case, the ifdnfc-activate) cannot allocate enought memory to be used. But the cause itself, I need to dig into the source code which I don't have the time for now as I also have my own schedule. Maybe someone else can help.

even for my i2c connection on raspberry pi, it says insufficient buffer.

@ronie19
Copy link
Author

ronie19 commented Jan 23, 2021

pi@raspberrypi:~ $ sudo ifdnfc-activate
debug libnfc.general log_level is set to 3
debug libnfc.general allow_autoscan is set to true
debug libnfc.general allow_intrusive_scan is set to false
debug libnfc.general 1 device(s) defined by user
debug libnfc.general #0 name: "IFD-NFC", connstring: "pn532_spi:/dev/spidev0.0:50000"
debug libnfc.general 0 device(s) found using acr122_usb driver
debug libnfc.general 0 device(s) found using pn53x_usb driver
Activating ifdnfc with "pn532_spi:/dev/spidev0.0:50000"...
Insufficient buffer.

Hmmm, insufficient buffer implies that the program (in this case, the ifdnfc-activate) cannot allocate enought memory to be used. But the cause itself, I need to dig into the source code which I don't have the time for now as I also have my own schedule. Maybe someone else can help.

this happened:

pi@raspberrypi:~ $ pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
0: IFD-NFC 00 00
1: SAMCARD 00 00
2: SAMCARD 00 01

Sat Jan 23 15:48:26 2021
Reader 0: IFD-NFC 00 00
Event number: 6
Card state: Card inserted,
ATR: 3B 80 80 01 01

ATR: 3B 80 80 01 01

  • TS = 3B --> Direct Convention
  • T0 = 80, Y(1): 1000, K: 0 (historical bytes)
    TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0
    TD(2) = 01 --> Y(i+1) = 0000, Protocol T = 1
  • Historical bytes:
  • TCK = 01 (correct checksum)

Possibly identified card (using /home/pi/.cache/smartcard_list.txt):
NONE

Your card is not present in the database.
Please submit your unknown card at:
http://smartcard-atr.appspot.com/parse?ATR=3B80800101

@phranck
Copy link

phranck commented May 12, 2022

Dumb question: When I try ifdnfc-activate I always get an command not found: ifdnfc-activate. So far I have not been able to find out where to install it from. Any suggestions?

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

No branches or pull requests

3 participants