roeften / pypassport

Fork of pypassport for python3
GNU Lesser General Public License v3.0
18 stars 12 forks source link

Card Reader is not connect to PCSC #3

Open kokoye2007 opened 3 years ago

kokoye2007 commented 3 years ago

Dear roeften

I am testing on pypassport for python3

I got error

Type "help", "copyright", "credits" or "license" for more information.
>>> from pypassport.reader import ReaderManager
>>> from pypassport.epassport import EPassport, mrz
>>> r = ReaderManager()
>>> reader = r.waitForCard()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/scott/pypassport/pypassport/reader.py", line 368, in waitForCard
    raise TimeOutException("Time-out")
pypassport.reader.TimeOutException: Time-out

but PCSC is detect to card

pypassport$ pcsc_scan 
Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR122U 00 00

Sun Jul 18 07:57:22 2021
 Reader 0: ACS ACR122U 00 00
  Event number: 0
  Card state: Card inserted, 
  ATR: 3B 8C 80 01 50 49 7A 51 77 E1 F3 5E 11 77 81 A5 46

ATR: 3B 8C 80 01 50 49 7A 51 77 E1 F3 5E 11 77 81 A5 46
+ TS = 3B --> Direct Convention
+ T0 = 8C, Y(1): 1000, K: 12 (historical bytes)
  TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0 
-----
  TD(2) = 01 --> Y(i+1) = 0000, Protocol T = 1 
-----
+ Historical bytes: 50 49 7A 51 77 E1 F3 5E 11 77 81 A5
  Category indicator byte: 50 (proprietary format)
+ TCK = 46 (correct checksum)

Possibly identified card (using /home/scott/.cache/smartcard_list.txt):
    NONE

Your card is not present in the database.
Please submit your unknown card at:
https://smartcard-atr.apdu.fr/parse?ATR=3B8C800150497A5177E1F35E117781A546

I think MRZ is difference country or passport book and card ? My US Passport is difference with your demo.

#MRZ_bob       = "EH123456<0BEL8510035M1508075<<<<<<<<<<<<<<02"
#MRZ_oli       = "EH276509<0BEL8406158M1302217<<<<<<<<<<<<<<04"
#MRZ_helen     = "EF486766<8BEL8803023F1103056<<<<<<<<<<<<<<00"
#MRZ_fred      = "EG491433<0BEL8305099M1208157<<<<<<<<<<<<<<04"
#MRZ_camille   = "08CH022724FRA8706021F1807066<<<<<<<<<<<<<<06"
#MRZ_nico      = "EH288866<9BEL8605113M1303269<<<<<<<<<<<<<<00"
#MRZ_caro      = "EH266828<7BEL8405243F1302206<<<<<<<<<<<<<<02"
#MRZ_n =         "7065198411GBR9703072M1206256<<<<<<<<<<<<<<02"

#Remplire la 2e ligne ici

Please suggest or anything else. BR

roeften commented 3 years ago

Can you try to check what ReaderManager.getReaderList() returns?

It looks like a reader issue so before the MRZ is even used

kokoye2007 commented 3 years ago
Python 3.9.5 (default, May 11 2021, 08:20:37) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pypassport.reader import ReaderManager
>>> from pypassport.epassport import EPassport, mrz
>>> r = ReaderManager()
>>> reader = r.waitForCard()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/py/pypassport/pypassport/reader.py", line 368, in waitForCard
    raise TimeOutException("Time-out")
pypassport.reader.TimeOutException: Time-out
>>> ReaderManager.getReaderList()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: getReaderList() missing 1 required positional argument: 'self'
>>> 

Devices is ACR122 -> ACR122U-A9

Bus 002 Device 011: ID 072f:2200 Advanced Card Systems, Ltd ACR122U