pysim-read errors

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

devifr devifr at gmail.com
Mon Jan 7 00:19:32 UTC 2019


Domi,

Thanks for the reply.  Yeah, I saw the options in the help; however,
the help didn't have any values...specifically for the p option.
Regardless, the -p option with 0 was the fix.  Thank you much.

Derek

On Wed, Jan 2, 2019 at 5:37 PM Tomcsányi, Domonkos <domi at tomcsanyi.net> wrote:
>
> Hi Derek,
>
> Please see the help included in the program you mentioned, it answers your question.
> You need the -p option with the correct number (usually 0 if you only have one reader connected) to use PCSC.
>
> Cheers,
> Domi
>
>
> 2019. jan. 2. dátummal, 21:26 időpontban devifr <devifr at gmail.com> írta:
>
> > All,
> >
> > I have the following error when I run pySim-read.py:
> >
> > Traceback (most recent call last):
> >
> >  File "pySim-read.py", line 86, in <module>
> >     sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate)
> >
> >  File "/home/macbook/Desktop/pyscard-1.9.7/pysim/pySim/transport/serial.py",
> > line 45, in __init__
> >
> >    baudrate = baudrate,
> >
> >  File "/home/macbook/.local/lib/python2.7/site-packages/serial/serialutil.py",
> > line 240, in __init__
> >
> >    self.open()
> >
> >  File "/home/macbook/.local/lib/python2.7/site-packages/serial/serialposix.py",
> > line 268, in open
> >
> >    raise SerialException(msg.errno, "could not open port {}:
> > {}".format(self._port, msg))
> >
> > serial.serialutil.SerialException: [Errno 2] could not open port
> > /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
> >
> > Exception AttributeError: "'SerialSimLink' object has no attribute
> > '_sl'" in <bound method SerialSimLink.__del__ of
> > <pySim.transport.serial.SerialSimLink object at 0x7ff879094d10>>
> > ignored
> >
> > I'm no Linux and/or Python guru but from what I can gather is that
> > it's having issues with identifying the card reader on dev/ttyUSB0.
> > To address that issue, I've confirmed my current card reader (identiv
> > SCR3310) is working when I've ran the pcsc_scan script:
> >
> > PC/SC device scanner
> >
> > V 1.5.2 (c) 2001-2017, Ludovic Rousseau <ludovic.rousseau at free.fr>
> >
> > Using reader plug'n play mechanism
> >
> > Scanning present readers...
> >
> > 0: SCR3310 Smart Card Reader [CCID Interface] (53311828708432) 00 00
> >
> >
> >
> > Wed Jan  2 12:02:36 2019
> >
> > Reader 0: SCR3310 Smart Card Reader [CCID Interface] (53311828708432) 00 00
> >
> >  Card state: Card inserted,
> >
> >  ATR: 3B 9F 95 80 1F C3 80 31 E0 73 FE 21 13 57 86 81 02 86 98 44 18 A8
> >
> >
> > ATR: 3B 9F 95 80 1F C3 80 31 E0 73 FE 21 13 57 86 81 02 86 98 44 18 A8
> >
> > + TS = 3B --> Direct Convention
> >
> > + T0 = 9F, Y(1): 1001, K: 15 (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
> >
> >  TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0
> >
> > -----
> >
> >  TD(2) = 1F --> Y(i+1) = 0001, Protocol T = 15 - Global interface
> > bytes following
> >
> > -----
> >
> >  TA(3) = C3 --> Clock stop: no preference - Class accepted by the
> > card: (3G) A 5V B 3V
> >
> > + Historical bytes: 80 31 E0 73 FE 21 13 57 86 81 02 86 98 44 18
> >
> >  Category indicator byte: 80 (compact TLV data object)
> >
> >    Tag: 3, len: 1 (card service data byte)
> >
> >      Card service data byte: E0
> >
> >        - Application selection: by full DF name
> >
> >        - Application selection: by partial DF name
> >
> >        - BER-TLV data objects available in EF.DIR
> >
> >        - EF.DIR and EF.ATR access services: by GET RECORD(s) command
> >
> >        - Card with MF
> >
> >    Tag: 7, len: 3 (card capabilities)
> >
> >      Selection methods: FE
> >
> >        - DF selection by full DF name
> >
> >        - DF selection by partial DF name
> >
> >        - DF selection by path
> >
> >        - DF selection by file identifier
> >
> >        - Implicit DF selection
> >
> >        - Short EF identifier supported
> >
> >        - Record number supported
> >
> >      Data coding byte: 21
> >
> >        - Behaviour of write functions: proprietary
> >
> >        - Value 'FF' for the first byte of BER-TLV tag fields: invalid
> >
> >        - Data unit in quartets: 2
> >
> >      Command chaining, length fields and logical channels: 13
> >
> >        - Logical channel number assignment: by the card
> >
> >        - Maximum number of logical channels: 4
> >
> >    Tag: 5, len: 7 (card issuer's data)
> >
> >      Card issuer data: 86 81 02 86 98 44 18
> >
> > + TCK = A8 (correct checksum)
> >
> >
> > Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
> >
> > 3B 9F 95 80 1F C3 80 31 E0 73 FE 21 13 57 86 81 02 86 98 44 18 A8
> >
> > GREEN CARD, Grcard (Hong Kong ) Co.,Limited, LTE Usim Card (Telecommunication)
> >
> > Celcom Postpaid 3G (Telecommunication)
> >
> > Additionally, I've ran the following command (dmesg | tail -6)  to
> > determine what path my card reader is mounted to:
> >
> > macbook at ubuntu:~/Desktop/pyscard-1.9.7/pysim$ dmesg | tail -n 6
> >
> > [ 7079.120203] usb 3-3.1: new full-speed USB device number 6 using xhci_hcd
> >
> > [ 7079.223962] usb 3-3.1: New USB device found, idVendor=04e6, idProduct=5116
> >
> > [ 7079.223965] usb 3-3.1: New USB device strings: Mfr=1, Product=2,
> > SerialNumber=5
> >
> > [ 7079.223968] usb 3-3.1: Product: SCR33xx v2.0 USB SC Reader
> >
> > [ 7079.223969] usb 3-3.1: Manufacturer: Identive
> >
> > [ 7079.223971] usb 3-3.1: SerialNumber: 53311828708432
> >
> > My questions are this, is there a known work around for this errors
> > that I've posted above?  Also, if my card is not mounting to
> > dev/ttyUSB0, where do they mount to?  I've looked in /mnt, /media as
> > well as /dev....no joy.  I've searched the Open BSC archives as well
> > as scoured the web for an answer to this issue and I'm coming up
> > blank.  One last thing, I've ran this python script on an Ubuntu VM
> > and Dual Boot.  Same issue both machines.  I've also tried this script
> > with an Alcor card reader.  Same output.  Any help is greatly
> > appreciated.
> >
> > Thanks,
> > Derek



More information about the OpenBSC mailing list