Readings IMSI (was: Re: Getting ICCID from locked qmi modem)

Torsten Hilbrich torsten.hilbrich at secunet.com
Sun Nov 9 23:24:15 PST 2014


Am 07.11.2014 um 16:50 schrieb Aleksander Morgado:
> <warn> [1415360816.142083] [mm-base-sim.c:1428]
> load_sim_identifier_ready(): couldn't load SIM identifier: 'QMI
> operation failed: Cannot send message: QMI service 'dms' version '1.3'
> required, got version '1.1''
> 
> Basically, the "UIM Get ICCID" message in libqmi is configured to be
> available if DMS service >= 1.3, and you're using 1.1. But, it is
> clearly wrong as you can run that message with qmicli... I just
> updated that in libqmi so that it requests at least DMS 1.1:
> 
> http://cgit.freedesktop.org/libqmi/commit/?id=ce723135cabb20e79f23f93a885410762c73d3ef
> 
> Also pushed to the qmi-1-10 branch, the current stable.

I can confirm that the patch works for us.

The same change can be made for the IMSI command, with the following patch:

diff --git a/data/qmi-service-dms.json b/data/qmi-service-dms.json
index 8120fa0..a6cf57e 100644
--- a/data/qmi-service-dms.json
+++ b/data/qmi-service-dms.json
@@ -852,7 +852,7 @@
      "type"    : "Message",
      "service" : "DMS",
      "id"      : "0x0043",
