Hello
I can access my ZTE Modem and read values from the SIM card like IMSI with
AT commands.
Welcome to minicom 2.8
OPTIONS: I18n
Port /dev/ttyUSB2, 18:23:09
Press CTRL-A Z for help on special keys
AT
OK
AT+CSIM=?
OK
ATI
Manufacturer: ZTE INCORPORATED
Model: MF626
Revision: BD_MOBINILP673M3V1.0.0B02
IMEI: 357034037160973
+GCAP: +CGSM,+FCLAS
I would like to try pySIM-shell to access the same modem with SIM, but I am
getting the error below:
(venv) root@ubuntu-HP-Notebook:/home/ubuntu/pysim# python3 pySim-shell.py
--modem-device /dev/ttyUSB2
DEBUG:root:Sending AT command: AT
INFO:root:Command finished with timeout >= 0.2s
DEBUG:root:Command took 0.201042s (89 cycles a 0.002000s)
DEBUG:root:Got response from modem: [b'']
Traceback (most recent call last):
File "/home/ubuntu/pysim/pySim-shell.py", line 1117, in <module>
sl = init_reader(opts, proactive_handler = Proact())
File "/home/ubuntu/pysim/pySim/transport/__init__.py", line 362, in
init_reader
sl = ModemATCommandLink(opts, **kwargs)
File "/home/ubuntu/pysim/pySim/transport/modem_atcmd.py", line 51, in
__init__
self._check_echo()
File "/home/ubuntu/pysim/pySim/transport/modem_atcmd.py", line 127, in
_check_echo
raise ReaderError('Interface \'%s\' does not respond to \'AT\' command'
% self._device)
pySim.exceptions.ReaderError: Interface '/dev/ttyUSB2' does not respond to
'AT' command
(venv) root@ubuntu-HP-Notebook:/home/ubuntu/pysim#
I tried increasing the timeout in send_at_cmd() to 1 second and 2 seconds,
but i get the same result.
Any ideas how I can access the modem via pySim-shell ?
Thanks
Abdelmuhaimen Seaudi, CCIE # 25265
Email: aseaudi(a)gmail.com
Skype: aseaudi
LinkedIn: www.linkedin.com/in/aseaudi
Telephone: +2012 84644 733
Good day,
I have been trying to get Simtrace2 to connect to a 'newish' phone model, but to no avail. I can not get the SIM to be recognised in the tray (I confirmed that the ribbon flex cable's continuity is OK too).
I saw a sysmocom thread <https://osmocom.org/issues/6181> where a Google Pixel 5 succeeded in tracing some TPDUs.
Does anyone have some hints as to how to get this working on a non-M.2 form factor modem and ideally in a handled?
I have tested with the following phone models, all with the same result of no SIM detection:
Google Pixel 3A & 5, Samsung S21-S24, iPhone 13 & 14 and OnePlus 9
Kind regards,
Nico
Hi.
I want to use pySim to check my own SIM applet.
But there is ERROR when installing pySim.
pySim requires smpp.pdu-0.3. So I tried to install smpp.pdu-0.3.
But it show following error like following. Error is due to "AttributeError: module 'enum' has no attribute '__version__'" Could help me solve the problem.
(vpy) quectel-sw@quectelsw-keipy:~/work/04_usim/smpp.pdu-0.3$
(vpy) quectel-sw@quectelsw-keipy:~/work/04_usim/smpp.pdu-0.3$ sudo python3.9 setup.py install --user
running install
..........
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-rbrdenj3/enum-0.4.7/setup.py", line 24, in <module>
test_suite = 'smpp.pdu.tests',
AttributeError: module 'enum' has no attribute '__version__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/quectel-sw/work/04_usim/smpp.pdu-0.3/setup.py", line 6, in <module>
setup(
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run(show_deprecation=False)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 450, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 693, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 740, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 784, in process_distribution
distros = WorkingSet([]).resolve(
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 781, in resolve
dist = best[req.key] = env.best_match(
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1066, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1078, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 712, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 738, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 923, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1191, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1177, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/usr/lib/python3.9/contextlib.py", line 135, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3.9/contextlib.py", line 135, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python3/dist-packages/setuptools/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-rbrdenj3/enum-0.4.7/setup.py", line 24, in <module>
test_suite = 'smpp.pdu.tests',
AttributeError: module 'enum' has no attribute '__version__'
(vpy) quectel-sw@quectelsw-keipy:~/work/04_usim/smpp.pdu-0.3$
https://www.quectel.com/ Young Hwan Kim | Software Engineer | Quectel Wireless Solutions Co., Ltd. <https://www.quectel.com/>
Mobile: +82-10 4239 3254 | Email : younghwan.kim(a)quectel.com | Tel: +82-31-698-2067<https://www.quectel.com/>
Website: https://www.quectel.com/ | Wechat: wxid_pim1xd90yibj22<https://www.quectel.com/>
2nd Floor, 26, Hwangsaeul-ro 312 beon-gil, Bundang-gu, Seongnam-si, Gyeonggi-do, Republic of Korea<https://www.quectel.com/>
[???, ??? ???, ???(?) ??? ?? ?? ??? ??]<https://www.quectel.com/>
*UDP Port (4729) Conflict Between SIMTrace2 and pySim*
Hello community/admin,
I am experiencing an issue while using *SIMTrace2* and *pySim* to sniff and
analyze SIM card communication. Below are the details:
------------------------------
*1. When SIMTrace2 Sniff is Turned Off*
I run the following command:
bash
pySim-trace.py gsmtap-udp
*Output*:
plaintext
Copy code
INFO root: Opening source gsmtap-udp...
Detected UICC Add-on "SIM"
Detected UICC Add-on "GSM-R"
Detected UICC Add-on "RUIM"
Can't read AIDs from SIM -- 'list' object has no attribute 'lower'
warning: EF.DIR seems to be empty!
ADF.ECASD: a0000005591010ffffffff8900000200
ADF.ISD-R: a0000005591010ffffffff8900000100
ISIM: a0000000871004
USIM: a0000000871002
INFO root: Entering main loop...
When I check the UDP port (4729) usage:
bash
sudo lsof -i :4729
*Output*:
plaintext
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
python3 198340 jun 4u IPv4 301846 0t0 UDP localhost:4729
------------------------------
*2. When SIMTrace2 Sniff is Turned On*
I run the following command:
bash
simtrace2-sniff
*Output*:
plaintext
simtrace2-sniff - Phone-SIM card communication sniffer
(C) 2010-2017 by Harald Welte <laforge(a)gnumonks.org>
(C) 2018 by Kevin Redon <kredon(a)sysmocom.de>
Using USB device 1d50:60e3 Addr=46, Path=1-5, Cfg=1, Intf=0, Alt=0:
255/1/0 (SIMtrace Sniffer)
Entering main loop
ATR: 3b 9f 96 80 1f c7 80 31 e0 73 fe 21 11 57 86 81 27 86 98 60 58 ec
PPS: ff 00 ff
TPDU: a0 a4 00 00 02 7f 20 9f 17
TPDU: a0 c0 00 00 17 00 00 00 00 7f 20 02 00 00 00 00 00 0a 93 00 1c
04 00 83 8a 83 8a 00 90 00
When I check the UDP port (4729) usage:
bash
sudo lsof -i :4729
*Output*:
plaintext
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
simtrace2 198351 jun 7u IPv4 308389 0t0 UDP
localhost:36190->localhost:4729
simtrace2 198351 jun 8u IPv4 308390 0t0 UDP localhost:4729
------------------------------
*UDP Port (4729) Conflict Between SIMTrace2 and pySim*
Hello community/admin,
I am experiencing an issue while using *SIMTrace2* and *pySim* to sniff and
analyze SIM card communication. Below are the details:
------------------------------
*1. When SIMTrace2 Sniff is Turned Off*
I run the following command:
bash
Copy code
/usr/src/pysim/pySim-trace.py gsmtap-udp
*Output*:
plaintext
Copy code
INFO root: Opening source gsmtap-udp...
Detected UICC Add-on "SIM"
Detected UICC Add-on "GSM-R"
Detected UICC Add-on "RUIM"
Can't read AIDs from SIM -- 'list' object has no attribute 'lower'
warning: EF.DIR seems to be empty!
ADF.ECASD: a0000005591010ffffffff8900000200
ADF.ISD-R: a0000005591010ffffffff8900000100
ISIM: a0000000871004
USIM: a0000000871002
INFO root: Entering main loop...
When I check the UDP port (4729) usage:
bash
sudo lsof -i :4729
*Output*:
plaintext
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
python3 198340 jun 4u IPv4 301846 0t0 UDP localhost:4729
------------------------------
*2. When SIMTrace2 Sniff is Turned On*
I run the following command:
bash
simtrace2-sniff
*Output*:
plaintext
simtrace2-sniff - Phone-SIM card communication sniffer
(C) 2010-2017 by Harald Welte <laforge(a)gnumonks.org>
(C) 2018 by Kevin Redon <kredon(a)sysmocom.de>
Using USB device 1d50:60e3 Addr=46, Path=1-5, Cfg=1, Intf=0, Alt=0:
255/1/0 (SIMtrace Sniffer)
Entering main loop
ATR: 3b 9f 96 80 1f c7 80 31 e0 73 fe 21 11 57 86 81 27 86 98 60 58 ec
PPS: ff 00 ff
TPDU: a0 a4 00 00 02 7f 20 9f 17
TPDU: a0 c0 00 00 17 00 00 00 00 7f 20 02 00 00 00 00 00 0a 93 00 1c
04 00 83 8a 83 8a 00 90 00
When I check the UDP port (4729) usage:
bash
sudo lsof -i :4729
*Output*:
plaintext
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
simtrace2 198351 jun 7u IPv4 308389 0t0 UDP
localhost:36190->localhost:4729
simtrace2 198351 jun 8u IPv4 308390 0t0 UDP localhost:4729
------------------------------
*3. When Running SIMTrace2 Sniff and pySim-trace.py Together*
If I try to run both *SIMTrace2 sniff* and *pySim-trace.py gsmtap-udp*
simultaneously, I get the following error from *pySim*:
plaintext
jun@jun-RDR:pySim-trace.py gsmtap-udp
INFO root: Opening source gsmtap-udp...
Traceback (most recent call last):
File "pySim-trace.py", line 199, in <module>
s = GsmtapApduSource(opts.bind_ip, opts.bind_port)
File "pysim/pySim/apdu_source/gsmtap.py", line 44, in __init__
self.gsmtap = GsmtapReceiver(bind_ip, bind_port)
File "/home/jun/.local/lib/python3.10/site-packages/osmocom/gsmtap.py",
line 207, in __init__
self.sock.bind((self.bind_ip, self.bind_port))
OSError: [Errno 98] Address already in use
------------------------------
*Main Issue*
1. When *SIMTrace2 sniff* is running, it occupies UDP port 4729,
preventing *pySim* from using the same port.
2. When SIMTrace2 sniff is stopped, *pySim* can access UDP port 4729 but
fails to decode data, showing the following errors:
plaintext
Can't read AIDs from SIM -- 'list' object has no attribute 'lower'
warning: EF.DIR seems to be empty!
3. If I try to run both tools at the same time, *pySim* crashes with the
error [Errno 98] Address already in use.
------------------------------
*Request for Help*
- Has anyone experienced a similar issue when running *SIMTrace2* and
*pySim* together?
- How can I avoid the port conflict and ensure both tools can run
simultaneously?
- What could cause the decoding error and the warning about an empty
EF.DIR in *pySim*?
Any insights or advice would be greatly appreciated. Thank you!
Hello,
In reference to this bug: https://osmocom.org/issues/5310
I am also experiencing this on two different platforms, Pi4 and an Intel NUC x86. I have two OCTSIMs but I can reproduce with one only and with only USB connected. All SIM slots are populated. Upon power cycle of the host system, the OCTSIM is unable to enumerate. If I unplug the USB cable and replug, it sometimes enumerates. If it doesn't, I move to another USB port and sometime it works.
I also tried upgrading the firmware on one board from 0.2.61-2a78 to 0.2.78-62e1 but the problem remains. Log below shows enumeration errors after which I unplugged the cables and replugged. Please advise as we cannot build a product around a device that cannot enumerate reliably.
[ 308.083438] usb 1-1: new full-speed USB device number 5 using xhci_hcd
[ 308.211478] usb 1-1: device descriptor read/64, error -71
[ 308.447471] usb 1-1: device descriptor read/64, error -71
[ 308.683426] usb 1-1: new full-speed USB device number 6 using xhci_hcd
[ 308.811460] usb 1-1: device descriptor read/64, error -71
[ 309.047456] usb 1-1: device descriptor read/64, error -71
[ 309.155542] usb usb1-port1: attempt power cycle
[ 309.567390] usb 1-1: new full-speed USB device number 7 using xhci_hcd
[ 309.567620] usb 1-1: Device not responding to setup address.
[ 309.775623] usb 1-1: Device not responding to setup address.
[ 309.983398] usb 1-1: device not accepting address 7, error -71
[ 310.111394] usb 1-1: new full-speed USB device number 8 using xhci_hcd
[ 310.111628] usb 1-1: Device not responding to setup address.
[ 310.319589] usb 1-1: Device not responding to setup address.
[ 310.527383] usb 1-1: device not accepting address 8, error -71
[ 310.527534] usb usb1-port1: unable to enumerate USB device
[ 349.237421] usb 1-2: USB disconnect, device number 3
[ 353.706345] usb 1-2: new full-speed USB device number 9 using xhci_hcd
[ 353.856758] usb 1-2: New USB device found, idVendor=1d50, idProduct=6141, bcdDevice= 0.00
[ 353.856770] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=7
[ 353.856776] usb 1-2: Product: sysmoOCTSIM 0.2.61-2a78
[ 353.856781] usb 1-2: Manufacturer: sysmocom - s.f.m.c. GmbH
[ 353.856785] usb 1-2: SerialNumber: 6ebe976f3335355320202034432415ff
[ 353.871733] cdc_acm 1-2:1.1: ttyACM0: USB ACM device
[ 353.871776] usbcore: registered new interface driver cdc_acm
[ 353.871779] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 373.317822] usb 1-1: new full-speed USB device number 10 using xhci_hcd
[ 373.468141] usb 1-1: New USB device found, idVendor=1d50, idProduct=6141, bcdDevice= 0.00
[ 373.468154] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=7
[ 373.468160] usb 1-1: Product: sysmoOCTSIM 0.2.78-62e1
[ 373.468164] usb 1-1: Manufacturer: sysmocom - s.f.m.c. GmbH
Thanks
Hi,
I am in process of burning new SIM card with details from scratch and have
been referring to https://gitea.osmocom.org/sim-card/pysim
From the README à Installation I am unable to install below deps at my WSL
environment, can someone please suggest a way to do it please ?
pyosmocom
pycryptodomex
pyscard
pyserial
pytlv
pyyaml >= 5.1
--
Best Regards
Shantanu
Hello experts,
I am trying to use WiFi calling in iPhone by using sysmoISIM-SJA2, but for
some reason "WiFi Calling" toggle button is not shown in the phone setting.
I am using PLMN ID 441-216 (Newly obtained from Japanese Government for
private network usage).
I have written epdgid, epdgSelection, and pcscf address in the SIM card and
saw if the toggle button was shown, but it was not.
It would be really appreciated if you could tell me how to enable WiFi
calling in iPhone.
Thanks&Regards,
Koji
Cordial greeting,
A few months ago I purchased a pack of 10 sysmoISIM-SJA5-9FV SIMs and
one Omnikey 3121 USB card reader.
Since I received the products I have tried to install PySim to program
the sim cards for use with OAI, when carrying out the installation
process as indicated in the documentation
(https://github.com/osmocom/pysim) on different versions of Ubuntu
(20LTS, 22LTS and 24LTS) and over Linux Arch 2024 is generated the
following error message
File "/usr/bin/pySim-shell.py", line 50, in <module>
from osmocom.utils import h2b, b2h, i2h, swap_nibbles, rpad,
JsonEncoder, is_hexstr, is_decimal
ModuleNotFoundError: No module named 'osmocom'
For this reason, I have not been able to program the purchased SIM cards
Could you please help me by sending detailed instructions on how to
successfully carry out the installation process of PySim on any
suggested version of Linux?
I appreciate the attention and collaboration you can give me.
Best regards
P.D.
Sale Order: SO8027
Delivery Order: AM93\OUT\07572
Webshop Order ID: WEBON12442
--