LudovicRousseau / pcsc-tools

Some tools to be used with smart cards and PC/SC
https://pcsc-tools.apdu.fr/
GNU General Public License v2.0
190 stars 62 forks source link

Can't find my reader after upgrade #19

Closed kolayne closed 5 years ago

kolayne commented 5 years ago

I've upgraded something in my system and after that pcsc_scan cannot find my reader while lsusb sees it. I've tried:

  1. Installing ccid (both source version and via apt-get)
  2. gdb pcscd (my output is exactly same with this gdb backtrace)
  3. modprobe -r pn533 nfc (with pcscd restart)
  4. rmmod pn533_usb pn533 (with pcscd restart)
  5. Installing other versions of pcsc-tools None of this helped. I'm using Linux Mint 19, ACR122U reader.

Thank you for any help

LudovicRousseau commented 5 years ago

Please provide the information listed at https://pcsclite.alioth.debian.org/ccid.html#support

kolayne commented 5 years ago

Versions

CCID: 1.4.29-1 pcsc-lite version 1.8.23

Platform

Linux Mint 19 Advanced Card Systems, Ltd ACR122U

log.txt

00000000 debuglog.c:289:DebugLogSetLevel() debug level=debug
00000065 debuglog.c:310:DebugLogSetCategory() Debug options: APDU
00000015 pcscdaemon.c:352:main() Force colored logs
00000139 utils.c:82:GetDaemonPid() Can't open /var/run/pcscd/pcscd.pid: No such file or directory
00000518 configfile.l:285:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00027215 configfile.l:361:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00014227 configfile.l:322:DBGetReaderListDir() Skipping non regular file: .
00000034 configfile.l:322:DBGetReaderListDir() Skipping non regular file: ..
00000028 pcscdaemon.c:662:main() pcsc-lite 1.8.23 daemon ready.
00031130 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000718 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000575 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x072F, PID: 0x2200, path: /dev/bus/usb/001/028
00000107 hotplug_libudev.c:436:HPAddDevice() Adding USB device: ACS ACR122U PICC Interface
00000177 readerfactory.c:1075:RFInitializeReader() Attempting startup of ACS ACR122U PICC Interface 00 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00038339 readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000174 ifdhandler.c:1961:init_driver() Driver version: 1.4.29
00001708 ifdhandler.c:1978:init_driver() LogLevel: 0x0003
00000025 ifdhandler.c:1989:init_driver() DriverOptions: 0x0000
00000498 ifdhandler.c:2002:init_driver() LogLevel from LIBCCID_ifdLogLevel: 0x000F
00000019 ifdhandler.c:110:CreateChannelByNameOrChannel() Lun: 0, device: usb:072f/2200:libudev:0:/dev/bus/usb/001/028
00000018 ccid_usb.c:237:OpenUSBByName() Reader index: 0, Device: usb:072f/2200:libudev:0:/dev/bus/usb/001/028
00000021 ccid_usb.c:269:OpenUSBByName() interface_number: 0
00000007 ccid_usb.c:270:OpenUSBByName() usb bus/device: 1/28
00000008 ccid_usb.c:302:OpenUSBByName() Using: /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
00001628 ccid_usb.c:320:OpenUSBByName() ifdManufacturerString: Ludovic Rousseau (ludovic.rousseau@free.fr)
00000024 ccid_usb.c:321:OpenUSBByName() ifdProductString: Generic CCID driver
00000007 ccid_usb.c:322:OpenUSBByName() Copyright: This driver is protected by terms of the GNU Lesser General Public License version 2.1, or (at your option) any later version.
00006827 ccid_usb.c:406:OpenUSBByName() Try device: 1/28
00000028 ccid_usb.c:416:OpenUSBByName() vid/pid : 072F/2200
00000008 ccid_usb.c:483:OpenUSBByName() Checking device: 1/28
00000006 ccid_usb.c:554:OpenUSBByName() Trying to open USB bus/device: 1/28
00000168 ccid_usb.c:649:OpenUSBByName() Can't claim interface 1/28: LIBUSB_ERROR_BUSY
00000098 ccid_usb.c:189:close_libusb_if_needed() libusb_exit
00000202 ifdhandler.c:150:CreateChannelByNameOrChannel() failed
00000016 readerfactory.c:1106:RFInitializeReader() Open Port 0x200000 Failed (usb:072f/2200:libudev:0:/dev/bus/usb/001/028)
00000006 readerfactory.c:376:RFAddReader() ACS ACR122U PICC Interface init failed.
00000008 readerfactory.c:610:RFRemoveReader() UnrefReader() count was: 1
00000007 readerfactory.c:1126:RFUnInitializeReader() Attempting shutdown of ACS ACR122U PICC Interface 00 00.
00000006 readerfactory.c:987:RFUnloadReader() Unloading reader driver.
00000110 hotplug_libudev.c:523:HPAddDevice() Failed adding USB device: ACS ACR122U PICC Interface
00000342 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000316 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x04CA, PID: 0x3015, path: /dev/bus/usb/001/006
00000327 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x04CA, PID: 0x3015, path: /dev/bus/usb/001/006
00000277 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000342 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x0408, PID: 0xA030, path: /dev/bus/usb/001/007
00000430 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x0408, PID: 0xA030, path: /dev/bus/usb/001/007
00000468 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0003, path: /dev/bus/usb/002/001

gdb

GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pcscd...Reading symbols from /usr/lib/debug/.build-id/24/5e47e40de4e0b182b0999933c8831eeaa5e365.debug...done.
done.
(gdb) set args --foreground --debug --apdu
(gdb) run
Starting program: /usr/sbin/pcscd --foreground --debug --apdu
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
00000000 debuglog.c:289:DebugLogSetLevel() debug level=debug
00000014 debuglog.c:310:DebugLogSetCategory() Debug options: APDU
00000322 configfile.l:285:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
[New Thread 0x7ffff65a4700 (LWP 18623)]
00000017 configfile.l:361:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00000062 configfile.l:322:DBGetReaderListDir() Skipping non regular file: .
00000003 configfile.l:322:DBGetReaderListDir() Skipping non regular file: ..
00000004 pcscdaemon.c:662:main() pcsc-lite 1.8.23 daemon ready.
00000039 pcscdaemon.c:697:main() cannot create /var/run/pcscd/pcscd.pid: Permission denied
00000018 winscard_msg_srv.c:148:InitializeSocket() Unable to bind common socket: Permission denied
00000016 pcscdaemon.c:722:main() Error initializing pcscd.
00000001 pcscdaemon.c:785:at_exit() cleaning /var/run/pcscd
00000004 pcscdaemon.c:816:clean_temp_files() Cannot remove /var/run/pcscd/pcscd.comm: No such file or directory
00000003 pcscdaemon.c:822:clean_temp_files() Cannot remove /var/run/pcscd/pcscd.pid: No such file or directory
[Thread 0x7ffff65a4700 (LWP 18623) exited]
[Inferior 1 (process 18619) exited with code 01]
(gdb) backtrace
(gdb) quit
LudovicRousseau commented 5 years ago

See https://ludovicrousseau.blogspot.com/2013/11/linux-nfc-driver-conflicts-with-ccid.html