-     "version" : "1.3",
+     "version" : "1.1",
      "output"  : [  { "common-ref" : "Operation Result" },
                     { "name"      : "IMSI",
                       "id"        : "0x01",

the IMSI can successfully be read with the ModemManager.

However, there seems to be some problem reading or interpreting the lock
state. SIM_PIN1 is unlocked and set. I would then (as seen with other
modems) expect to see this information in the 3GPP section of the modem
information in the "enabled locks". However, I see 'none' there.
Expected output is at least the presence of pin.

The command "qmicli -d /dev/cdc-wdm9 --dms-uim-get-pin-status" outputs
information that seem to be correct (see attached
qmicli-read-pin-status.txt).

I have also added the output of "mmcli -m 0" (mmcli-modem.txt) and
"mmcli -i 0" (mmcli-sim.txt) as well as the complete modem-manager.log.

Version of libqmi was the current qmi-1-10 branch (5778785
libqmi,message: fix qmi_message_set_transaction_id() in non-CTL
messages) with the IMSI patch applied.

The version of modemmanager is still 1.4.0 as in the original report.

	Torsten
-------------- next part --------------
# qmicli -d /dev/cdc-wdm0 --dms-uim-get-pin-status
[/dev/cdc-wdm0] PIN status retrieved successfully
[/dev/cdc-wdm0] PIN1:
	Status: enabled-verified
	Verify: 3
	Unblock: 10
[/dev/cdc-wdm0] PIN2:
	Status: enabled-not-verified
	Verify: 2
	Unblock: 10


# qmicli -d /dev/cdc-wdm0 --dms-uim-get-pin-status --verbose
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Opening device with flags 'none'...
[10 Nov 2014, 07:07:12] [Debug] QMI Device at '/dev/cdc-wdm0' ready
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Assuming service 'dms' is supported...
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Allocating new client ID...
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Sent message...
<<<<<< RAW:
<<<<<<   length = 16
<<<<<<   data   = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:02

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Sent message (translated)...
<<<<<< QMUX:
<<<<<<   length  = 15
<<<<<<   flags   = 0x00
<<<<<<   service = "ctl"
<<<<<<   client  = 0
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 1
<<<<<<   tlv_length  = 4
<<<<<<   message     = "Allocate CID" (0x0022)
<<<<<< TLV:
<<<<<<   type       = "Service" (0x01)
<<<<<<   length     = 1
<<<<<<   value      = 02
<<<<<<   translated = dms

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message...
>>>>>> RAW:
>>>>>>   length = 24
>>>>>>   data   = 01:17:00:80:00:00:01:07:23:00:0C:00:02:04:00:00:00:00:00:01:02:00:06:02

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message (translated)...
>>>>>> QMUX:
>>>>>>   length  = 23
>>>>>>   flags   = 0x80
>>>>>>   service = "ctl"
>>>>>>   client  = 0
>>>>>> QMI:
>>>>>>   flags       = "response"
>>>>>>   transaction = 7
>>>>>>   tlv_length  = 12
>>>>>>   message     = "Release CID" (0x0023)
>>>>>> TLV:
>>>>>>   type       = "Result" (0x02)
>>>>>>   length     = 4
>>>>>>   value      = 00:00:00:00
>>>>>>   translated = SUCCESS
>>>>>> TLV:
>>>>>>   type       = "Release Info" (0x01)
>>>>>>   length     = 2
>>>>>>   value      = 06:02
>>>>>>   translated = [ service = 'pds' cid = '2' ]

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] No transaction matched in received message
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message...
>>>>>> RAW:
>>>>>>   length = 24
>>>>>>   data   = 01:17:00:80:00:00:01:08:23:00:0C:00:02:04:00:00:00:00:00:01:02:00:05:02

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message (translated)...
>>>>>> QMUX:
>>>>>>   length  = 23
>>>>>>   flags   = 0x80
>>>>>>   service = "ctl"
>>>>>>   client  = 0
>>>>>> QMI:
>>>>>>   flags       = "response"
>>>>>>   transaction = 8
>>>>>>   tlv_length  = 12
>>>>>>   message     = "Release CID" (0x0023)
>>>>>> TLV:
>>>>>>   type       = "Result" (0x02)
>>>>>>   length     = 4
>>>>>>   value      = 00:00:00:00
>>>>>>   translated = SUCCESS
>>>>>> TLV:
>>>>>>   type       = "Release Info" (0x01)
>>>>>>   length     = 2
>>>>>>   value      = 05:02
>>>>>>   translated = [ service = 'wms' cid = '2' ]

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] No transaction matched in received message
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message...
>>>>>> RAW:
>>>>>>   length = 24
>>>>>>   data   = 01:17:00:80:00:00:01:01:22:00:0C:00:02:04:00:00:00:00:00:01:02:00:02:08

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message (translated)...
>>>>>> QMUX:
>>>>>>   length  = 23
>>>>>>   flags   = 0x80
>>>>>>   service = "ctl"
>>>>>>   client  = 0
>>>>>> QMI:
>>>>>>   flags       = "response"
>>>>>>   transaction = 1
>>>>>>   tlv_length  = 12
>>>>>>   message     = "Allocate CID" (0x0022)
>>>>>> TLV:
>>>>>>   type       = "Result" (0x02)
>>>>>>   length     = 4
>>>>>>   value      = 00:00:00:00
>>>>>>   translated = SUCCESS
>>>>>> TLV:
>>>>>>   type       = "Allocation Info" (0x01)
>>>>>>   length     = 2
>>>>>>   value      = 02:08
>>>>>>   translated = [ service = 'dms' cid = '8' ]

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Registered 'dms' (version unknown) client with ID '8'
[10 Nov 2014, 07:07:12] [Debug] Asynchronously getting PIN status...
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Sent message...
<<<<<< RAW:
<<<<<<   length = 13
<<<<<<   data   = 01:0C:00:00:02:08:00:01:00:2B:00:00:00

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Sent message (translated)...
<<<<<< QMUX:
<<<<<<   length  = 12
<<<<<<   flags   = 0x00
<<<<<<   service = "dms"
<<<<<<   client  = 8
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 1
<<<<<<   tlv_length  = 0
<<<<<<   message     = "UIM Get PIN Status" (0x002B)

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message...
>>>>>> RAW:
>>>>>>   length = 32
>>>>>>   data   = 01:1F:00:80:02:08:02:01:00:2B:00:13:00:02:04:00:00:00:00:00:12:03:00:01:02:0A:11:03:00:02:03:0A

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message (translated)...
>>>>>> QMUX:
>>>>>>   length  = 31
>>>>>>   flags   = 0x80
>>>>>>   service = "dms"
>>>>>>   client  = 8
>>>>>> QMI:
>>>>>>   flags       = "response"
>>>>>>   transaction = 1
>>>>>>   tlv_length  = 19
>>>>>>   message     = "UIM Get PIN Status" (0x002B)
>>>>>> TLV:
>>>>>>   type       = "Result" (0x02)
>>>>>>   length     = 4
>>>>>>   value      = 00:00:00:00
>>>>>>   translated = SUCCESS
>>>>>> TLV:
>>>>>>   type       = "PIN2 Status" (0x12)
>>>>>>   length     = 3
>>>>>>   value      = 01:02:0A
>>>>>>   translated = [ current_status = 'enabled-not-verified' verify_retries_left = '2' unblock_retries_left = '10' ]
>>>>>> TLV:
>>>>>>   type       = "PIN1 Status" (0x11)
>>>>>>   length     = 3
>>>>>>   value      = 02:03:0A
>>>>>>   translated = [ current_status = 'enabled-verified' verify_retries_left = '3' unblock_retries_left = '10' ]

[/dev/cdc-wdm0] PIN status retrieved successfully
[/dev/cdc-wdm0] PIN1:
	Status: enabled-verified
	Verify: 3
	Unblock: 10
