Hello! I tried searching the mailing list to see if anyone else has had this issue, but I didn't find anything relevant.
Explanation: I am trying to install my java applets to an older sysmoISIM-SJA2 card with the "SELECTABLE" and "DEFAULT" privilges/flags. The reason being that I need my applets to auto select itself rather than manual interaction through the SIM Toolkit menu. Currently, I am using the shadysim-isim tool to load my applets, however, there is no option to make applets defaultSelect. And, it doesn't look like pySim supports this currently either. GlobalProtectPro (gp.jar) does have support for these cmds, but it looks like they need addtional parameters specific to the SJA2 when installing.
Does anyone know what the exact parameters needed are? Someone else noted this issue under the GlobalProtectPro repo - but I'm not really knowledgeable enough to understand what was said.
Link to the issue: https://github.com/martinpaljak/GlobalPlatformPro/issues/293
Link to their solution: https://github.com/martinpaljak/GlobalPlatformPro/issues/293#issuecomment-1…
Thanks!
Hello,
I have a functioning setup of remsim as follow:
* An x86 server that hosts a sysmoOCTSIM board. This server runs the bank daemon and also the remsim server.
* An ARM64 client that hosts a SIMtrace2 board, and a 5G modem with two SIM inputs to support dual SIM single standby (DSSS). The SIMtrace2 connects to SIM slot 0 on the 5G modem via a flexi.
* I use the remsim-apitool to create the slot map and assign SIMs to the client using the server IP, bank ID and client ID. Client slot is always 0.
I’d like to allocate two SIMs in the bank to this one client using only one ATSAM4S microcontroller to utilise the DSSS function of the modem e.g. SIM slot 1 in the bank is mapped to SIM slot 0 on the 5G modem for client ID 1. SIM slot 2 in the bank is mapped to SIM slot 1 on the same 5G modem for client ID 1. Is this possible with the current implementation of remsim? I cannot find any reference to this in the archives or in the manuals.
Thanks
The contents of this e-mail are confidential and for the exclusive use of the intended recipient. If you are not the intended recipient you should not read, copy, retransmit or disclose its contents. If you have received this email in error please delete it from your system immediately and notify us either by email or telephone. The views expressed in this communication may not necessarily be the views held by McLaren Applied Limited.
Dukes Court, Block E, Duke Street, Woking, GU21 5BH, United Kingdom Company Number: 02322992
hi ,
1, if the SIM card attached to the product can be set up in China real-name APN to access the Internet?
2, ngff-cardem 5G module China Unicom SIM card, how to set to identify SIM?
赵余滨
+86 17621901212 | zhaoyubin(a)yoocar.com.cn
上海优咔网络科技有限公司
地址:上海市徐汇区龙耀路175号星扬西岸中心38楼
重要提示:此邮件及附件具保密性质,包含商业秘密、受法律保护不得泄露。
IMPORTANT NOTE: This email and any attachment are confidential and may contain trade secrets and may also be legally privileged or otherwise protected from disclosure.
Hi Team,
I am getting the following error while running the pySim-read.py , This
program runs fine on old SIM cards but in new SIM cards it gives the below
error.
I did a comparison of directories on both the SIM cards and there is a
difference, Kindly guide how to fix it . Although EF.ICCID exists in both
the SIM cards .
Additionally pySim-shell.py works well .
python3 pySim-read.py -p 1
Using reader PCSC[HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21
Smart Card Reader] 01 00]
Reading ...
Autodetection failed
Traceback (most recent call last):
File "/home/lab3/pysim/pySim-read.py", line 105, in <module>
(res, sw) = card.read_iccid()
File "/home/lab3/pysim/pySim/legacy/cards.py", line 62, in read_iccid
(res, sw) = self._scc.read_binary(EF['ICCID'])
File "/home/lab3/pysim/pySim/commands.py", line 320, in read_binary
r = self.select_path(ef)
File "/home/lab3/pysim/pySim/commands.py", line 285, in select_path
data, _sw = self.select_file(i)
File "/home/lab3/pysim/pySim/commands.py", line 296, in select_file
return self.send_apdu_checksw(self.cla_byte + "a4" + self.sel_ctrl +
"02" + fid)
File "/home/lab3/pysim/pySim/commands.py", line 143, in send_apdu_checksw
return self._tp.send_apdu_checksw(pdu, sw)
File "/home/lab3/pysim/pySim/transport/__init__.py", line 218, in
send_apdu_checksw
raise SwMatchError(rv[1], sw.lower(), self.sw_interpreter)
pySim.exceptions.SwMatchError: SW match failed! Expected 9000 and got 6e00.
BR//
Niraj Kumar
Good afternoon,
I am trying to verify the CHV2 verification on an Amarisoft Test SIM Card. With a HID OMNIKEY 3121.
I have issues with the CHV2 verification with the pySim software and amarisoft simcard.
I get the error below.
Can you please give me some hints on how to fix this issue as I have no idea of how to start.
Sincerely,
Valentin M.
pySIM-shell (00:MF)> verify_chv --pin-nr 1 1234
CHV verification successful
pySIM-shell (00:MF)> verify_chv --pin-nr 2 1234
EXCEPTION of type 'SwMatchError' occurred with message: SW match failed! Expected 9000 and got 6b00.
To enable full traceback, run the following command: 'set debug true'
pySIM-shell (00:MF)> set debug true
debug - was: False
now: True
pySIM-shell (00:MF)> verify_chv --pin-nr 2 1234
Traceback (most recent call last):
File "/home/keas/.local/lib/python3.10/site-packages/cmd2/cmd2.py", line 2399, in onecmd_plus_hooks
stop = self.onecmd(statement, add_to_history=add_to_history)
File "/home/keas/.local/lib/python3.10/site-packages/cmd2/cmd2.py", line 2852, in onecmd
stop = func(statement)
File "/home/keas/.local/lib/python3.10/site-packages/cmd2/decorators.py", line 382, in cmd_wrapper
return func(*args_list, **kwargs) # type: ignore[call-arg]
File "/home/keas/pysim/./pySim-shell.py", line 824, in do_verify_chv
(data, sw) = self._cmd.lchan.scc.verify_chv(opts.pin_nr, h2b(pin))
File "/home/keas/pysim/pySim/commands.py", line 693, in verify_chv
self._chv_process_sw('verify', chv_no, code, sw)
File "/home/keas/pysim/pySim/commands.py", line 682, in _chv_process_sw
raise SwMatchError(sw, '9000')
pySim.exceptions.SwMatchError: SW match failed! Expected 9000 and got 6b00.
EXCEPTION of type 'SwMatchError' occurred with message: SW match failed! Expected 9000 and got 6b00.
pySIM-shell (00:MF)>
Dear Engineer,
I have a few questions regarding simtrace2-cardem-pcsc that I would like to consult with you:
(1)、I am using simtrace2-cardem-pcsc to access a remote SIM card by connecting the SIMtrace2 board to a mobile terminal. When I use pcsc_scan, it shows that the card reader has opened the SIM card successfully, and the other end is also connected to the SIMtrace2 board correctly. However, there are no valid APDU commands being printed. Through simtrace2-tool, I only see some reset information.
(2)、I would like to connect the SIMTrace2 board to the soft SIM on my computer. Is there any related manual or documentation that could guide me through this process?
I would greatly appreciate any advice you can provide when you have time.
Thank you very much.
Best regards,
Peitao Jia
小葱
1256275333(a)qq.com
Hello,
I am trying to update EF.EHPLMN with around 20 PLMNs.
With edit_binary_decoded, I am able to add them successfully.
But I am trying to update them directly using update_binary_decoded command from from the pySim-shell prompt. But I am not working.
It would be really helpful if somebody could help me with it.
Below is the full list of commands that I tried.
Welcome to pySim-shell!
(C) 2021-2023 by Harald Welte, sysmocom - s.f.m.c. GmbH and contributors
Online manual available at https://downloads.osmocom.org/docs/pysim/master/html/shell.html
pySIM-shell (00:MF)> verify_adm 54815333
pySIM-shell (00:MF)> select ADF.USIM
{
"file_descriptor": {
"file_descriptor_byte": {
"shareable": true,
"file_type": "df",
"structure": "no_info_given"
},
"record_len": null,
"num_of_rec": null
},
"df_name": "a0000000871002ffffffff8907090000",
"proprietary_information": {
"uicc_characteristics": "71",
"available_memory": 96880
},
"life_cycle_status_integer": "operational_activated",
"security_attrib_compact": "00",
"pin_status_template_do": [
{
"ps_do": "70"
},
{
"key_reference": 1
},
{
"key_reference": 129
},
{
"key_reference": 10
},
{
"key_reference": 11
}
]
}
pySIM-shell (00:MF/ADF.USIM)> select EF.EHPLMN
{
"file_descriptor": {
"file_descriptor_byte": {
"shareable": true,
"file_type": "working_ef",
"structure": "transparent"
},
"record_len": null,
"num_of_rec": null
},
"file_identifier": "6fd9",
"proprietary_information": {
"unknown_ber_tlv_ie_d0": {
"raw": "20"
},
"toolkit_access_conditions": {
"rfm_create": true,
"rfm_delete_terminate": true,
"other_applet_create": true,
"other_applet_delete_terminate": true
}
},
"life_cycle_status_integer": "operational_activated",
"security_attrib_referenced": {
"ef_arr_file_id": "6f06",
"ef_arr_record_nr": 3
},
"file_size": 66,
"short_file_identifier": 29
}
pySIM-shell (00:MF/ADF.USIM/EF.EHPLMN)> read_binary_decoded
[
{
"mcc": "901",
"mnc": "70"
},
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
]
pySIM-shell (00:MF/ADF.USIM/EF.EHPLMN)> update_binary_decoded --json-path mcc 405
pySIM-shell (00:MF/ADF.USIM/EF.EHPLMN)> read_binary_decoded
[
{
"mcc": "901",
"mnc": "70"
},
null,
null,
null,
Thanks and Regards,
Dushyanth
Sent using {0}
============ Forwarded message ============
From: Harald Welte via RT <support(a)sysmocom.de>
To: <dushyanthm(a)zohomail.in>
Date: Mon, 20 May 2024 19:01:10 +0530
Subject: Re: [rt.sysmocom.de #74835] Help on pySim-shell-py
============ Forwarded message ============
Please contact the mailto:simtrace@lists.osmocom.org mailing list and copy+paste the full command and response of the non working example.
--
Sent from my mobile phone. Please excuse my brevity.
Hello,
I am having difficulty with a particular SIM card over osmo-remsim. On the bank daemon side, PCSC is timing out after 1 second on the same transaction (modemToCard: 81f2400202) after every reset. This behavior is very reliable and happens on every reset/initialization sequence from the modem. When I enable PCSC debugging, I see it is getting back the error CCID error 0xFE “Card absent or mute” from the CCID reader. When I use this card directly attached to the modem, everything is fine and the modem can go online (but I have no insight as to whether the modem is encountering an issue with the same APDU, or not).f
When this transaction error occurs, osmo-remsim-bankd closes the connection, leading to a removal/insertion and card reset event. So, the system is in infinite loop of resetting the card, making a bunch of successful APDU transactions, timing out on the offending transaction, and then resetting again all over again...
As an experiment, I changed osmo-remsim-bankd behavior to ignore the PCSC error, leave the connection open, and return a general error (0x6F 0x00) to the modem. When I do that, the modem periodically re-sends the offending APDU every few seconds, but, despite that, everything else is fine and the modem can now go online with this card over osmo-remsim. I’m thinking either card needs more time to answer this query, or perhaps it does not support this query at all.
Based on some earlier troubleshooting it appears to be related to eSIM (eUICC) functionality. This particular card reports as an eSIM (side note: curiously, its EID is blank). When I use old modem firmware that does not support eSIM capabilities, the card works just fine over osmo-remsim. It is only when I upgrade the modem firmware to a version that supports eSIM that this problem appears.
Other things I tried:
- Upgrading to latest libccid and pcsc-lite — no change
- Using a different card reader with different chip set — no change, and both are listed as “should be supported” by pcsc-lite.
A couple questions:
- Is there a way to change the timeout? I tried modifying libccid to set bBWI to 0xFF for this transaction (it was 0x00), but that had to effect. Internal timeouts within pcscd seem to be set to 3 seconds, and so I do not think they are coming into play, here.
- What are your feelings on having osmo-remsim-bankd ignore this error and return a 0x6f 0x00?
- Any other ideas?
Here is the truncated log of traffic leading up to the offending APDU:
local4.info: 2024-03-26 03:10:31.221037 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:793 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Tx RSPRO tpduCardToModem(621982054221001c0383026f408a01058b036f06058002005488009000)
local4.info: 2024-03-26 03:10:31.228286 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:766 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Rx RSPRO tpduModemToCard(00b208bc3e)
local4.info: 2024-03-26 03:10:31.242339 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:793 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Tx RSPRO tpduCardToModem(800101a40683010195010880015aa40683010a9501088401d4a40683010a950108ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9000)
local4.info: 2024-03-26 03:10:31.250619 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:766 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Rx RSPRO tpduModemToCard(00b205043e)
local4.info: 2024-03-26 03:10:31.255170 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:793 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Tx RSPRO tpduCardToModem(800103a406830101950108800158a40683010a9501088401d4a40683010a950108ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9000)
local4.info: 2024-03-26 03:10:31.263534 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:766 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Rx RSPRO tpduModemToCard(00b209043e)
local4.info: 2024-03-26 03:10:31.267873 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:793 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Tx RSPRO tpduCardToModem(800101a406830101950108800102a406830181950108800158a40683010a9501088401d4a40683010a950108ffffffffffffffffffffffffffffffffffff9000)
local4.info: 2024-03-26 03:10:31.276622 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:766 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Rx RSPRO tpduModemToCard(00b206043e)
local4.info: 2024-03-26 03:10:31.280369 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:793 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Tx RSPRO tpduCardToModem(8001019000800102a406830101950108800158a40683010a9501088401d4a40683010a950108ffffffffffffffffffffffffffffffffffffffffffffffff9000)
local4.info: 2024-03-26 03:10:31.288355 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:766 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Rx RSPRO tpduModemToCard(00b201043e)
local4.info: 2024-03-26 03:10:31.293560 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:793 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Tx RSPRO tpduCardToModem(800101900080015aa40683010a9501088401d4a40683010a950108ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9000)
local4.info: 2024-03-26 03:10:31.304765 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:766 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Rx RSPRO tpduModemToCard(00a40804047fff6fc6)
local4.info: 2024-03-26 03:10:31.312115 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:793 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Tx RSPRO tpduCardToModem(611c)
local4.info: 2024-03-26 03:10:31.316190 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:766 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Rx RSPRO tpduModemToCard(00c000001c)
local4.info: 2024-03-26 03:10:31.319163 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:793 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Tx RSPRO tpduCardToModem(621a8205422100080183026fc68a01058b036f0601800200088801d09000)
local4.info: 2024-03-26 03:10:31.328212 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:766 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Rx RSPRO tpduModemToCard(00a2010408ffffffffffffffff)
local4.info: 2024-03-26 03:10:31.330957 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:793 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Tx RSPRO tpduCardToModem(6282)
local4.info: 2024-03-26 03:10:31.335619 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:766 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Rx RSPRO tpduModemToCard(81f2400202)
local4.info: 2024-03-26 03:10:32.363083 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_pcsc.c:319 [000 B1:0 CONN_CLIENT_MAPPED_CARD] SCardTransmit: Transaction failed. (0x80100016)
local4.info: 2024-03-26 03:10:32.363239 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:970 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Error handling RSPRO
local4.info: 2024-03-26 03:10:32.363364 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:1051 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Error -2146435050 occurred: Cleaning up state
local4.info: 2024-03-26 03:10:32.375002 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1763 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:492 [000 B1:0 CONN_CLIENT_MAPPED_CARD] Changing state to ACCEPTING
local4.info: 2024-03-26 03:10:32.378255 bdu-arm-ce-imx8mp bankd-wrapper[1762]: 1764 DBANKDW INFO ../../../git/src/bankd/bankd_main.c:1036 [001 B65535:65535 ACCEPTING] Accepted connection from 100.64.33.10:35063
And here is the experimental patch to osmo-remsim-bankd:
diff --git a/src/bankd/bankd.h b/src/bankd/bankd.h
index 8a48a21..3c0f18f 100644
--- a/src/bankd/bankd.h
+++ b/src/bankd/bankd.h
@@ -17,6 +17,8 @@
#include "rspro_client_fsm.h"
#include "debug.h"
+#define MAX_CONSECUTIVE_TRANSCEIVE_ERRORS 5
+
extern struct value_string worker_state_names[];
#define LOGW(w, fmt, args...) \
@@ -102,6 +104,9 @@ struct bankd_worker {
/* last known state of the SIM card reset indication */
bool last_resetActive;
+
+ /* number of consecutive transceive errors */
+ int consecutive_transceive_errors;
};
/* bankd card reader driver operations */
diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c
index 90b05d8..c6cafe0 100644
--- a/src/bankd/bankd_main.c
+++ b/src/bankd/bankd_main.c
@@ -120,6 +120,7 @@ static struct bankd_worker *bankd_create_worker(struct bankd *bankd, unsigned in
worker->ops = &pcsc_driver_ops;
worker->last_vccPresent = true; /* allow cold reset should first indication be false */
worker->last_resetActive = false; /* allow warm reset should first indication be true */
+ worker->consecutive_transceive_errors = 0;
/* in the initial state, the worker has no client.fd, bank_slot or pcsc handle yet */
@@ -787,8 +788,21 @@ static int worker_handle_tpduModemToCard(struct bankd_worker *worker, const Rspr
rc = worker->ops->transceive(worker, mdm2sim->data.buf, mdm2sim->data.size,
rx_buf, &rx_buf_len);
- if (rc < 0)
- return rc;
+
+ if (rc < 0) {
+ LOGW(worker, "Transceieve error %d (count %d/%d)\n", rc,
+ worker->consecutive_transceive_errors, MAX_CONSECUTIVE_TRANSCEIVE_ERRORS);
+
+ if (++worker->consecutive_transceive_errors == MAX_CONSECUTIVE_TRANSCEIVE_ERRORS) {
+ return rc;
+ }
+
+ rx_buf[0] = 0x6f;
+ rx_buf[1] = 0x00;
+ rx_buf_len = 2;
+ }
+
+ worker->consecutive_transceive_errors = 0;
LOGW(worker, "Tx RSPRO tpduCardToModem(%s)\n", osmo_hexdump_nospc(rx_buf, rx_buf_len));
/* encode response PDU and send it */
Regards,
James
Hello,
Here is a patch for handling malformed IMSI
If you misswrited your IMSI, it will be impossible to read or edit it again :(
This patch fix that
Thanks
Goodbye
Dear osmocom developpers,
This is just to let you know that the Python library pycrate has a new home
: https://github.com/pycrate-org/pycrate. The packages on Pypi are now
feeded from there. This library can be used in many cases dealing with
mobile signalling.
I wanted to let you know, as even if I am not aware of any osmocom projects
depending on it, some of you may use the library from time to time, or
could have local applications depending on it.
Best Regards
Benoit