Set technology preference to chosen type only.

Paul Gildea gildeap at tcd.ie
Wed Feb 15 16:26:16 UTC 2017


Hi Aleksander,

Thanks for the reply! This problem was discovered when using a MC7455
actually, however I am using a SIMCOM modem at the moment, it exhibits the
same behaviour. I have tried the same operations as you but still have the
problem. However the strange thing is if I use --verbose I get expected
behaviour (most of the time - it seems to consistently work now but I have
seen it exhibit the behaviour I reported before). I also recompiled the
code and noticed that when inspecting the binary for the preference
variable being passed, the LTE and td-scdma bits are always set high. This
testing was done without the --verbose flag. I will test with that when I
can.

For example, when I run the command qmicli -d /dev/cdc-wdm0
--nas-set-system-selection-preference="umts" here is the binary of the
passed preference variable, with LTE and tc-scdma bits set high for some
reason (indicated with -): 1011011101111110010-11-0000. Now this is OR'd
and the umts bit is set high as expected: 101101110111111001011-1-000.

I have created a simple patch to set the bits to 0 before the OR'ing loop
occurs and this solves my problem and will do until it can be fixed in a
better way.


--- libqmi-1.16.2/src/qmicli/qmicli-helpers.c 2017-02-15 13:01:37.188665609
+0000
+++ libqmi-mod/src/qmicli/qmicli-helpers.c 2017-02-15 14:34:45.204579991
+0000
@@ -188,6 +188,11 @@
     type = qmi_nas_rat_mode_preference_get_type ();
     flags_class = G_FLAGS_CLASS (g_type_class_ref (type));