[/dev/cdc-wdm0] PIN2:
	Status: enabled-not-verified
	Verify: 2
	Unblock: 10
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Releasing 'dms' client with flags 'release-cid'...
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Unregistered 'dms' client with ID '8'
[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Sent message...
<<<<<< RAW:
<<<<<<   length = 17
<<<<<<   data   = 01:10:00:00:00:00:00:02:23:00:05:00:01:02:00:02:08

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Sent message (translated)...
<<<<<< QMUX:
<<<<<<   length  = 16
<<<<<<   flags   = 0x00
<<<<<<   service = "ctl"
<<<<<<   client  = 0
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 2
<<<<<<   tlv_length  = 5
<<<<<<   message     = "Release CID" (0x0023)
<<<<<< TLV:
<<<<<<   type       = "Release Info" (0x01)
<<<<<<   length     = 2
<<<<<<   value      = 02:08
<<<<<<   translated = [ service = 'dms' cid = '8' ]

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message...
>>>>>> RAW:
>>>>>>   length = 24
>>>>>>   data   = 01:17:00:80:00:00:01:02:23:00:0C:00:02:04:00:00:00:00:00:01:02:00:02:08

[10 Nov 2014, 07:07:12] [Debug] [/dev/cdc-wdm0] Received message (translated)...
>>>>>> QMUX:
>>>>>>   length  = 23
>>>>>>   flags   = 0x80
>>>>>>   service = "ctl"
>>>>>>   client  = 0
>>>>>> QMI:
>>>>>>   flags       = "response"
>>>>>>   transaction = 2
>>>>>>   tlv_length  = 12
>>>>>>   message     = "Release CID" (0x0023)
>>>>>> TLV:
>>>>>>   type       = "Result" (0x02)
>>>>>>   length     = 4
>>>>>>   value      = 00:00:00:00
>>>>>>   translated = SUCCESS
>>>>>> TLV:
>>>>>>   type       = "Release Info" (0x01)
>>>>>>   length     = 2
>>>>>>   value      = 02:08
>>>>>>   translated = [ service = 'dms' cid = '8' ]

[10 Nov 2014, 07:07:12] [Debug] Client released
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modem-manager.log
Type: text/x-log
Size: 88493 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/modemmanager-devel/attachments/20141110/b9d254c5/attachment-0001.bin>
-------------- next part --------------
SIM '/org/freedesktop/ModemManager1/SIM/0'
  -------------------------
  Properties |          imsi : '262022913989449'
             |            id : '89492029307551762080'
             |   operator id : 'unknown'
             | operator name : 'unknown'
-------------- next part --------------

/org/freedesktop/ModemManager1/Modem/0 (device id 'dc8d3d26baefdd35a6f6cff49c0942d1fb432217')
  -------------------------
  Hardware |   manufacturer: 'Qualcomm Incorporated'
           |          model: 'Qualcomm Gobi 2000'
           |       revision: 'D1025-STUTABGD-3600  1  [Jan 14 2010 14:00:00]'
           |      supported: 'gsm-umts'
           |        current: 'gsm-umts'
           |   equipment id: '353093033456136'
  -------------------------
  System   |         device: '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4'
           |        drivers: 'qcserial, qmi_wwan'
           |         plugin: 'Gobi'
           |   primary port: 'cdc-wdm0'
           |          ports: 'ttyUSB0 (qcdm), ttyUSB1 (at), cdc-wdm0 (qmi), wwan0 (net)'
  -------------------------
  Numbers  |           own : 'unknown'
  -------------------------
  Status   |           lock: 'sim-pin2'
           | unlock retries: 'sim-pin (3), sim-pin2 (2), sim-puk (10), sim-puk2 (10)'
           |          state: 'disabled'
           |    power state: 'on'
           |    access tech: 'unknown'
           | signal quality: '0' (cached)
  -------------------------
  Modes    |      supported: 'allowed: 2g; preferred: none
           |                  allowed: 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: 2g
           |                  allowed: 2g, 3g; preferred: 3g'
           |        current: 'allowed: any; preferred: none'
  -------------------------
  Bands    |      supported: 'unknown'
           |        current: 'unknown'
  -------------------------
  IP       |      supported: 'ipv4, ipv6, ipv4v6'
  -------------------------
  3GPP     |           imei: '353093033456136'
           |  enabled locks: 'none'
           |    operator id: 'unknown'
           |  operator name: 'unknown'
           |   subscription: 'unknown'
           |   registration: 'unknown'
  -------------------------
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'

  -------------------------
  Bearers  |          paths: 'none'



More information about the ModemManager-devel mailing list