Description of problem: NFC reader is not detected when using any of the libnfc-examples utils. Version-Release number of selected component (if applicable): pcsc-lite-ccid-1.4.6-1.fc17 Steps to Reproduce: 1. Install pcsc-lite, pcsc-lite-ccid, libusb, libnfc and libnfc-examples. 2. Plug a supported reader by CCID driver, in my case Touchatag. 3. Place any tag on the reader and execute "nfc-list". Actual results: No NFC device found. Expected results: ATR Additional info: The author seems to be aware of the problem: http://comments.gmane.org/gmane.comp.lib.muscle/9037 As a workaround, downgrading to pcsc-lite-ccid-1.4.5-2.fc17 solves the problem.
I don't think your problem is related to the one reported by Martin Vogt in the email you reference. Please follow http://pcsclite.alioth.debian.org/pcsclite.html#support to generate a log trace.
Created attachment 592642 [details] pcscd log
(In reply to comment #1) > I don't think your problem is related to the one reported by Martin Vogt in > the email you reference. > > Please follow http://pcsclite.alioth.debian.org/pcsclite.html#support to > generate a log trace. Please, let me know if you find out what is causing the problem or if you need further log traces.
I do not see any "ccid_usb.c:648:WriteUSB() write failed (1/10): -4 No such device" in your log. I don't know from where you got the title of this bug report. I do not see any thing strange from the pcscd log. I guess you can see the reader and the card ATR using the "pcsc_scan" command (from the pcsc-tools package). It looks like the bug is in nfc-list.
After connecting my reader and executing "service pcscd status", I get this message: Redirecting to /bin/systemctl status pcscd.service pcscd.service - PC/SC Smart Card Daemon Loaded: loaded (/usr/lib/systemd/system/pcscd.service; static) Active: active (running) since Mon, 18 Jun 2012 16:34:19 +0200; 9min ago Main PID: 4307 (pcscd) CGroup: name=systemd:/system/pcscd.service └ 4307 /usr/sbin/pcscd --foreground --auto-exit Jun 18 16:35:01 helena.lan pcscd[4307]: 00000000 ccid_usb.c:648:WriteUSB() write failed (1/9): -4 No such device Jun 18 16:42:53 helena.lan pcscd[4307]: 99999999 ccid_usb.c:648:WriteUSB() write failed (1/10): -4 No such device Jun 18 16:43:00 helena.lan pcscd[4307]: 07389131 ccid_usb.c:648:WriteUSB() write failed (1/11): -4 No such device Jun 18 16:43:00 helena.lan pcscd[4307]: 00001350 ifdwrapper.c:341:IFDStatusICC() Card not transacted: 617 Jun 18 16:43:01 helena.lan pcscd[4307]: 01000330 ccid_usb.c:648:WriteUSB() write failed (1/11): -4 No such device Jun 18 16:43:01 helena.lan pcscd[4307]: 00000032 ifdhandler.c:1129:IFDHPowerICC() PowerDown failed Jun 18 16:43:01 helena.lan pcscd[4307]: 00000164 ccid_usb.c:648:WriteUSB() write failed (1/11): -4 No such device And no matter what tools from the libnfc-examples package I use, I always get the "No NFC device found" message. The same tools are working when I downgrade to pcsc-lite-ccid-1.4.5-2.fc17 so I guess, the problem is not in the libnfc-examples tools. Executing pcsc_scan thows this at the output: PC/SC device scanner V 1.4.17 (c) 2001-2009, Ludovic Rousseau <ludovic.rousseau> Compiled with PC/SC lite version: 1.7.4 SCardEstablishContext: Service not available. In the other hand, if I run pcscd as you suggested in order to generate a log trace and I execute pcsc_scan, I can see the ATR of the card but none of the libnfc tools are working, all of them keep trowing the "No NFC device found". The same happens even if unplug/plug the reader.
Hello Kalev, Can you trigger a build of pcsc-lite-ccid-1.4.7-1.fc18 for Fedora 17? This problem still persists with the latest package available in F17 repositories (pcsc-lite-ccid-1.4.6-1.fc17) and none of the tools built with libnfc seem to work right now. Thanks.
Manuel, Can you please test if the rawhide build of pcsc-lite-ccid 1.4.7 fixes your issue? It should be a drop in replacement for the F17 pcsc-lite-ccid. http://koji.fedoraproject.org/koji/buildinfo?buildID=325162
Sorry, wrong koji link above, it should be: http://koji.fedoraproject.org/koji/buildinfo?buildID=327581
No, it does not work. This is strange, pcsc-lite-ccid-1.4.5-2.fc17 works as expected but my reader stops working when using any version >=1.4.6. When issuing any command with the problematic versions, the reader seems to work since the led becomes static but as I said before, it does not work with any tool built with libnfc.
In your comment #5 you show a NON working pcsc_scan. So the problem may not be only with libnfc. Also you never took some time to generate a pcscd log trace as decribed in http://pcsclite.alioth.debian.org/pcsclite.html#support
If I run pcsc_scan right after starting pcscd, this is what I get: PC/SC device scanner V 1.4.17 (c) 2001-2009, Ludovic Rousseau <ludovic.rousseau> Compiled with PC/SC lite version: 1.7.4 Scanning present readers... 0: ACS AET65 00 00 Wed Jul 4 23:26:41 2012 Reader 0: ACS AET65 00 00 Card state: Card inserted, ATR: 3B BE 95 00 00 41 03 00 00 00 00 00 00 00 00 00 02 90 00 ATR: 3B BE 95 00 00 41 03 00 00 00 00 00 00 00 00 00 02 90 00 + TS = 3B --> Direct Convention + T0 = BE, Y(1): 1011, K: 14 (historical bytes) TA(1) = 95 --> Fi=512, Di=16, 32 cycles/ETU 125000 bits/s at 4 MHz, fMax for Fi = 5 MHz => 156250 bits/s TB(1) = 00 --> VPP is not electrically connected TD(1) = 00 --> Y(i+1) = 0000, Protocol T = 0 ----- + Historical bytes: 41 03 00 00 00 00 00 00 00 00 00 02 90 00 Category indicator byte: 41 (proprietary format) Possibly identified card (using /usr/share/pcsc/smartcard_list.txt): 3B BE 95 00 00 41 03 00 00 00 00 00 00 00 00 00 02 90 00 touchatag SAM card After stoping/starting pcscd again, the reader is not detected and this is the output: PC/SC device scanner V 1.4.17 (c) 2001-2009, Ludovic Rousseau <ludovic.rousseau> Compiled with PC/SC lite version: 1.7.4 SCardEstablishContext: Service not available. I've attached anther log after running 'nfc-list' and 'nfc-anticol', where both of them did not detect the reader. I've been working with pcsc-lite and the ccid driver for some time now and this problem only appears with pcsc-lite-ccid version >=1.4.6. Downgrading to 1.4.5 solves all these issues. These are the packages that are causing the problems in my system right now: pcsc-lite-1.8.3-1.fc17 pcsc-lite-libs-1.8.3-1.fc17 pcsc-lite-ccid-1.4.6-1.fc17 libnfc-1.4.2-2.fc17
Created attachment 596290 [details] pcscd log 2
(In reply to comment #11) > After stoping/starting pcscd again, the reader is not detected and this is > the output: And what is the pcscd log in this specific case? How do you stop/start pcscd?
(In reply to comment #13) > (In reply to comment #11) > > After stoping/starting pcscd again, the reader is not detected and this is > > the output: > > And what is the pcscd log in this specific case? > Sorry, my mistake, I was getting this when executing pcsc_scan without pcscd running. > How do you stop/start pcscd? # service pcscd start/stop There is something curious, when executing 'service pcscd status', systemd reports that pcscd is running but I get this at the end of the output (and /var/log/messages): utils.c:53:GetDaemonPid() Can't open /var/run/pcscd/pcscd.pid: No such file or directory
Please only run pcscd in debug mode for now: sudo LIBCCID_ifdLogLevel=0x000F pcscd --foreground --debug --apdu You will need to stop pcscd from systemd to avoid conflicts. See http://ludovicrousseau.blogspot.com/2011/11/pcscd-auto-start-using-systemd.html
Following your directions, I've stopped and killed all pcscd running processes before taking the new log that I've attached. It seems that everything is working fine but still the reader is not detected. There should be something new that changed from pcsc-lite-ccid 1.4.5 to 1.4.6 that is causing this problem or even pcsc-lite package. The same packages were working fine with the last packages available before F17 was released. Could bug #831987 be related with this issue?
Created attachment 596505 [details] pcscd log 3
(In reply to comment #16) > Could bug #831987 be related with this issue? No, this is unrelated. In rawhide (F18), libudev and systemd projects were merged together and bug #831987 is just a request to update the packaging for that.
Your reader is correctly detected with the name "ACS AET65 00 00". The reader names have been reordered in CCID driver revision 1.4.6. The problem is that ACS is using the exact same USB PID (product ID) for different readers. So the reader name reported by pcsc-lite has changed for the same reader. See also this bug "[#313729] libnfc broken with 1.4.7-1" https://alioth.debian.org/tracker/index.php?func=detail&aid=313729&group_id=30105&atid=410085 The bug is with libnfc (I think). That do not explain the "write failed (1/9): -4 No such device" error message.
Hi Ludovic, You are right! After checking the bug report you suggested, I added the name of my device as it is reported by pcsc-lite to the supported devices by libnfc using the patch that I've attached. That solves the issue and the reader operates correctly as it should. I tried the patch against the last version available in Fedora repositories (1.4.2) so it should be integrated until a decision is taken regarding: 1. How pcsc-lite decides the device's name during enumeration for a device that share the USB ID. Note that my device (touchatag) was previously reported as "ACS ACR 38U-CCID" rather than "ACS AET65 00 00". 2. libnfc should incorporate these names associated to the same USB ID to avoid conflicts. I don't know which option is the appropriate but somebody should file a bug against libnfc to warn them about it. By the way, the "write failed (1/9): -4 No such device" error message is gone. Thanks for your help guys!
Created attachment 600628 [details] libnfc usb enumeration patch
reported to libnfc at https://code.google.com/p/libnfc/issues/detail?id=202
Reassigning the ticket to libnfc.
libnfc-1.4.2-5.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/libnfc-1.4.2-5.fc17
Package libnfc-1.4.2-5.fc17: * should fix your issue, * was pushed to the Fedora 17 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing libnfc-1.4.2-5.fc17' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-11283/libnfc-1.4.2-5.fc17 then log in and leave karma (feedback).
libnfc-1.4.2-5.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.