Jinmuyu MR800 card reader problem

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Jinmuyu MR800 card reader problem

Frédéric Marchal
Hi,

I'm trying to use a MR800 from Jinmuyu but it doesn't work on Linux.

I'm using the latest sources from git for both the ccid driver (Driver
version: 1.4.27) and pcscd (pcsc-lite 1.8.21 daemon).

So far, I believe the problem occurs because the reader reports
nMaxSlotIndex=1 and the ccid driver fails when trying to open slot 1:

00000009 ccid_usb.c:237:OpenUSBByName() Reader index: 1, Device: usb:03eb/
6120:libudev:0:/dev/bus/usb/001/008
00000018 ccid_usb.c:269:OpenUSBByName() interface_number: 0
00000006 ccid_usb.c:270:OpenUSBByName() usb bus/device: 1/8
00000005 ccid_usb.c:302:OpenUSBByName() Using: /usr/local/lib/pcsc/drivers/
ifd-ccid.bundle/Contents/Info.plist
00001082 ccid_usb.c:320:OpenUSBByName() ifdManufacturerString: Ludovic
Rousseau ([hidden email])
00000010 ccid_usb.c:321:OpenUSBByName() ifdProductString: Generic CCID driver
00000005 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.
00000245 ccid_usb.c:406:OpenUSBByName() Try device: 1/8
00000008 ccid_usb.c:416:OpenUSBByName() vid/pid : 03EB/6120
00000005 ccid_usb.c:483:OpenUSBByName() Checking device: 1/8
00000004 ccid_usb.c:532:OpenUSBByName() Opening slot: 1
00000269 -> 000001 65 00 00 00 00 01 07 00 00 00
00000372 <- 000001 81 00 00 00 00 01 07 42 05 00
00000008 commands.c:1235:CmdGetSlotStatus Invalid slot number

Here is the requested information:

$ ./pcscd --version
pcsc-lite version 1.8.21.
Copyright (C) 1999-2002 by David Corcoran <[hidden email]>.
Copyright (C) 2001-2015 by Ludovic Rousseau <[hidden email]>.
Copyright (C) 2003-2004 by Damien Sauveron <[hidden email]>.
Report bugs to <[hidden email]>.
Enabled features: Linux x86_64-pc-linux-gnu serial usb libudev usbdropdir=/
usr/local/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/usr/local/etc/
reader.conf.d

$ uname -a
Linux HP036 4.10.0-rc6-amd64 #1 SMP Debian 4.10~rc6-1~exp2 (2017-02-02) x86_64
GNU/Linux

The attached mr800-usb.txt is the output of lsusb -v -d 03eb:6120 > mr800-
usb.txt

The attache mr800.log is the output from

export LIBCCID_ifdLogLevel=0x000F
sudo /home/emisys/pcsc/src/pcscd --apdu --foreground --debug --color 2>&1 |
tee mr800.log

I took the liberty of adding a couple messages to try to understand what is
happening. I also added the VID/PID/name to Info.plist to get that far. The
name I entered in Info.plist is the name reported by the Windows SC API.

The full reader reference is MR800UC-V as per the label.

Could you please give me some guidance as to how to make that reader work with
pcsc-lite?

PS: I do speak French if you need to contact me off-list.
 
Thanks,

Frédéric

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle

