usage of nas-set-preferred-networks

Andreas Tobler andreas.tobler at onway.ch
Mon Mar 17 22:20:09 UTC 2025



On 17.03.2025 21:13, Dan Williams wrote:

> On Thu, 2025-03-13 at 07:10 +0100, Andreas Tobler wrote:
>> All,
>>
>> I am trying the --nas-set-preferred-networks with the qmicli tool and
>> I
>> fail.
>>
>> qmicli -d /dev/cdc-wdm0 --nas-set-preferred-networks=22802,all
>> error: couldn't set preferred networks: QMI protocol error (37):
>> 'UimUninitialized'
>>
>> I'm not sure if I use the command correctly and was looking for a
>> sample
>> 'session' which is able to set the preferred networks.
>>
>> Is the 'UimUninitialized' error due to my arguments or how do I
>> interpret the error?
>>
>> I'm able to establish a network connection with the SIM card w/o
>> problems.
>>
>> Do I need some preparation steps to execute this command?
>>
>> Any pointers are welcome, doc etc.
> 
> Would you be able to add the "-v" flag to qmicli and copy in the full
> QMI request/response data that it prints out?

Sure, attached.

> 
> I'm not sure it'll show much useful but it would allow us to double-
> check what qmicli is sending to the modem.
> 
> One thing to try is that perhaps the modem doesn't like the "all"
> access technology option and doesn't know how to handle it. Could you
> try explicitly listing them, like "22802,gsm|umts|lte"?

I have tried all possible access technologies, always the same answer.

Thanks,
Andreas




-------------- next part --------------
andreast at atobuntu:~/docs$ sudo qmicli -d /dev/cdc-wdm0 --nas-set-preferred-networks=22803,all,22801,utran -v 
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] opening device with flags 'auto'...
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] automatically selecting QMI mode
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] created endpoint
[12 Mar 2025, 15:41:13] [Debug] QMI Device at '/dev/cdc-wdm0' ready
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] assuming service 'nas' is supported...
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] allocating new client ID...
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] sent message...
<<<<<< RAW:
<<<<<<   length = 16
<<<<<<   data   = 01:0F:00:00:00:00:00:01:22:00:04:00...

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] sent generic request (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      = 03
<<<<<<   translated = nas

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] received message...
<<<<<< RAW:
<<<<<<   length = 24
<<<<<<   data   = 01:17:00:80:00:00:01:01:22:00:0C:00...

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] received generic response (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      = 03:08
<<<<<<   translated = [ service = 'nas' cid = '8' ]

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] registered 'nas' (version unknown) client with ID '8'
[12 Mar 2025, 15:41:13] [Debug] Asynchronously setting preferred networks...
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] sent message...
<<<<<< RAW:
<<<<<<   length = 48
<<<<<<   data   = 01:2F:00:00:03:08:00:01:00:27:00:23...

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] sent generic request (translated)...
<<<<<< QMUX:
<<<<<<   length  = 47
<<<<<<   flags   = 0x00
<<<<<<   service = "nas"
<<<<<<   client  = 8
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 1
<<<<<<   tlv_length  = 35
<<<<<<   message     = "Set Preferred Networks" (0x0027)
<<<<<< TLV:
<<<<<<   type       = "Clear Previous Preferred Networks" (0x12)
<<<<<<   length     = 1
<<<<<<   value      = 01
<<<<<<   translated = yes
<<<<<< TLV:
<<<<<<   type       = "MNC PCS Digit Include Status" (0x11)
<<<<<<   length     = 11
<<<<<<   value      = 02:E4:00:03:00:00:E4:00:01:00:00
<<<<<<   translated = { [0] = '[ mcc = '228' mnc = '3' includes_pcs_digit = 'no' ] ' [1] = '[ mcc = '228' mnc = '1' includes_pcs_digit = 'no' ] '}
<<<<<< TLV:
<<<<<<   type       = "Preferred Networks" (0x10)
<<<<<<   length     = 14
<<<<<<   value      = 02:00:E4:00:03:00:FF:FF:E4:00:01:00:00:80
<<<<<<   translated = { [0] = '[ mcc = '228' mnc = '3' radio_access_technology = 'all' ] ' [1] = '[ mcc = '228' mnc = '1' radio_access_technology = 'utran' ] '}

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] received message...
<<<<<< RAW:
<<<<<<   length = 20
<<<<<<   data   = 01:13:00:80:03:08:02:01:00:27:00:07...

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] received generic response (translated)...
<<<<<< QMUX:
<<<<<<   length  = 19
<<<<<<   flags   = 0x80
<<<<<<   service = "nas"
<<<<<<   client  = 8
<<<<<< QMI:
<<<<<<   flags       = "response"
<<<<<<   transaction = 1
<<<<<<   tlv_length  = 7
<<<<<<   message     = "Set Preferred Networks" (0x0027)
<<<<<< TLV:
<<<<<<   type       = "Result" (0x02)
<<<<<<   length     = 4
<<<<<<   value      = 01:00:25:00
<<<<<<   translated = FAILURE: UimUninitialized

error: couldn't set preferred networks: QMI protocol error (37): 'UimUninitialized'
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] releasing 'nas' client with flags 'release-cid'...
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] unregistered 'nas' client with ID '8'
[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] sent message...
<<<<<< RAW:
<<<<<<   length = 17
<<<<<<   data   = 01:10:00:00:00:00:00:02:23:00:05:00...

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] sent generic request (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      = 03:08
<<<<<<   translated = [ service = 'nas' cid = '8' ]

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] received message...
<<<<<< RAW:
<<<<<<   length = 24
<<<<<<   data   = 01:17:00:80:00:00:01:02:23:00:0C:00...

[12 Mar 2025, 15:41:13] [Debug] [/dev/cdc-wdm0] received generic response (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      = 03:08
<<<<<<   translated = [ service = 'nas' cid = '8' ]

[12 Mar 2025, 15:41:13] [Debug] Client released
[12 Mar 2025, 15:41:13] [Debug] Closed
andreast at atobuntu:~/docs$ sudo qmicli -d /dev/cdc-wdm0 --nas-set-preferred-networks=22803,all,22801,utran  
error: couldn't set preferred networks: QMI protocol error (37): 'UimUninitialized'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5000 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20250317/29b47a58/attachment-0001.bin>


More information about the libqmi-devel mailing list