--nas-get-preferred-networks displays no networks, but there seems to be a lot of info (tested with 1.35.95-dev)?
Reinhard Speyerer
rspmn at arcor.de
Mon Mar 31 20:59:31 UTC 2025
On Mon, Mar 31, 2025 at 08:31:34AM -0500, Dan Williams wrote:
> On Tue, 2025-03-25 at 15:28 +0100, Reinhard Speyerer wrote:
> > On Wed, Mar 19, 2025 at 03:00:47PM -0500, Dan Williams wrote:
> > > On Wed, 2025-03-19 at 14:12 +0100, Martin Maurer wrote:
> > > > Hello,
> > > >
> > > > mentioned in the other thread, I tried the get instead of the
> > > > set:
> > > >
> > > > # qmicli -p -d /dev/cdc-wdm0 --nas-get-preferred-networks
> > > > [/dev/cdc-wdm0] Successfully got preferred networks:
> > > >
> > > > #
> > > >
> > > > No preferred network is displayed.
> > > >
> > > >
> > > > But switching on --verbose-full seems to list a lot info?
> > >
> > > Looks like TLVs 0x11 and 0x13 are ones that libqmi doesn't yet
> > > understand. They appear to be arrays like the existing preferred
> > > network array (MCC/MNC/tech) but 0x13 has another byte.
> > >
> > > Linaro's snaptel-sdk says they are "static" preferred networks and
> > > alludes to OPLMN so that's probably what they are. eg, they are
> > > defined
> > > by the operator and I believe part of the SIM, so you can't change
> > > them.
> >
> > Hi Dan,
> >
> > the NASGetPreferredNetworks TLVs returned differ with the SIM type
> > and
> > EF contents.
> >
[...]
> >
> > USIM with both TS 31.102 EF.PLMNwAcT and EF.OPLMNwAcT present but all
> > 0xff
> > contents:
> > NASGetPreferredNetworks 3000
> > +OK NASGetPreferredNetworks
> > 02040000000000100200000011020000001201000013010000
> >
> > USIM with only EF.OPLMNwAcT present: same set of TLVs returned as for
> > Martin's
> > SIM, i.e. no 0x10/0x12 TLVs.
> >
> > This might also explain the effect observed by Andreas in the other
> > thread:
> > If a USIM does not have EF.PLMNwAcT NASSetPreferredNetworks is
> > rejected by
> > the device.
>
> That seems quite plausible. Is it possible for MM to create EF.PLMNwAcT
> itself, or is that something pre-provisioned in the SIM that we can't
> touch?
>
Hi Dan,
it is not possible for MM to create EF.PLMNwAcT on the SIM according to my
understanding of TS 31.102 section 4.2.5 as this would require ADM access
rights.
Given the pySIM-shell output for the SIM in the other thread it has
EF.PLMNwAcT and therefore I would expect for the --nas-get-preferred-networks
result to contain TLVs 0x10 and 0x12 and --nas-set-preferred-networks to
work.
At least it works for me with a PLS83-W running firmware 02.110
(set to AT+CFUN=4 to avoid potential side effects) and qmicli 1.32.2:
NASGetPreferredNetworks returns
+OK NASGetPreferredNetworks 02040000000000100200000011020000001201000013010000
which is based on:
# <SIM> 2025-03-31/18:21:03.072649 SELECT 00a40804047fff6f606124
# <SIM> 2025-03-31/18:21:03.090291 GET-RESPONSE 00c000002462228202412183026f60a509c1044011f5559201008a01058b036f0603800200508801509000
# <SIM> 2025-03-31/18:21:03.109732 READ-BINARY 00b0000050ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff00009000
$ qmicli -d /dev/cdc-wdm1 --nas-set-preferred-networks=22802,all --verbose-full
[31 Mar 2025, 18:45:13] [Debug] [/dev/cdc-wdm1] sent generic request (translated)...
<<<<<< QMUX:
<<<<<< length = 36
<<<<<< flags = 0x00
<<<<<< service = "nas"
<<<<<< client = 3
<<<<<< QMI:
<<<<<< flags = "none"
<<<<<< transaction = 1
<<<<<< tlv_length = 24
<<<<<< 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 = 6
<<<<<< value = 01:E4:00:02:00:00
<<<<<< translated = { [0] = '[ mcc = '228' mnc = '2' includes_pcs_digit = 'no' ] '}
<<<<<< TLV:
<<<<<< type = "Preferred Networks" (0x10)
<<<<<< length = 8
<<<<<< value = 01:00:E4:00:02:00:FF:FF
<<<<<< translated = { [0] = '[ mcc = '228' mnc = '2' radio_access_technology = 'all' ] '}
[31 Mar 2025, 18:45:13] [Debug] [/dev/cdc-wdm1] received message...
<<<<<< RAW:
<<<<<< length = 20
<<<<<< data = 01:13:00:80:03:03:02:01:00:27:00:07:00:02:04:00:00:00:00:00
[31 Mar 2025, 18:45:13] [Debug] [/dev/cdc-wdm1] received generic response (translated)...
<<<<<< QMUX:
<<<<<< length = 19
<<<<<< flags = 0x80
<<<<<< service = "nas"
<<<<<< client = 3
<<<<<< QMI:
<<<<<< flags = "response"
<<<<<< transaction = 1
<<<<<< tlv_length = 7
<<<<<< message = "Set Preferred Networks" (0x0027)
<<<<<< TLV:
<<<<<< type = "Result" (0x02)
<<<<<< length = 4
<<<<<< value = 00:00:00:00
<<<<<< translated = SUCCESS
[/dev/cdc-wdm1] Preferred networks set successfully.
# <SIM> 2025-03-31/18:45:13.110699 SELECT 00a40804047fff6f606124
# <SIM> 2025-03-31/18:45:13.128327 GET-RESPONSE 00c000002462228202412183026f60a509c1044011f5559201008a01058b036f0603800200508801509000
# <SIM> 2025-03-31/18:45:13.166711 UPDATE-BINARY 00d600005022f820c0c0ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff00009000
at+cpol?
+CPOL: 1,2,"22802",1,1,1,1
OK
$ qmicli -d /dev/cdc-wdm1 --nas-get-preferred-networks
[/dev/cdc-wdm1] Successfully got preferred networks:
Preferred PLMN list:
[0]:
MCC: '228'
MNC: '2'
Access Technology: 'gsm-compact, gsm, eutran, utran'
PCS digit status:
[0]:
MCC: '228'
MNC: '2'
MCC with PCS digit: 'no'
Restoring the previous value:
$ qmicli -d /dev/cdc-wdm1 --nas-set-preferred-networks=
[/dev/cdc-wdm1] Preferred networks set successfully.
# <SIM> 2025-03-31/19:04:18.026751 STATUS 80f2000c009000
# <SIM> 2025-03-31/19:04:18.070034 UPDATE-BINARY 00d6000050ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff00009000
at+cpol?
OK
Regards,
Reinhard
More information about the libqmi-devel
mailing list