mr800-usb.txt (3K) Download Attachment
mr800.log (54K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Jinmuyu MR800 card reader problem

Frédéric Marchal
Hi again,

Forcing nMaxSlotIndex=0 in the code goes one step further but it still fails
in the end.

The new log is attached to this mail as mr800-maxslot0.txt. I simply changed
the line in the attached maxslot0.txt (for information only).

If it may help, the MR800 pdf documentation can be downloaded here: http://
www.jinmuyu.com/download/JINMUYU%20Compatible%20USB%20PCSC%20IC%20Card
%20Reader%20General%20Technical%20Manual.pdf

Frédéric

On dimanche 11 juin 2017 9 h 45 min 28 s CEST Frédéric Marchal wrote:

> Hi,
>
> I'm trying to use a MR800 from Jinmuyu but it doesn't work on Linux.
>
> I'm using the latest sources from git for both the ccid driver (Driver
> version: 1.4.27) and pcscd (pcsc-lite 1.8.21 daemon).
>
> So far, I believe the problem occurs because the reader reports
> nMaxSlotIndex=1 and the ccid driver fails when trying to open slot 1:
>
> 00000009 ccid_usb.c:237:OpenUSBByName() Reader index: 1, Device: usb:03eb/
> 6120:libudev:0:/dev/bus/usb/001/008
> 00000018 ccid_usb.c:269:OpenUSBByName() interface_number: 0
> 00000006 ccid_usb.c:270:OpenUSBByName() usb bus/device: 1/8
> 00000005 ccid_usb.c:302:OpenUSBByName() Using: /usr/local/lib/pcsc/drivers/
> ifd-ccid.bundle/Contents/Info.plist
> 00001082 ccid_usb.c:320:OpenUSBByName() ifdManufacturerString: Ludovic
> Rousseau ([hidden email])
> 00000010 ccid_usb.c:321:OpenUSBByName() ifdProductString: Generic CCID
> driver 00000005 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.
> 00000245 ccid_usb.c:406:OpenUSBByName() Try device: 1/8
> 00000008 ccid_usb.c:416:OpenUSBByName() vid/pid : 03EB/6120
> 00000005 ccid_usb.c:483:OpenUSBByName() Checking device: 1/8
> 00000004 ccid_usb.c:532:OpenUSBByName() Opening slot: 1
> 00000269 -> 000001 65 00 00 00 00 01 07 00 00 00
> 00000372 <- 000001 81 00 00 00 00 01 07 42 05 00
> 00000008 commands.c:1235:CmdGetSlotStatus Invalid slot number
>
> Here is the requested information:
>
> $ ./pcscd --version
> pcsc-lite version 1.8.21.
> Copyright (C) 1999-2002 by David Corcoran <[hidden email]>.
> Copyright (C) 2001-2015 by Ludovic Rousseau <[hidden email]>.
> Copyright (C) 2003-2004 by Damien Sauveron <[hidden email]>.
> Report bugs to <[hidden email]>.
> Enabled features: Linux x86_64-pc-linux-gnu serial usb libudev usbdropdir=/
> usr/local/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/usr/local/etc/
> reader.conf.d
>
> $ uname -a
> Linux HP036 4.10.0-rc6-amd64 #1 SMP Debian 4.10~rc6-1~exp2 (2017-02-02)
> x86_64 GNU/Linux
>
> The attached mr800-usb.txt is the output of lsusb -v -d 03eb:6120 > mr800-
> usb.txt
>
> The attache mr800.log is the output from
>
> export LIBCCID_ifdLogLevel=0x000F
> sudo /home/emisys/pcsc/src/pcscd --apdu --foreground --debug --color 2>&1 |
> tee mr800.log
>
> I took the liberty of adding a couple messages to try to understand what is
> happening. I also added the VID/PID/name to Info.plist to get that far. The
> name I entered in Info.plist is the name reported by the Windows SC API.
>
> The full reader reference is MR800UC-V as per the label.
>
> Could you please give me some guidance as to how to make that reader work
> with pcsc-lite?
>
> PS: I do speak French if you need to contact me off-list.
>
> Thanks,
>
> Frédéric

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle

mr800-maxslot0.txt (64K) Download Attachment
maxslot0.txt (702 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Jinmuyu MR800 card reader problem

Frédéric Marchal
One last message for today :-)

I got it working. The MR800 claims to be compatible with protocol T1 but it
isn't. If I select protocol T0 from my application, I can communicate with the
reader (see mr800-T0.txt).

Now, how to fix this properly to make it work out of the box with pcsc is
beyond me. I'm available to test any solution you propose.

To summarize, I had to change two things to make it work.

1) The reader returns nMaxSlotIndex=1 but slot 1 fails. I suggest to make pcsc
use the available slots in that case instead of failing completely.

2) Protocol T1 doesn't work. Falling back to T0 fails. But selecting T0 from
the application succeed. Is pcsc unable to recover after trying T1 or is the
reader that's jammed?

Frédéric

On dimanche 11 juin 2017 11 h 14 min 51 s CEST Frédéric Marchal wrote:

