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

Not finding device CIR315A on Raspberry Pi #726

Open ajmas opened 2 months ago

ajmas commented 2 months ago

I have a Raspberry Pi 4 which I am trying to use a CIR315A based reader with, but I am not having much luck. What I tried:

> sudo apt install nfctools-bin

> nfc-list 
nfc-list uses libnfc 1.8.0
No NFC device found.

> sudo apt install libccid

> lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 31aa:3001 Circle CIR315
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

> nfc-scan-device 
nfc-scan-device uses libnfc 1.8.0
No NFC device found.

> sudo apt install pcsc-tools

> pcsc_scan 
SCardEstablishContext: Service not available.

> sudo apt install pcscd

> pcsc_scan 
Using reader plug'n play mechanism
Scanning present readers...
Waiting for the first reader... -   

LIBNFC_LOG_LEVEL=3 nfc-list -v

debug   libnfc.config   Unable to open directory: /etc/nfc/devices.d
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  0 device(s) defined by user
nfc-list uses libnfc 1.8.0
debug   libnfc.general  0 device(s) found using acr122_usb driver
debug   libnfc.general  0 device(s) found using pn53x_usb driver
No NFC device found.

For the OS:

cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

While there is a manufacturer supplied fork of the libccid, I am trying to keep to the mainline of libccid, since the device is listed in the "should work" section of the site.

I did end up trying the manufacturer's driver (I needed to download and build from source). While restarting pcscd and re-running pcsc_scan did give me the output below, there was no change in the output of LIBNFC_LOG_LEVEL=3 nfc-list -v :

Using reader plug'n play mechanism
Scanning present readers...
0: Circle CIR315 [CIR315 SAM] 00 00

Sun May  5 16:54:37 2024
 Reader 0: Circle CIR315 [CIR315 SAM] 00 00
  Event number: 0
  Card state: Card removed, 

Note the contents of /usr/lib/pcsc/drivers/ were:

drwxr-xr-x 3 root root 4096 May  5 16:53 ifd-abcccid.bundle
drwxr-xr-x 3 root root 4096 May  5 16:52 ifd-ccid.bundle
drwxr-xr-x 2 root root 4096 May  5 16:52 serial

Version values in the Info.plist files:

BTW I have also been trying on macOS, but haven't been successful there yet either. (see here and here)

More testing with pcsc_scan, after installing ccid 1.5.4, gives:

> pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
0: Circle CIR315 [CIR315 PICC] 00 00
1: Circle CIR315 [CIR315 SAM] 00 00

Sun May  5 17:10:51 2024
 Reader 0: Circle CIR315 [CIR315 PICC] 00 00
  Event number: 0
  Card state: Card removed, 
 Reader 1: Circle CIR315 [CIR315 SAM] 00 00
  Event number: 0
  Card state: Card removed, 

Sun May  5 17:10:54 2024
 Reader 0: Circle CIR315 [CIR315 PICC] 00 00
  Event number: 1
  Card state: Card inserted, 
  ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 0B 00 14 00 00 00 00 77

ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 0B 00 14 00 00 00 00 77
+ TS = 3B --> Direct Convention
+ T0 = 8F, Y(1): 1000, K: 15 (historical bytes)
  TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0 
-----
  TD(2) = 01 --> Y(i+1) = 0000, Protocol T = 1 
-----
+ Historical bytes: 80 4F 0C A0 00 00 03 06 0B 00 14 00 00 00 00
  Category indicator byte: 80 (compact TLV data object)
    Tag: 4, len: F (initial access data)
      Initial access data: 0C A0 00 00 03 06 0B 00 14 00 00 00 00
+ TCK = 77 (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 8F 80 01 80 4F 0C A0 00 00 03 06 0B 00 14 00 00 00 00 77
3B 8F 80 01 80 4F 0C A0 00 00 03 06 .. 00 14 00 00 00 00 ..
    ICODESLI (as per PCSC std part3)
3B 8F 80 01 80 4F 0C A0 00 00 03 06 0B 00 14 00 00 00 00 77
3B 8F 80 01 80 4F 0C A0 00 00 03 06 0B .. .. 00 00 00 00 ..
    RFID - ISO 15693 Part 3 (as per PCSC std part3)
3B 8F 80 01 80 4F 0C A0 00 00 03 06 0B 00 14 00 00 00 00 77
    Philips ICode
    RFID - ISO 15693 - Philips Semiconductors

Sun May  5 17:34:31 2024
 Reader 0: Circle CIR315 [CIR315 PICC] 00 00
  Event number: 2
  Card state: Card removed, 

Still no change with nfc-list.

I am really not sure what else to explore at this point.