Re: Re: Unable to set preferred mode to 4G from ModemManager for Quectel BG96

2021-12-07 Thread Aleksander Morgado
Hey

>
> Attached are my log files from MM and qmi-proxy.
>
> This time when I set the preferred mode to 2G via MM, the sequence from 
> AT-cmd did not change (first 4G then 2G). And after setting to 4G, the 
> sequence from modem changed to: first 2G then 4G. See my test sequence below.
>
>
> # mmcli -m 0 --set-allowed-modes='2g|4g' --set-preferred-mode='2g'
>
> successfully set current modes in the modem
>
> # mmcli -m 0 --command="AT+QCFG=\"nwscanseq\""
>
> response: '+QCFG: "nwscanseq",020301'
>
> # mmcli -m 0 --set-allowed-modes='2g|4g' --set-preferred-mode='4g'
>
> successfully set current modes in the modem
>
> # mmcli -m 0 --command="AT+QCFG=\"nwscanseq\""
>
> response: '+QCFG: "nwscanseq",010203'
>

In the log you provided there is only one "Set System Selection
Preference" command, the one switching it to "2G+4G with 2G
preferred". There is no other command for the 2nd operation, and that
means this is very likely a bug in ModemManager. I've opened a new
issue: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/473

-- 
Aleksander
https://aleksander.es


Aw: Re: Unable to set preferred mode to 4G from ModemManager for Quectel BG96

2021-12-01 Thread songwei . fu
Hi Alkesander,


 

Thanks for the advice. 

 

Attached are my log files from MM and qmi-proxy. 

 

This time when I set the preferred mode to 2G via MM, the sequence from AT-cmd did not change (first 4G then 2G). And after setting to 4G, the sequence from modem changed to: first 2G then 4G. See my test sequence below.

 


# mmcli -m 0 --set-allowed-modes='2g|4g' --set-preferred-mode='2g'

successfully set current modes in the modem

# mmcli -m 0 --command="AT+QCFG=\"nwscanseq\""

response: '+QCFG: "nwscanseq",020301'

# mmcli -m 0 --set-allowed-modes='2g|4g' --set-preferred-mode='4g'

successfully set current modes in the modem

# mmcli -m 0 --command="AT+QCFG=\"nwscanseq\""

response: '+QCFG: "nwscanseq",010203'

 

Usually only "set-preferred-mode='4g'" does not work for me. Maybe this is a speical test run. if you need logs from NetworkManager or from other test runs, just let me know and I will do more tests and send the logs.

Thanks,

Songwei


 

Gesendet: Mittwoch, 01. Dezember 2021 um 11:16 Uhr
Von: "Aleksander Morgado" 
An: songwei...@web.de
Cc: "ModemManager (development)" 
Betreff: Re: Unable to set preferred mode to 4G from ModemManager for Quectel BG96

Hey,

> 2. Then I set the priority to 2G. Both MM and AT-cmd shows the 2G has now priority.
>
> # mmcli -m 1 --set-allowed-modes='2g|4g' --set-preferred-mode='2g'
> successfully set current modes in the modem
> #
> # mmcli -m 1 --command="AT+QCFG=\"nwscanseq\""
> response: '+QCFG: "nwscanseq",010203'
>
> 3. Then I wanted to set the priority to 4G again. But could not do it with MM. AT comamnd shows the search sequence does not change. But the MM "thinks" the priority is already set back to 4G.
>
> # mmcli -m 1 --set-allowed-modes='2g|4g' --set-preferred-mode='4g'
> successfully set current modes in the modem
> #
> #
> # mmcli -m 1 --command="AT+QCFG=\"nwscanseq\""
> response: '+QCFG: "nwscanseq",010203'
>

We need to see what kind of QMI responses we get from the modem, maybe
there is something we're not processing right.
Could you please retry this sequence but with debugging enabled? see
https://modemmanager.org/docs/modemmanager/debugging/

--
Aleksander
https://aleksander.es