> Hi again,
>
> Forcing nMaxSlotIndex=0 in the code goes one step further but it still fails
> in the end.
>
> The new log is attached to this mail as mr800-maxslot0.txt. I simply changed
> the line in the attached maxslot0.txt (for information only).
>
> If it may help, the MR800 pdf documentation can be downloaded here: http://
> www.jinmuyu.com/download/JINMUYU%20Compatible%20USB%20PCSC%20IC%20Card
> %20Reader%20General%20Technical%20Manual.pdf
>
> Frédéric
>
> On dimanche 11 juin 2017 9 h 45 min 28 s CEST Frédéric Marchal wrote:
> > Hi,
> >
> > I'm trying to use a MR800 from Jinmuyu but it doesn't work on Linux.
> >
> > I'm using the latest sources from git for both the ccid driver (Driver
> > version: 1.4.27) and pcscd (pcsc-lite 1.8.21 daemon).
> >
> > So far, I believe the problem occurs because the reader reports
> > nMaxSlotIndex=1 and the ccid driver fails when trying to open slot 1:
> >
> > 00000009 ccid_usb.c:237:OpenUSBByName() Reader index: 1, Device: usb:03eb/
> > 6120:libudev:0:/dev/bus/usb/001/008
> > 00000018 ccid_usb.c:269:OpenUSBByName() interface_number: 0
> > 00000006 ccid_usb.c:270:OpenUSBByName() usb bus/device: 1/8
> > 00000005 ccid_usb.c:302:OpenUSBByName() Using:
> > /usr/local/lib/pcsc/drivers/
> > ifd-ccid.bundle/Contents/Info.plist
> > 00001082 ccid_usb.c:320:OpenUSBByName() ifdManufacturerString: Ludovic
> > Rousseau ([hidden email])
> > 00000010 ccid_usb.c:321:OpenUSBByName() ifdProductString: Generic CCID
> > driver 00000005 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.
> > 00000245 ccid_usb.c:406:OpenUSBByName() Try device: 1/8
> > 00000008 ccid_usb.c:416:OpenUSBByName() vid/pid : 03EB/6120
> > 00000005 ccid_usb.c:483:OpenUSBByName() Checking device: 1/8
> > 00000004 ccid_usb.c:532:OpenUSBByName() Opening slot: 1
> > 00000269 -> 000001 65 00 00 00 00 01 07 00 00 00
> > 00000372 <- 000001 81 00 00 00 00 01 07 42 05 00
> > 00000008 commands.c:1235:CmdGetSlotStatus Invalid slot number
> >
> > Here is the requested information:
> >
> > $ ./pcscd --version
> > pcsc-lite version 1.8.21.
> > Copyright (C) 1999-2002 by David Corcoran <[hidden email]>.
> > Copyright (C) 2001-2015 by Ludovic Rousseau <[hidden email]>.
> > Copyright (C) 2003-2004 by Damien Sauveron <[hidden email]>.
> > Report bugs to <[hidden email]>.
> > Enabled features: Linux x86_64-pc-linux-gnu serial usb libudev
> > usbdropdir=/
> > usr/local/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/usr/local/etc/
> > reader.conf.d
> >
> > $ uname -a
> > Linux HP036 4.10.0-rc6-amd64 #1 SMP Debian 4.10~rc6-1~exp2 (2017-02-02)
> > x86_64 GNU/Linux
> >
> > The attached mr800-usb.txt is the output of lsusb -v -d 03eb:6120 > mr800-
> > usb.txt
> >
> > The attache mr800.log is the output from
> >
> > export LIBCCID_ifdLogLevel=0x000F
> > sudo /home/emisys/pcsc/src/pcscd --apdu --foreground --debug --color 2>&1
> > |
> > tee mr800.log
> >
> > I took the liberty of adding a couple messages to try to understand what
> > is
> > happening. I also added the VID/PID/name to Info.plist to get that far.
> > The
> > name I entered in Info.plist is the name reported by the Windows SC API.
> >
> > The full reader reference is MR800UC-V as per the label.
> >
> > Could you please give me some guidance as to how to make that reader work
> > with pcsc-lite?
> >
> > PS: I do speak French if you need to contact me off-list.
> >
> > Thanks,
> >
> > Frédéric

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle

