[Pcsclite-muscle] SCardEstablishContext method call return SCARD_E_NO_SERVICE on Android

Ludovic Rousseau ludovic.rousseau at gmail.com
Wed Nov 16 17:47:27 UTC 2016


2016-11-16 15:26 GMT+01:00  <plomba at net.hr>:
> Hello again,
>  I've managed to get past the  LIBUSB_ERROR_BUSY error when loading a driver for ACR38U PocketMate II Smart Card Reader by using a different Android device.
>
>  Now the pcscd daemon starts, loads the reader drivers, and loads the card as shown in the log below:
>
>  pcscd log:
>  00000000 debuglog.c:289:DebugLogSetLevel() debug level=debug
>  00000457 configfile.l:358:DBGetReaderList() Parsing conf file: /home/frane/PCSC/build/etc/reader.conf.d
>  00000062 pcscdaemon.c:655:main() pcsc-lite 1.8.18 daemon ready.
>  00007080 hotplug_libusb.c:536:HPAddHotPluggable() Adding USB device: 1:2:0
>  00000122 readerfactory.c:1079:RFInitializeReader() Attempting startup of ACS ACR38U-CCID 00 00 using /data/data/test/drivers//ifd-acsccid.bundle/Contents/Linux/libacsccid.so
>  00000915 readerfactory.c:954:RFBindFunctions() Loading IFD Handler 3.0
>  00000153 ifdhandler.c:2611:init_driver() Driver version: 1.1.3
>  00001678 ifdhandler.c:2628:init_driver() LogLevel: 0x0003
>  00000061 ifdhandler.c:2639:init_driver() DriverOptions: 0x0000
>  00000031 ifdhandler.c:2647:init_driver() ACSDriverOptions: 0x0003
>  00000061 ifdhandler.c:2655:init_driver() ACR38CardVoltage: 0
>  00000030 ifdhandler.c:2663:init_driver() ACR38CardType: 0
>  00000336 ifdhandler.c:121:CreateChannelByNameOrChannel() Lun: 0, device: usb:072f/90cc:libusb-1.0:1:2:0
>  00000092 ccid_usb.c:313:OpenUSBByName() Using: /data/data/test/drivers/ifd-acsccid.bundle/Contents/Info.plist
>  00002075 ccid_usb.c:331:OpenUSBByName() ifdManufacturerString: Advanced Card Systems Ltd.
>  00000030 ccid_usb.c:332:OpenUSBByName() ifdProductString: ACS CCID driver
>  00000061 ccid_usb.c:333: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.
>  00001404 ccid_usb.c:706:OpenUSBByName() Found Vendor/Product: 072F/90CC (ACS ACR38U-CCID)
>  00000061 ccid_usb.c:708:OpenUSBByName() Using USB bus/device: 1/2
>  00000031 ccid_usb.c:882:OpenUSBByName() bNumDataRatesSupported is 0
>  00108001 ifdhandler.c:266:CreateChannelByNameOrChannel() dwFeatures: 0x00010030
>  00000153 ifdhandler.c:267:CreateChannelByNameOrChannel() wLcdLayout: 0x0000
>  00000031 ifdhandler.c:268:CreateChannelByNameOrChannel() bPINSupport: 0x00
>  00000061 ifdhandler.c:269:CreateChannelByNameOrChannel() dwMaxCCIDMessageLength: 271
>  00000061 ifdhandler.c:270:CreateChannelByNameOrChannel() dwMaxIFSD: 247
>  00000030 ifdhandler.c:271:CreateChannelByNameOrChannel() dwDefaultClock: 4000
>  00000061 ifdhandler.c:272:CreateChannelByNameOrChannel() dwMaxDataRate: 344100
>  00000031 ifdhandler.c:273:CreateChannelByNameOrChannel() bMaxSlotIndex: 0
>  00000061 ifdhandler.c:274:CreateChannelByNameOrChannel() bCurrentSlotIndex: 0
>  00000030 ifdhandler.c:275:CreateChannelByNameOrChannel() bInterfaceProtocol: 0x00
>  00000061 ifdhandler.c:276:CreateChannelByNameOrChannel() bNumEndpoints: 3
>  00000031 ifdhandler.c:277:CreateChannelByNameOrChannel() bVoltageSupport: 0x07
>  00000061 ifdhandler.c:443:IFDHGetCapabilities() tag: 0xFB3, usb:072f/90cc:libusb-1.0:1:2:0 (lun: 0)
>  00000061 readerfactory.c:395:RFAddReader() Using the reader polling thread
>  00002411 ifdhandler.c:443:IFDHGetCapabilities() tag: 0xFAE, usb:072f/90cc:libusb-1.0:1:2:0 (lun: 0)
>  00000061 ifdhandler.c:543:IFDHGetCapabilities() Reader supports 1 slot(s)
>  00000732 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00000031 hotplug_libusb.c:440:HPEstablishUSBNotifications() Driver ifd-acsccid.bundle does not support IFD_GENERATE_HOTPLUG. Using active polling instead.
>  00000091 hotplug_libusb.c:449:HPEstablishUSBNotifications() Polling forced every 1 second(s)
>  00002960 ifdhandler.c:1320:IFDHPowerICC() action: PowerUp, usb:072f/90cc:libusb-1.0:1:2:0 (lun: 0)
>  00007081 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010162 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010162 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010163 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010192 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010163 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010162 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010224 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010162 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010162 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010193 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010132 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010162 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010163 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010162 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00010193 readerfactory.c:1420:RFWaitForReaderInit() Waiting init for reader: ACS ACR38U-CCID 00 00
>  00000397 eventhandler.c:286:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
>  00000091 Card ATR: 3B FF 13 00 00 81 31 FE 45 00 31 B9 64 04 44 EC C1 73 94 01 80 82 90 00 12
>  03334137 ccid_usb.c:1772:InterruptRead() 1/2: Slot 0: 0x02
>  00002777 eventhandler.c:479:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED
>  00001953 eventhandler.c:355:EHStatusHandlerThread() Card Removed From ACS ACR38U-CCID 00 00
>  02747223 ccid_usb.c:1772:InterruptRead() 1/2: Slot 0: 0x00
>  00007172 ifdhandler.c:1320:IFDHPowerICC() action: PowerUp, usb:072f/90cc:libusb-1.0:1:2:0 (lun: 0)
>  00161743 eventhandler.c:403:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
>  00000275 eventhandler.c:420:EHStatusHandlerThread() Card inserted into ACS ACR38U-CCID 00 00
>  00000183 Card ATR: 3B FF 13 00 00 81 31 FE 45 00 31 B9 64 04 44 EC C1 73 94 01 80 82 90 00 12
>  05005401 ifdhandler.c:1320:IFDHPowerICC() action: PowerDown, usb:072f/90cc:libusb-1.0:1:2:0 (lun: 0)
>  00101044 eventhandler.c:479:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED
>  48668244 pcscdaemon.c:192:signal_thread() Received signal: 15
>  00000122 pcscdaemon.c:212:signal_thread() Direct suicide
>  00000061 pcscdaemon.c:781:at_exit() cleaning /data/data/test/ipc/
>
>  My configuration is:
>
>  root at flo:/data/data/test # ./pcscd -v
>  pcsc-lite version 1.8.18.
>  Copyright (C) 1999-2002 by David Corcoran <corcoran at musclecard.com>.
>  Copyright (C) 2001-2015 by Ludovic Rousseau <ludovic.rousseau at free.fr>.
>  Copyright (C) 2003-2004 by Damien Sauveron <sauveron at labri.fr>.
>  Report bugs to <pcsclite-muscle at lists.alioth.debian.org>.
>  Enabled features: Linux arm-unknown-linux-androideabi serial usb libusb usbdropdir=/data/data/test/drivers/ ipcdir=/data/data/test/ipc/ configdir=/home/frane/PCSC/build/etc/reader.conf.d
>
>
>  But when i try to access the card either by using pcsc_scan or my application i always get SCARD_E_NO_SERVICE on SCardEstablishContext method call.
>  The pcsc_scan response is: SCardEstablishContext: Service not available.
>
>  What do you reccommend? Why can't i access the card when the pcscd detects the reader and the card and it's ATR.

I guess the libpcsclite.so.1 used by your application and pcsc_scan
does not find the pcscd.comm file created by pcscd.
Check you did "make install" to install pcsc-lite
Check you have only 1 libpcsclite.so.1 in your system.

Bye

-- 
 Dr. Ludovic Rousseau



More information about the Pcsclite-muscle mailing list