ModemManager[2138]:  [1638396501.096660] Periodic signal check refresh 
requested
ModemManager[2138]:  [1638396501.097207] loading signal quality...
ModemManager[2138]: [/dev/cdc-wdm0] sent message...
<< RAW:
<<   length = 13
<<   data   = 01:0C:00:00:03:03:00:0E:00:20:00:00:00
ModemManager[2138]: [/dev/cdc-wdm0] sent generic request (translated)...
<< QMUX:
<<   length  = 12
<<   flags   = 0x00
<<   service = "nas"
<<   client  = 3
<< QMI:
<<   flags   = "none"
<<   transaction = 14
<<   tlv_length  = 0
<<   message = "Get Signal Strength" (0x0020)
ModemManager[2138]: [/dev/cdc-wdm0] received message...
<< RAW:
<<   length = 25
<<   data   = 
01:18:00:80:03:03:02:0E:00:20:00:0C:00:02:04:00:00:00:00:00:01:02:00:B5:04
ModemManager[2138]: [/dev/cdc-wdm0] received generic response (translated)...
<< QMUX:
<<   length  = 24
<<   flags   = 0x80
<<   service = "nas"
<<   client  = 3
<< QMI:
<<   flags   = "response"
<<   transaction = 14
<<   tlv_length  = 12
<<   message = "Get Signal Strength" (0x0020)
<< TLV:
<<   type   = "Result" (0x02)
<<   length = 4
<<   value  = 00:00:00:00
<<   translated = SUCCESS
<< TLV:
<<   type   = "Signal Strength" (0x01)
<<   length = 2
<<   value  = B5:04
<<   translated = [ strength = '-75' radio_interface = 'gsm' ]
ModemManager[2138]:  [1638396501.136095] Signal strength (gsm): -75 dBm
ModemManager[2138]:  [1638396501.136409] Signal strength: -75 dBm --> 62%
ModemManager[2138]:  [1638396501.137125] Modem 
/org/freedesktop/ModemManager1/Modem/0: signal quality updated (62)
ModemManager[2138]:  [1638396501.137558] Periodic signal quality and 
access technology checks scheduled
ModemManager[2138]: [/dev/cdc-wdm0] sent message...
<< RAW:
<<   length = 20
<<   data   = 01:13:00:00:01:03:00:08:00:24:00:07:00:01:04:00:C0:00:00:00
ModemManager[2138]: [/dev/cdc-wdm0] sent generic request (translated)...
<< QMUX:
<<   length  = 19
<<   flags   = 0x00
<<   service = "wds"
<<   client  = 3
<< QMI:
<<   flags   = "none"
<<   transaction = 8
<<   tlv_length  = 7
<<   message = "Get Packet Statistics" (0x0024)
<< TLV:
<<   type   = "Mask" (0x01)
<<   length = 4
<<   value  = C0:00:00:00
<<   translated = tx-bytes-ok, rx-bytes-ok
ModemManager[2138]: [/dev/cdc-wdm0] received message...
<< RAW:
<<   length = 42
<<   data   = 
01:29:00:80:01:03:02:08:00:24:00:1D:00:02:04:00:00:00:00:00:19:08:00:D2:00:00:00:00:00:00:00:1A:08:00:00:00:00:00:00:00:00:00
ModemManager[2138]: [/dev/cdc-wdm0] received generic response (translated)...
<< QMUX:
<<   length  = 41
<< 

Re: Unable to set preferred mode to 4G from ModemManager for Quectel BG96

2021-12-01 Thread Aleksander Morgado
Hey,

> 2. Then I set the priority to 2G.  Both MM and AT-cmd shows the 2G has now 
> priority.
>
> # mmcli -m 1 --set-allowed-modes='2g|4g' --set-preferred-mode='2g'
> successfully set current modes in the modem
> #
> # mmcli -m 1 --command="AT+QCFG=\"nwscanseq\""
> response: '+QCFG: "nwscanseq",010203'
>
> 3. Then I wanted to set the priority to 4G again. But could not do it with 
> MM. AT comamnd shows the search sequence does not change. But the MM "thinks" 
> the priority is already set back to 4G.
>
> # mmcli -m 1 --set-allowed-modes='2g|4g' --set-preferred-mode='4g'
> successfully set current modes in the modem
> #
> #
> # mmcli -m 1 --command="AT+QCFG=\"nwscanseq\""
> response: '+QCFG: "nwscanseq",010203'
>

We need to see what kind of QMI responses we get from the modem, maybe
there is something we're not processing right.
Could you please retry this sequence but with debugging enabled? see
https://modemmanager.org/docs/modemmanager/debugging/

-- 
Aleksander
https://aleksander.es