mr800-T0.txt (15K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Jinmuyu MR800 card reader problem

Ludovic Rousseau
Hello,

2017-06-11 11:58 GMT+02:00 Frédéric Marchal <[hidden email]>:
One last message for today :-)

I got it working. The MR800 claims to be compatible with protocol T1 but it
isn't. If I select protocol T0 from my application, I can communicate with the
reader (see mr800-T0.txt).

Now, how to fix this properly to make it work out of the box with pcsc is
beyond me. I'm available to test any solution you propose.

The first step for a not yet supported CCID device is to follow http://pcsclite.alioth.debian.org/ccid.html#CCID_compliant

Bye

--
 Dr. Ludovic Rousseau

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: Jinmuyu MR800 card reader problem

Frédéric Marchal
On dimanche 11 juin 2017 15 h 58 min 18 s CEST Ludovic Rousseau wrote:
> Hello,
>
> The first step for a not yet supported CCID device is to follow
> http://pcsclite.alioth.debian.org/ccid.html#CCID_compliant

The requested output.txt file is attached to this e-mail.

The manufacturer web site is http://www.jinmuyu.com/hf-smart-readers/
mr800.html

The technical documentation is here: http://www.jinmuyu.com/download/JINMUYU
%20Compatible%20USB%20PCSC%20IC%20Card%20Reader%20General%20Technical
%20Manual.pdf (in bad English and the documentation is lacking).

The pictures on the manufacturer site are accurate.

Please let me know if you need additional information.

Thanks for your support

Frédéric

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle

output.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Jinmuyu MR800 card reader problem

Ludovic Rousseau
2017-06-12 6:33 GMT+02:00 Frédéric Marchal <[hidden email]>:
The requested output.txt file is attached to this e-mail.

The reader indicates it has 2 slots:
  bMaxSlotIndex: 0x01

From what you wrote earlier I guess it is wrong and the reader can only use 1 smart card. Exact?
 

The manufacturer web site is http://www.jinmuyu.com/hf-smart-readers/
mr800.html

The URL was wrapped in your email.
works for me.



The technical documentation is here: http://www.jinmuyu.com/download/JINMUYU
%20Compatible%20USB%20PCSC%20IC%20Card%20Reader%20General%20Technical

%20Manual.pdf (in bad English and the documentation is lacking).

The pictures on the manufacturer site are accurate.

Please let me know if you need additional information.


I don't think the problem is that the reader does not support T=1 communication.
In your second email the error occurred when the driver tried to negotiate IFSD:
00000135 ifdhandler.c:1089:IFDHSetProtocolParameters() Negotiate IFSD at 254
00000123 sending: 00 C1 01 FE 3E
00000143 -> 000000 6F 05 00 00 00 00 2D 00 00 00 00 C1 01 FE 3E
00009549 <- 000000 80 02 00 00 00 00 2D 00 00 00 FF FF
00000026 received: FF FF
00000011 sending: 00 C1 01 FE 3E
00000011 -> 000000 6F 05 00 00 00 00 2E 00 00 00 00 C1 01 FE 3E
00008298 <- 000000 80 02 00 00 00 00 2E 00 00 00 FF FF
00000043 received: FF FF
00000021 sending: 00 C1 01 FE 3E
00000023 -> 000000 6F 05 00 00 00 00 2F 00 00 00 00 C1 01 FE 3E
00008344 <- 000000 80 02 00 00 00 00 2F 00 00 00 FF FF
00000064 received: FF FF
00000033 prothandler.c:124:PHSetProtocol() PTS failed (612), using T=0

I guess the USB CCID descriptor has other problems (in dwFeatures), not just the value bMaxSlotIndex.

I will add this reader in the "Disabled CCID readers" list for now.

Bye

--
 Dr. Ludovic Rousseau

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: Jinmuyu MR800 card reader problem

Ludovic Rousseau

2017-06-12 9:15 GMT+02:00 Ludovic Rousseau <[hidden email]>:
I guess the USB CCID descriptor has other problems (in dwFeatures), not just the value bMaxSlotIndex.

