Menu

sysmoUSIM-SJS1 : SW match failed

Chris
2015-08-25
2019-01-30
  • Chris

    Chris - 2015-08-25

    Hello,

    I'm having some trouble with pySim and I was wondering if anyone here has come across this and can help. Installations were all fine and I'm able to read the contents of the sim however problems occur when i try to write to it. I'm using sysmoUSIM-SJS1. When i do a pcsc_scan this is recognised correctly. I checked out the answer David gave to another thread and used that as the basis for my pySim command.

    Here's a copy of the terminal:

    ./pySim-prog.py -p 0 -t "sysmoUSIM-SJS1" -i 901700000005800 -s 8988211000000058001 --op=11111111111111111111111111111111 -k 5F9B8DC040A6C7C1B176BA94291CE746 -a 88865359

    Inset card now
    Generated card params
    Name: Magic
    SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000
    ICCID: 8988211000000058001
    MCC/MNC : 901/55
    IMSI: 901700000005800
    KI: 5F9B8DC040A6C7C1B176BA94291CE746
    OPC: 975e903d6b04b96b454ee7b08f7099dd
    ACC: none

    Programming....

    Trace back(most recent call last):
    File "./pySim-prog.py",Line626,in <module>
    card.program(cp)
    File "/home/Chris/pyscard-1.7.0/pysim/pySim/cards" line 438, in program
    r = self._scc.select_file(['3f00'])
    File "/home/Chris/pyscard-1.7.0/pysim/pySim/commands" line 44, in select_file
    data,sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000002" + i)
    File "/home/Chris/pyscard-1.7.0/pysim/pySim/transport/init.py" line 87, in send apdu_checksw
    raise RuntimeError("SW match failed! Expected %s and got %s."(sw.lover(),rv[1]))
    Runtime error; SW match failed! Expected 9000 and got 6a86

    Thanks for your help.
    Chris

    p.s. initialy i thought it might be because the main branch of pySim only included SJS1 since about five days ago so i tried the zecke/tmp branch but there was no difference

     
  • Chris

    Chris - 2015-08-29

    Hi, I solved my problem, just though i would add some stuff for future reference.

    I read using the pySim main branch but have to write using zecke/tmp. I can't seem to get the latest pull from git to fully work, but that's another days job!

    for the sysmoUSIM-SJS1 it is the ADM1 key that you need, not the PIN or the PUK. When I contacted sysmocom for this they were very helpful and provided the data for all the sims I bought.

     
  • An Zou

    An Zou - 2015-08-30

    Hi, I came across the same problem with you. May I know how you solved this problem?

     
  • Vinh Pham

    Vinh Pham - 2015-09-01

    Please share how you solved the problem.

    Thx

     
  • Vinh Pham

    Vinh Pham - 2015-09-02

    Hi.

    I just tried to program my sysmoUSIM-SJS1 card, using the zecke/tmp branch. Also used the ADM1 pin. However, the result was an exception as shown below.

    The same occured using the main branch.

    Anyone knows how to solve this please let me know.

    Regards

    Pham

    vph@hp-jmh:~/tmp/zecke/tmp$ ./pySim-prog.py -p 0 -t "sysmoUSIM-SJS1" -i 901700000005260 -s 8988211000000052608 --op=11111111111111111111111111111111 -k 917ED4EAF3A8A78E320666D45673244C -a 98079187
    Insert card now (or CTRL-C to cancel)
    Generated card parameters :

    Name : Magic
    SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000
    ICCID : 8988211000000052608
    MCC/MNC : 901/55
    IMSI : 901700000005260
    Ki : 917ED4EAF3A8A78E320666D45673244C
    OPC : 441bf488ae223829d4a057f6d652f666
    ACC : None

    Programming ...

    Traceback (most recent call last):
    File "./pySim-prog.py", line 626, in <module>
    card.program(cp)
    File "/home/vph/tmp/zecke/tmp/pySim/cards.py", line 438, in program
    r = self._scc.select_file(['3f00'])
    File "/home/vph/tmp/zecke/tmp/pySim/commands.py", line 44, in select_file
    data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000002" + i)
    File "/home/vph/tmp/zecke/tmp/pySim/transport/init.py", line 87, in send_apdu_checksw
    raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1]))
    RuntimeError: SW match failed ! Expected 9000 and got 6a86.
    vph@hp-jmh:~/tmp/zecke/tmp$

     

    Last edit: Vinh Pham 2015-09-02
  • Thomas Valerrian Pasca

    Hi,
    I have also tried programming SysmoUSIM-SJS1 with gemalto K-30 sim card programmer. I have got the same error. I checked both main branch and zecke/tmp but I could not make it programming, Throwing same software match failed.

    Could any one help me in this regard.

    thomas@thomas-Satellite-Pro-B40-A:~/Downloads/SIMCARD/pysim-zecke$ ./pySim-prog.py -p 0 -t sysmoUSIM-SJS1 -i 208920101000005 -s 8901001010000000001 -x 208 -y 92 --op=11111111111111111111111111111111 -k 8BAF473F2F8FD09487CCCBD7097C6862 -a 15640342
    Insert card now (or CTRL-C to cancel)
    Generated card parameters :

    Name : Magic
    SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000
    ICCID : 8901001010000000001
    MCC/MNC : 208/92
    IMSI : 208920101000005
    Ki : 8BAF473F2F8FD09487CCCBD7097C6862
    OPC : 8e27b6af0e692e750f32667a3b14605d
    ACC : None

    Programming ...
    Traceback (most recent call last):
    File "./pySim-prog.py", line 626, in <module>
    card.program(cp)
    File "/home/thomas/Downloads/SIMCARD/pysim-zecke/pySim/cards.py", line 447, in program
    self._scc.verify_chv(0x0A, h2b(p['pin_adm']))
    File "/home/thomas/Downloads/SIMCARD/pysim-zecke/pySim/commands.py", line 104, in verify_chv
    return self._tp.send_apdu_checksw(self.cla_byte + '2000' + ('%02X' % chv_no) + '08' + fc)
    File "/home/thomas/Downloads/SIMCARD/pysim-zecke/pySim/transport/init.py", line 87, in send_apdu_checksw
    raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1]))

     
  • Vinh Pham

    Vinh Pham - 2015-11-02

    Try mitshell framework: https://github.com/mitshell/card

    This framework is very well written!

     
  • Karl

    Karl - 2015-11-09

    I have the same problem.
    Does anybody have a solution yet?

     
  • Eu iulian

    Eu iulian - 2016-06-22

    I got the same issue this device :
    Bus 002 Device 004: ID 04e6:5116 SCM Microsystems, Inc. SCR331-LC1 / SCR3310 SmartCard Reader

    When I try to read using the latest from git://git.osmocom.org/pysim master branch I get

    Reading ...
    Traceback (most recent call last):
    File "pySim-read.py", line 90, in <module>
    (res, sw) = scc.read_binary(['3f00', '2fe2'])
    File "/openet/wifi/pysim/pysim/pySim/commands.py", line 51, in read_binary
    r = self.select_file(ef)
    File "/openet/wifi/pysim/pysim/pySim/commands.py", line 44, in select_file
    data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000C02" + i)
    File "/openet/wifi/pysim/pysim/pySim/transport/init.py", line 87, in send_apdu_checksw
    raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1]))
    RuntimeError: SW match failed ! Expected 9000 and got 6b00.

    Pycard is version pyscard-1.9.4

    " Expected 9000 and got 6b00" means Wrong parameters P1-P2 according with http://javacard.vetilles.com/2006/09/26/status-words-in-iso7816/

    The sim card I plug in nano-sim of SCR3310 is a orange one sysmoUSIM-SJS1 http://www.sysmocom.de/products/sysmousim-sjs1-sim-usim/

    Any help higly appreciated

     
    • Mathias Strufe

      Mathias Strufe - 2016-06-22

      Hello julian,

      I have exactly the same problem today, I use the gemalto K30 ... and got the same error when I try to read my private SIM card :/ Im at the same stage and I dont know what parameter P1, P2 is?! I have the same version of pyscard: 1.9.4 ...

      Any ideas? Thank you!
      :)

       
      • Mathias Strufe

        Mathias Strufe - 2016-06-23

        morning,
        ok I got it managed now with an older version ... (pysim73b686...86d1.zip is working for me) it seems there have been some changes in the send_adpu_checksw which may causes the problem ...
        Have a nice day ...

         
  • Eu iulian

    Eu iulian - 2016-06-23

    Hi Mathias,

    Could you please help me with a reference to the version that is working ? Is on git ?

    I solved the issue in my case by replacing pySim/commands.py
    #data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000C02" + i)
    data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000002" + i)
    Best regards,
    Iulian

     

    Last edit: Eu iulian 2016-06-23
  • Julian E. Morales Ortega

    Hello
    I have the same problem when I try to schedule a SIM card....

    Programming ...
    Traceback (most recent call last):
    File "./pySim-prog.py", line 558, in <module>
    card.program(cp)
    File "/home/openlte/pysim/pySim/cards.py", line 438, in program
    r = self._scc.select_file(['3f00'])
    File "/home/openlte/pysim/pySim/commands.py", line 44, in select_file
    data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000002" + i)
    File "/home/openlte/pysim/pySim/transport/init.py", line 87, in send_apdu_checksw
    raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1]))
    RuntimeError: SW match failed ! Expected 9000 and got 6a86.

    someone knows how I can fix it?, help me please!!!
    Best regards.
    Julian M

     
  • Giselle González

    Hello

    I have pretty much the same problem reading the SIMs...

    I´m using sysmoUSIM-SJS1, plugged with the gemalto K30

    when I try to read the SIM card using PySIM with the command "./pySim-read.py -p 0" i get the error "SW match failed! Exected 9000 and got 6b00"

    I have tryed doing it with the version 1.9.4 of PySIM, and then I read above that an older version could solve the problem so I tryed 1.7.0 but got the same result.

    Can someone tell me what specific version works?

    Is there any other suggestion to solve my problem?

    Best regards

    Giselle Glez

     
  • Balwinder S Dheeman

    BE WARNED: The Sysmcom.de people are rough and narrow minded. They are rude on asking technical support for OpenBTS, OpenBSC, YateBTS and OpenLTE; treat these open source projects as competitors :-(

    That's a real personal experiance, I bought sysmoUSIM-SJS1 a few days ago; they intentional did not reply what I had been asking for, but pretended to cooperative; otherwise.

    I therefore, am alerting all of you for not to buy and, or use their products and third class after sales/support services. I'm quoting 2 recent replies from Harald Welte:

    We are unable to support you with questions related to third-party software
    such as YateBTS. Please contact the software supplier for assistance on ho to
    enroll/configure subscribers there. We have never used related software and can
    not comment on how it needs to be configured for our sysmoUSIM-SJS1 sim cards.

    All related technical details about our cards can be found in the
    sysmoUSIM-SJS1 user manual.

    --
    Harald Welte

    We sell our sysmoUSIM cards primarily for the customers of our own BTS
    and small network products such as sysmoBTS and sysmoNITB/IP.

    If you chose to use a competitor product, that is of course your free
    choice, and we are (believe it or not) happy with that.

    But we absolutely cannot support you with issues of any product that we
    have never even seen. Until your e-mail I didn't even know that YateBTS
    contained some explicit/specific support for our cards.

    If you should find any malfunction or defect in our cards, we are happy
    to assist you. But your question is about the YateBTS software.

    --
    Harald Welte

     

    Last edit: Balwinder S Dheeman 2017-04-19
  • Dominic Antony

    Dominic Antony - 2019-01-10

    Hi Guys

    Webshop of Sysmocom is under certain maintenance and is likely to be remained closed for an indefinite period. Could someone please suggest an alternate source to purchase sysmousim or an alternate to sysmousim that could be used along with OpenLTE?

    Thanks

     
  • Dominic Antony

    Dominic Antony - 2019-01-10

    In case if I am going for completely blank SIM, what all are the parameters manadatorily needs to be written into the SIM to make it work with OpenLTE? Also, what all parameters are expected to come along with the SIM?
    How about ICCID, OPC and ADM1? Are these required to successfully run with OpenLTE or will just MCC, MNC, IMSI and Ki be enough?

     

    Last edit: Dominic Antony 2019-01-10
  • Pardeep Goyal

    Pardeep Goyal - 2019-01-30

    1) Milenage supported sim is required.
    2) MCC, MNC, IMSI and K should be enough.

    3) But OP should match what is hardcoded in the code. (or else you have to change in the code and recompile it). I guess it should be made as a configurable option along with IMSI (when we add subscribers)
    Current hard coded value for OP:

    static const uint8 OP[16] = {0x63,0xBF,0xA5,0x0E,0xE6,0x52,0x33,0x65,0xFF,0x14,0xC1,0xF4,0x5F,0x88,0x73,0x7D}

     

Log in to post a comment.