Unable to set preferred mode to 4G from ModemManager for Quectel BG96

2021-11-30 Thread songwei . fu
Dear all,

 


We are facing a problem of setting the preferred mode to 4G from ModemManager for Quectel BG96. "mmcli --versoin" returns 1.12.6, nmcli version 1.20.4, and the FW on the modem is BG96MAR02A11M1G_01.016.01.016.

 


Setting the preferred mode to 2G is fine but setting back to 4G via MM does not change the priority sequence. Any idea why it happens? Is it a well-known problem and can I fix it by updating the MM? 

 

Thanks and best regards,

Songwei

 



The following are detailed information:

 

1. This is the initial state. Both MM and AT-cmd shows the 4G comes before 2G. 

 

# mmcli -m 1 --command="AT+QCFG=\"nwscanseq\""
response: '+QCFG: "nwscanseq",020301'
# mmcli -m 1 --command="AT+QCFG=\"nwscanmode\""
response: '+QCFG: "nwscanmode",0'
# mmcli -m 1
  
  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/1
           |            device id: 37db16a6a9ce688c0e0f3390071bd0ae24c2bdce
  
  Hardware |         manufacturer: Quectel
           |                model: 0
           |    firmware revision: BG96MAR02A11M1G
           |       carrier config: default
           |         h/w revision: 1
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: 868963043820877
  
  System   |               device: /sys/devices/platform/ahb/50.ehci/usb1/1-2
           |              drivers: qmi_wwan, option1
           |               plugin: Quectel
           |         primary port: cdc-wdm0
           |                ports: cdc-wdm0 (qmi), ttyUSB0 (qcdm), ttyUSB2 (at), wwan0 (net),
           |                       ttyUSB1 (gps), ttyUSB3 (at)
  
  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
           |                state: connected
           |          power state: on
           |          access tech: lte
           |       signal quality: 96% (recent)
  
  Modes    |            supported: allowed: 2g; preferred: none
           |                       allowed: 4g; preferred: none
           |                       allowed: 2g, 4g; preferred: 4g
           |                       allowed: 2g, 4g; preferred: 2g
           |              current: allowed: 2g, 4g; preferred: 4g
  
  Bands    |            supported: egsm, dcs, pcs, g850, eutran-1, eutran-2, eutran-3,
           |                       eutran-4, eutran-5, eutran-8, eutran-12, eutran-13, eutran-17,
           |                       eutran-18, eutran-19, eutran-20, eutran-26, eutran-28, eutran-39
           |              current: egsm, dcs, pcs, g850, eutran-1, eutran-2, eutran-3,
           |                       eutran-4, eutran-5, eutran-8, eutran-12, eutran-13, eutran-17,
           |                       eutran-18, eutran-19, eutran-20, eutran-26, eutran-28, eutran-39
  
  IP       |            supported: ipv4, ipv6, ipv4v6
  
  3GPP     |                 imei: 868963043820877
           |          operator id: 26201
           |        operator name: TDG
           |         registration: home
  
  3GPP EPS | ue mode of operation: csps-2
  
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/1
  
  Bearer   |            dbus path: /org/freedesktop/ModemManager1/Bearer/3
 

2. Then I set the priority to 2G.  Both MM and AT-cmd shows the 2G has now priority. 

 

# mmcli -m 1 --set-allowed-modes='2g|4g' --set-preferred-mode='2g'
successfully set current modes in the modem
#
# mmcli -m 1 --command="AT+QCFG=\"nwscanseq\""
response: '+QCFG: "nwscanseq",010203'

 

3. Then I wanted to set the priority to 4G again. But could not do it with MM. AT comamnd shows the search sequence does not change. But the MM "thinks" the priority is already set back to 4G.

 

# mmcli -m 1 --set-allowed-modes='2g|4g' --set-preferred-mode='4g'
successfully set current modes in the modem
#
#
# mmcli -m 1 --command="AT+QCFG=\"nwscanseq\""
response: '+QCFG: "nwscanseq",010203'

 

  
  Modes    |            supported: allowed: 2g; preferred: none
           |                       allowed: 4g; preferred: none
           |                       allowed: 2g, 4g; preferred: 4g
           |                       allowed: 2g, 4g; preferred: 2g
           |              current: allowed: 2g, 4g; preferred: 4g