+    /* Mask technology preference bits to 0, some can be set high in err,
reset them.
+     * See QmiNasRatModePreference Enum for reference
+     *
+    *out &= 0xFFFFFFC0;
+
     items = g_strsplit_set (str, "|", 0);
     for (iter = items; iter && *iter && success; iter++) {
         if (!*iter[0])


Here is the same process you went through, you can see the problems with
mine:
(set LTE as preferred)

qmicli -d /dev/cdc-wdm0 --nas-get-system-selection-preference
[/dev/cdc-wdm0] Successfully got system selection preference
Emergency mode: 'no'
Mode preference: 'umts, lte, td-scdma'
Band preference: 'gsm-dcs-1800, gsm-900-extended, wcdma-2100, wcdma-900'
LTE band preference: '1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17,
18, 19, 20, 21, 24, 25, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43'
TD-SCDMA band preference: 'a, b, c, d, e, f'
Roaming preference: 'any'
Network selection preference: 'automatic'
Service domain preference: 'cs-ps'
Service selection preference: 'automatic'

qmicli -d /dev/cdc-wdm0 --nas-get-technology-preference
[/dev/cdc-wdm0] Successfully got technology preference
Active: '3gpp, cdma-or-wcdma, lte', duration: 'permanent'


qmicli -d /dev/cdc-wdm0  --nas-set-system-selection-preference="lte"
[/dev/cdc-wdm0] System selection preference set successfully; replug your
device.

qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline
[/dev/cdc-wdm0] Operating mode set successfully

qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=reset
[/dev/cdc-wdm0] Operating mode set successfully

(reboots)

qmicli -d /dev/cdc-wdm0 --nas-get-system-selection-preference
Successfully got system selection preference
Emergency mode: 'no'
Mode preference: 'lte, td-scdma'
Band preference: 'gsm-dcs-1800, gsm-900-extended, wcdma-2100, wcdma-900'
LTE band preference: '1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17,
18, 19, 20, 21, 24, 25, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43'
TD-SCDMA band preference: 'a, b, c, d, e, f'
Roaming preference: 'any'
Network selection preference: 'automatic'
Service domain preference: 'cs-ps'
Service selection preference: 'automatic'


qmicli -d /dev/cdc-wdm0 --nas-get-technology-preference
[/dev/cdc-wdm0] Successfully got technology preference
Active: '3gpp, lte', duration: 'permanent'

(set umts as preferred)

qmicli -d /dev/cdc-wdm0 --nas-set-system-selection-preference="umts"

At this stage I got an error message - error: couldn't set operating mode:
QMI protocol error (3): 'Internal'

Only read commands seemed to work correctly then, setting mode to offline
gave error:
qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline
error: couldn't set operating mode: QMI protocol error (60):
'InvalidTransaction'

"Reset" said it worked but the modem did not appear to reset. I completed a
power cycle. Everything worked again. System was still set to LTE settings.

qmicli -d /dev/cdc-wdm0 --nas-set-system-selection-preference="umts"
[/dev/cdc-wdm0] System selection preference set successfully; replug your
device.

qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline
[/dev/cdc-wdm0] Operating mode set successfully

sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=reset
[/dev/cdc-wdm0] Operating mode set successfully

qmicli -d /dev/cdc-wdm0 --nas-get-system-selection-preference

[/dev/cdc-wdm0] Successfully got system selection preference
Emergency mode: 'no'
Mode preference: 'umts, lte, td-scdma'
Band preference: 'gsm-dcs-1800, gsm-900-extended, wcdma-2100, wcdma-900'
LTE band preference: '1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17,
18, 19, 20, 21, 24, 25, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43'
TD-SCDMA band preference: 'a, b, c, d, e, f'
Roaming preference: 'any'
Network selection preference: 'automatic'
Service domain preference: 'cs-ps'
Service selection preference: 'automatic'

qmicli -d /dev/cdc-wdm0 --nas-get-technology-preference
[/dev/cdc-wdm0] Successfully got technology preference
Active: '3gpp, cdma-or-wcdma, lte', duration: 'permanent'



Thanks for the help, I will do further testing on this.

--
Paul





On 15 February 2017 at 14:33, Aleksander Morgado <aleksander at aleksander.es>
wrote:

> Hey Paul,
>
> On Tue, Feb 14, 2017 at 3:26 PM, Paul Gildea <gildeap at tcd.ie> wrote:
> > I am trying to set the device to use a certain technology only, example
> UMTS
> > or LTE. However when I do so there are still other options available.
> >
> > Example: qmicli -d /dev/cdc-wdm0 --nas-set-system-selection-
> preference=umts
> > and rebooting will give a mode list of umts, lte, td-scdma via  qmicli -d
> > /dev/cdc-wdm0 --nas-get-technology-preference instead of just UMTS.
> >
> > If I then set it to LTE I will get "lte, td-scdma" instead of just LTE.
> Is
> > there something I am missing? I will check the code further to try and
> solve
> > this.
>
> Would be good to get debug logs of all commands you use (run them with
> --verbose), just to make sure the messages sent/received are the
> expected ones.
>
> Note that technology preference (TP) and system selection preference
> (SSP) are two ways of trying to get the same result. In ModemManager
> we use SSP when available, and TP otherwise. Also note that there is a
> "NAS Set Technology Preference" command in QMI, we just didn't
> implement a --nas-set-technology-preference.
>
> For reference, this is what I'm getting when setting preference to
> umts vs LTE in a MC7455:
>
> (set LTE as preferred)
>
> $ sudo qmicli -d /dev/cdc-wdm4 --nas-get-system-selection-preference
> Emergency mode: 'no'
> Mode preference: 'umts, lte'
> Band preference: 'wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800,
> wcdma-1700-us, wcdma-850-us, wcdma-900'
> LTE band preference: '1, 2, 3, 4, 5, 7, 8, 12, 13, 20, 25, 41'
> TD-SCDMA band preference: '(null)'
> Roaming preference: 'any'
> Network selection preference: 'automatic'
> Service domain preference: 'cs-ps'
> Service selection preference: 'automatic'
>
> $ sudo qmicli -d /dev/cdc-wdm4 --nas-get-technology-preference
> Active: 'auto', duration: 'permanent'
>
> $ sudo qmicli -d /dev/cdc-wdm4 --nas-set-system-selection-preference="lte"
> $ sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=offline
> $ sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=reset
>
> (reboots)
>
> $ sudo qmicli -d /dev/cdc-wdm4 --nas-get-system-selection-preference
> Emergency mode: 'no'
> Mode preference: 'lte'
> Band preference: 'wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800,
> wcdma-1700-us, wcdma-850-us, wcdma-900'
> LTE band preference: '1, 2, 3, 4, 5, 7, 8, 12, 13, 20, 25, 41'
> TD-SCDMA band preference: '(null)'
> Roaming preference: 'any'
> Network selection preference: 'automatic'
> Service domain preference: 'cs-ps'
> Service selection preference: 'automatic'
>
> $ sudo qmicli -d /dev/cdc-wdm4 --nas-get-technology-preference
> Active: '3gpp, lte', duration: 'permanent'
>
>
> (set umts as preferred)
>
> $ sudo qmicli -d /dev/cdc-wdm4 --nas-set-system-selection-
> preference="umts"
> $ sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=offline
> $ sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=reset
>
> $ sudo qmicli -d /dev/cdc-wdm4 --nas-get-system-selection-preference
> Emergency mode: 'no'
> Mode preference: 'umts'
> Band preference: 'wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800,
> wcdma-1700-us, wcdma-850-us, wcdma-900'
> LTE band preference: '1, 2, 3, 4, 5, 7, 8, 12, 13, 20, 25, 41'
> TD-SCDMA band preference: '(null)'
> Roaming preference: 'any'
> Network selection preference: 'automatic'
> Service domain preference: 'cs-ps'
> Service selection preference: 'automatic'
>
> $ sudo qmicli -d /dev/cdc-wdm4 --nas-get-technology-preference
> Active: '3gpp, cdma-or-wcdma', duration: 'permanent'
>
> --
> Aleksander
> https://aleksander.es
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20170215/6af50910/attachment.html>


More information about the libqmi-devel mailing list