I will add this reader in the "Disabled CCID readers" list for now.
If you can make it work and provide a "correct" patch I may move the reader in another list.

Bye

--
 Dr. Ludovic Rousseau

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: Jinmuyu MR800 card reader problem

Frédéric Marchal
In reply to this post by Ludovic Rousseau
On lundi 12 juin 2017 9 h 15 min 36 s CEST Ludovic Rousseau wrote:
> 2017-06-12 6:33 GMT+02:00 Frédéric Marchal <[hidden email]>:
> > The requested output.txt file is attached to this e-mail.
>
> The reader indicates it has 2 slots:
>   bMaxSlotIndex: 0x01
>
> From what you wrote earlier I guess it is wrong and the reader can only use
> 1 smart card. Exact?

The reader can read one RFID card but it has two internal slots for SAM cards.
Does that account for the second reported slot?


> > The technical documentation is here: http://www.jinmuyu.com/
> > download/JINMUYU
> > %20Compatible%20USB%20PCSC%20IC%20Card%20Reader%20General%20Technical
> > <http://www.jinmuyu.com/download/JINMUYU%0A%20Compatible%20USB%20PCSC%20IC
> > %20Card%20Reader%20General%20Technical> %20Manual.pdf (in bad English and
> > the documentation is lacking).
> >
> > The pictures on the manufacturer site are accurate.
> >
> > Please let me know if you need additional information.
>
> I don't think the problem is that the reader does not support T=1
> communication.
> In your second email the error occurred when the driver tried to negotiate
> IFSD:
> 00000135 ifdhandler.c:1089:IFDHSetProtocolParameters() Negotiate IFSD at 254
> 00000123 sending: 00 C1 01 FE 3E
> 00000143 -> 000000 6F 05 00 00 00 00 2D 00 00 00 00 C1 01 FE 3E
> 00009549 <- 000000 80 02 00 00 00 00 2D 00 00 00 FF FF
> 00000026 received: FF FF
> 00000011 sending: 00 C1 01 FE 3E
> 00000011 -> 000000 6F 05 00 00 00 00 2E 00 00 00 00 C1 01 FE 3E
> 00008298 <- 000000 80 02 00 00 00 00 2E 00 00 00 FF FF
> 00000043 received: FF FF
> 00000021 sending: 00 C1 01 FE 3E
> 00000023 -> 000000 6F 05 00 00 00 00 2F 00 00 00 00 C1 01 FE 3E
> 00008344 <- 000000 80 02 00 00 00 00 2F 00 00 00 FF FF
> 00000064 received: FF FF
> 00000033 prothandler.c:124:PHSetProtocol() PTS failed (612), using T=0
>
> I guess the USB CCID descriptor has other problems (in dwFeatures), not
> just the value bMaxSlotIndex.
>
> I will add this reader in the "Disabled CCID readers" list for now.

Windows can communicate with the MR800 without any additional driver so I
won't blame the reader at this stage.

I'll try to investigate and see if I can submit a patch.

Frédéric



_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: Jinmuyu MR800 card reader problem

Ludovic Rousseau


2017-06-14 5:22 GMT+02:00 Frédéric Marchal <[hidden email]>:
On lundi 12 juin 2017 9 h 15 min 36 s CEST Ludovic Rousseau wrote:
> 2017-06-12 6:33 GMT+02:00 Frédéric Marchal <[hidden email]>:
> > The requested output.txt file is attached to this e-mail.
>
> The reader indicates it has 2 slots:
>   bMaxSlotIndex: 0x01
>
> From what you wrote earlier I guess it is wrong and the reader can only use
> 1 smart card. Exact?

The reader can read one RFID card but it has two internal slots for SAM cards.
Does that account for the second reported slot?

Yes.
The reader could even reports 3 slots then.

> I guess the USB CCID descriptor has other problems (in dwFeatures), not
> just the value bMaxSlotIndex.
>
> I will add this reader in the "Disabled CCID readers" list for now.

Windows can communicate with the MR800 without any additional driver so I
won't blame the reader at this stage.

The windows CCID driver is not CCID conformance validation tool :-)

I'll try to investigate and see if I can submit a patch.

OK

Bye

--
 Dr. Ludovic Rousseau

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle