Flash SIM card fails with ./pySim-prog.py

I have an issue using pysim.

My OS is Ubuntu 18.04.

I did below:

sudo apt-get install pcscd pcsc-tools libccid libpcsclite-dev python-pyscard

then ‘pcsc_scan’ and ‘./pySim-read.py –p 0’ just work, and I found that it’s version v1.5.2.

but write SIM I got below error:

people said it’s related that the admin pin I give in below command is not correct, I change it to another value, and got similar error. I don’t think it’s the pin value.

support@S2600WFT:~/pysim$ python ./pySim-prog.py -p 0 -x 208 -y 93 -t sysmoUSIM-SJS1 -i 208930000000003 --op=8e27b6af0e692e750f32667a3b14605d -k 8baf473f2f8fd09487cccbd7097c6862 -s 8988211000000088313 -a 23605945
Using PC/SC reader interface
Ready for Programming: Insert card now (or CTRL-C to cancel)
Generated card parameters :

Name : Magic
SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000
ICCID : 8988211000000088313
MCC/MNC : 208/93
IMSI : 208930000000003
Ki : 8baf473f2f8fd09487cccbd7097c6862
OPC : b9912fce303952b8e4af328992d3d497
ACC : None
ADM1(hex): 3233363035393435
Programming …

Card programming failed with an execption:
Traceback (most recent call last):
File “./pySim-prog.py”, line 719, in
rc = process_card(opts, first, card_handler)
File “./pySim-prog.py”, line 671, in process_card
File “/home/support/pysim/pySim/cards.py”, line 713, in program
self._scc.verify_chv(0x0A, h2b(p[‘pin_adm’]))
File “/home/support/pysim/pySim/commands.py”, line 206, in verify_chv
return self._tp.send_apdu_checksw(self.cla_byte + ‘2000’ + (’%02X’ % chv_no) + ‘08’ + fc)
File “/home/support/pysim/pySim/transport/init.py”, line 104, 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 63c9.

Programming failed: Remove card from reader

Does it due to that my pcsc_scan is v1.5.2 which is too old ( 3 years ago)?

Then I find your latest pcsc_scan version at ‘https://github.com/LudovicRousseau/pcsc-tools’, and from ‘http://ludovic.rousseau.free.fr/softwares/pcsc-tools/’ I download the latest version v1.5.7.

as below:

But I don’t know how to upgrade my pcsc_scan to v1.5.7.

Would you pls help?