<div dir="ltr"><div>Hi Aleksander,</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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. </div><div><br></div><div><br></div><div>--- libqmi-1.16.2/src/qmicli/qmicli-helpers.c<span class="gmail-Apple-tab-span" style="white-space:pre">    </span>2017-02-15 13:01:37.188665609 +0000</div><div>+++ libqmi-mod/src/qmicli/qmicli-helpers.c<span class="gmail-Apple-tab-span" style="white-space:pre">  </span>2017-02-15 14:34:45.204579991 +0000</div><div>@@ -188,6 +188,11 @@</div><div>     type = qmi_nas_rat_mode_preference_get_type ();</div><div>     flags_class = G_FLAGS_CLASS (g_type_class_ref (type));</div><div> </div><div>+    /* Mask technology preference bits to 0, some can be set high in err, reset them.</div><div>+     * See QmiNasRatModePreference Enum for reference   </div><div>+     *</div><div>+    *out &= 0xFFFFFFC0;</div><div>+</div><div>     items = g_strsplit_set (str, "|", 0);</div><div>     for (iter = items; iter && *iter && success; iter++) {</div><div>         if (!*iter[0])</div><div><br></div><div><br></div><div>Here is the same process you went through, you can see the problems with mine:</div><div>(set LTE as preferred)</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --nas-get-system-selection-preference</div><div>[/dev/cdc-wdm0] Successfully got system selection preference</div><div>Emergency mode: 'no'</div><div>Mode preference: 'umts, lte, td-scdma'</div><div>Band preference: 'gsm-dcs-1800, gsm-900-extended, wcdma-2100, wcdma-900'</div><div>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'</div><div>TD-SCDMA band preference: 'a, b, c, d, e, f'</div><div>Roaming preference: 'any'</div><div>Network selection preference: 'automatic'</div><div>Service domain preference: 'cs-ps'</div><div>Service selection preference: 'automatic'</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --nas-get-technology-preference</div><div>[/dev/cdc-wdm0] Successfully got technology preference</div><div>Active: '3gpp, cdma-or-wcdma, lte', duration: 'permanent'</div><div><br></div><div><br></div><div>qmicli -d /dev/cdc-wdm0  --nas-set-system-selection-preference="lte"</div><div>[/dev/cdc-wdm0] System selection preference set successfully; replug your device.</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline</div><div>[/dev/cdc-wdm0] Operating mode set successfully</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=reset</div><div>[/dev/cdc-wdm0] Operating mode set successfully</div><div><br></div><div>(reboots)</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --nas-get-system-selection-preference</div><div>Successfully got system selection preference</div><div>Emergency mode: 'no'</div><div>Mode preference: 'lte, td-scdma'</div><div>Band preference: 'gsm-dcs-1800, gsm-900-extended, wcdma-2100, wcdma-900'</div><div>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'</div><div>TD-SCDMA band preference: 'a, b, c, d, e, f'</div><div>Roaming preference: 'any'</div><div>Network selection preference: 'automatic'</div><div>Service domain preference: 'cs-ps'</div><div>Service selection preference: 'automatic'</div><div><br></div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --nas-get-technology-preference</div><div>[/dev/cdc-wdm0] Successfully got technology preference</div><div>Active: '3gpp, lte', duration: 'permanent'</div><div><br></div><div>(set umts as preferred)</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --nas-set-system-selection-preference="umts"</div><div><br></div><div>At this stage I got an error message - error: couldn't set operating mode: QMI protocol error (3): 'Internal'</div><div><br></div><div>Only read commands seemed to work correctly then, setting mode to offline gave error:</div><div>qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline</div><div>error: couldn't set operating mode: QMI protocol error (60): 'InvalidTransaction'</div><div><br></div><div>"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.</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --nas-set-system-selection-preference="umts"</div><div>[/dev/cdc-wdm0] System selection preference set successfully; replug your device.</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline</div><div>[/dev/cdc-wdm0] Operating mode set successfully</div><div><br></div><div>sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=reset</div><div>[/dev/cdc-wdm0] Operating mode set successfully</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --nas-get-system-selection-preference </div><div><br></div><div>[/dev/cdc-wdm0] Successfully got system selection preference</div><div>Emergency mode: 'no'</div><div>Mode preference: 'umts, lte, td-scdma'</div><div>Band preference: 'gsm-dcs-1800, gsm-900-extended, wcdma-2100, wcdma-900'</div><div>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'</div><div>TD-SCDMA band preference: 'a, b, c, d, e, f'</div><div>Roaming preference: 'any'</div><div>Network selection preference: 'automatic'</div><div>Service domain preference: 'cs-ps'</div><div>Service selection preference: 'automatic'</div><div><br></div><div>qmicli -d /dev/cdc-wdm0 --nas-get-technology-preference</div><div>[/dev/cdc-wdm0] Successfully got technology preference</div><div>Active: '3gpp, cdma-or-wcdma, lte', duration: 'permanent'</div><div><br></div><div><br></div><div><br></div><div>Thanks for the help, I will do further testing on this.</div><div><br></div><div>--</div><div>Paul</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 February 2017 at 14:33, Aleksander Morgado <span dir="ltr"><<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Paul,<br>
<span class=""><br>
On Tue, Feb 14, 2017 at 3:26 PM, Paul Gildea <<a href="mailto:gildeap@tcd.ie">gildeap@tcd.ie</a>> wrote:<br>
> I am trying to set the device to use a certain technology only, example UMTS<br>
> or LTE. However when I do so there are still other options available.<br>
><br>
> Example: qmicli -d /dev/cdc-wdm0 --nas-set-system-selection-<wbr>preference=umts<br>
> and rebooting will give a mode list of umts, lte, td-scdma via  qmicli -d<br>
> /dev/cdc-wdm0 --nas-get-technology-<wbr>preference instead of just UMTS.<br>
><br>
> If I then set it to LTE I will get "lte, td-scdma" instead of just LTE. Is<br>
> there something I am missing? I will check the code further to try and solve<br>
> this.<br>
<br>
</span>Would be good to get debug logs of all commands you use (run them with<br>
--verbose), just to make sure the messages sent/received are the<br>
expected ones.<br>
<br>
Note that technology preference (TP) and system selection preference<br>
(SSP) are two ways of trying to get the same result. In ModemManager<br>
we use SSP when available, and TP otherwise. Also note that there is a<br>
"NAS Set Technology Preference" command in QMI, we just didn't<br>
implement a --nas-set-technology-<wbr>preference.<br>
<br>
For reference, this is what I'm getting when setting preference to<br>
umts vs LTE in a MC7455:<br>
<br>
(set LTE as preferred)<br>
<br>
$ sudo qmicli -d /dev/cdc-wdm4 --nas-get-system-selection-<wbr>preference<br>
Emergency mode: 'no'<br>
Mode preference: 'umts, lte'<br>
Band preference: 'wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800,<br>
wcdma-1700-us, wcdma-850-us, wcdma-900'<br>
LTE band preference: '1, 2, 3, 4, 5, 7, 8, 12, 13, 20, 25, 41'<br>
TD-SCDMA band preference: '(null)'<br>
Roaming preference: 'any'<br>
Network selection preference: 'automatic'<br>
Service domain preference: 'cs-ps'<br>
Service selection preference: 'automatic'<br>
<br>
$ sudo qmicli -d /dev/cdc-wdm4 --nas-get-technology-<wbr>preference<br>
Active: 'auto', duration: 'permanent'<br>
<br>
$ sudo qmicli -d /dev/cdc-wdm4 --nas-set-system-selection-<wbr>preference="lte"<br>
$ sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=<wbr>offline<br>
$ sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=reset<br>
<br>
(reboots)<br>
<br>
$ sudo qmicli -d /dev/cdc-wdm4 --nas-get-system-selection-<wbr>preference<br>
Emergency mode: 'no'<br>
Mode preference: 'lte'<br>
Band preference: 'wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800,<br>
wcdma-1700-us, wcdma-850-us, wcdma-900'<br>
LTE band preference: '1, 2, 3, 4, 5, 7, 8, 12, 13, 20, 25, 41'<br>
TD-SCDMA band preference: '(null)'<br>
Roaming preference: 'any'<br>
Network selection preference: 'automatic'<br>
Service domain preference: 'cs-ps'<br>
Service selection preference: 'automatic'<br>
<br>
$ sudo qmicli -d /dev/cdc-wdm4 --nas-get-technology-<wbr>preference<br>
Active: '3gpp, lte', duration: 'permanent'<br>
<br>
<br>
(set umts as preferred)<br>
<br>
$ sudo qmicli -d /dev/cdc-wdm4 --nas-set-system-selection-<wbr>preference="umts"<br>
$ sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=<wbr>offline<br>
$ sudo qmicli -d /dev/cdc-wdm4 --dms-set-operating-mode=reset<br>
<br>
$ sudo qmicli -d /dev/cdc-wdm4 --nas-get-system-selection-<wbr>preference<br>
Emergency mode: 'no'<br>
Mode preference: 'umts'<br>
Band preference: 'wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800,<br>
wcdma-1700-us, wcdma-850-us, wcdma-900'<br>
LTE band preference: '1, 2, 3, 4, 5, 7, 8, 12, 13, 20, 25, 41'<br>
TD-SCDMA band preference: '(null)'<br>
Roaming preference: 'any'<br>
Network selection preference: 'automatic'<br>
Service domain preference: 'cs-ps'<br>
Service selection preference: 'automatic'<br>
<br>
$ sudo qmicli -d /dev/cdc-wdm4 --nas-get-technology-<wbr>preference<br>
Active: '3gpp, cdma-or-wcdma', duration: 'permanent'<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Aleksander<br>
<a href="https://aleksander.es" rel="noreferrer" target="_blank">https://aleksander.es</a><br>
</font></span></blockquote></div><br></div>