After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636040 - Query signal strength with +CIND if modem does not support +CSQ
Query signal strength with +CIND if modem does not support +CSQ
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: ModemManager
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
Depends on:
Blocks:
 
 
Reported: 2010-11-29 08:22 UTC by Amit Mendapara
Modified: 2012-10-05 12:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
modem-manager --debug (17.03 KB, text/x-log)
2010-11-29 08:48 UTC, Amit Mendapara
  Details
minicom.log (447 bytes, text/x-log)
2010-11-29 10:04 UTC, Amit Mendapara
  Details
modem-manager --debug (8.00 KB, text/x-log)
2010-12-01 07:26 UTC, Amit Mendapara
  Details
fixes cind tests (2.06 KB, patch)
2010-12-04 09:31 UTC, Amit Mendapara
none Details | Review
0-based index (1.26 KB, patch)
2010-12-04 17:02 UTC, Amit Mendapara
none Details | Review

Description Amit Mendapara 2010-11-29 08:22:42 UTC
Some 3G modem devices only support AT+CIND to report signal strength, for example the Teracom (Linktop LW273) devices distributed by BSNL in India, only reports signal strength of UMTS network via AT+CIND command.

It will be great if ModemManager add support for CIND by default and fallback to CSQ if CIND is not supported. This is already the behavior of OFONO.

See the original bug report here (https://bugs.launchpad.net/modemmanager/+bug/682282).
Comment 1 Amit Mendapara 2010-11-29 08:48:58 UTC
Created attachment 175450 [details]
modem-manager --debug

The +CIND support which has been added in revision dc95f531adc38166cb4ec0ec08e40527dd04385a doesn't work with my device. Here I am attaching the modem-manager debug log (tested with rev 1df1ff38b0ad93d80647895115251033ffc38e65).
Comment 2 Amit Mendapara 2010-11-29 10:04:24 UTC
Created attachment 175452 [details]
minicom.log

When the device connects to UMTS network (3G mode) the +CSQ always returns +CSQ: 99, 99 but +CIND works fine. Here is the output of minicom session where I tried few AT commands manually.

You can see in the log that when I switch to 3G mode with AT+CFUN=6 then +CSQ always returns +CSQ: 99, 99 while +CIND works perfect.
Comment 3 Dan Williams 2010-11-30 16:08:31 UTC
Ok, lets try:

ea0797cbec7cae4d93807e8ac3a796650ff209a9

which will prefer +CIND when the modem supports it.  Let me know!
Comment 4 Amit Mendapara 2010-12-01 07:26:35 UTC
Created attachment 175606 [details]
modem-manager --debug

I have just tested the latest revision and it's now working perfect. Here I am attaching the debug log.

Thanks for the quick fix!
Comment 5 Amit Mendapara 2010-12-04 09:31:50 UTC
Created attachment 175826 [details] [review]
fixes cind tests

This fixes various CIND related tests
Comment 6 Amit Mendapara 2010-12-04 14:16:43 UTC
Hi Dan,

I have few questions regarding this improvements. Why do you use 1-based indexes in `mm_parse_cind_query_response`? This breaks the modem-helper tests. I tried with 0-based indexes then everything works perfect.

Another issue, my device (LW273) doesn't work perfect with CIEV events when using CIND. However, the issue is random. What happens is, when device get connected , the ciev callback is not called anymore but when I disconnect the device I see a long CIEV output like this:


** (modem-manager:21714): DEBUG: <1291471991.490274> (ttyACM1): <-- '<CR><LF>+CIEV: 2,1<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF><CR><LF>+CIEV: 2,2<CR><LF>'


So I disabled CIEV feature and tried with CIND only then it was working perfect without any random issue.
Comment 7 Amit Mendapara 2010-12-04 16:53:45 UTC
I confirm that there is something wrong with unsolicited message handlers. If I disable CIEV messages with +CMER=0 then CIND is working perfect.

However, +CIND and +CIEV both works find in oFono so I think it's ModemManager issue.
Comment 8 Amit Mendapara 2010-12-04 17:02:34 UTC
Created attachment 175843 [details] [review]
0-based index

BTW, here is another patch to fix the +CIND, +CIEV index issue.
Comment 9 Dan Williams 2010-12-16 00:24:57 UTC
The indexes are 1-based because the modem's CIEV response uses 1-based indexes.  I figured it would be easier that way, hopefully it's not the cause of a bug.  I tested the CIEV/CIND/CMER handling with two different devices that support this reporting (Ericsson MBM and a Sierra device) and it seemed to work well there.

Do these patches actually fix the issue for you, or is there still a problem?
Comment 10 Amit Mendapara 2010-12-16 04:59:38 UTC
No it doesn't but just fixes the unit test where 0-based index is used.
Comment 11 Amit Mendapara 2010-12-25 05:53:38 UTC
It seems that you have fixed the +CIND test keeping 1-based indices. It resolved the issue.
Comment 12 Marius Kotsbak 2012-10-03 11:08:32 UTC
Seems like the fix for this bug is creating problems for LTE modems, where +CSQ works, but +CIND not:

https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/1060831
Comment 13 Dan Williams 2012-10-04 13:11:49 UTC
(In reply to comment #12)
> Seems like the fix for this bug is creating problems for LTE modems, where +CSQ
> works, but +CIND not:
> 
> https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/1060831

Possible 0.6 hack: if CIND reports 0 strength, try CSQ too?
Comment 14 Dan Williams 2012-10-04 13:32:56 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > Seems like the fix for this bug is creating problems for LTE modems, where +CSQ
> > works, but +CIND not:
> > 
> > https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/1060831
> 
> Possible 0.6 hack: if CIND reports 0 strength, try CSQ too?

Marius, can you try current MM_06 head?
Comment 15 Marius Kotsbak 2012-10-04 14:39:55 UTC
The hack seems to work fine, thanks. Note to downstream: required commits (MM_06):

From 1dee45e011cc8c0627597aa75110500983aae486 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Thu, 04 Oct 2012 14:20:46 +0000
Subject: trivial: move CIND processing function down a bit

Makes the next change clearer.

From 8bd6903c30e52e65a4afbebf85ba59e6c0fada71 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Thu, 04 Oct 2012 14:34:01 +0000
Subject: gsm: fall back to +CSQ if +CIND reports no signal (bgo #636040)

Some devices say they support +CIND signal reporting, but either
actually don't, or they report signal for a non-current access
technology that we don't care about.  So if +CIND reports zero
signal, fall back to +CSQ.
Comment 16 Aleksander Morgado 2012-10-05 10:37:28 UTC
Just wondering; should I cherry-pick this new commit for git master? Have we seen this behaviour in non-QMI LTE modems?
Comment 17 Marius Kotsbak 2012-10-05 11:55:10 UTC
Aleksander, yes please do that. I see the same problem in git master: "signal quality: '0'". Remember that some of the QMI based LTE modems can be used with AT commands as well (if qmi_wwan driver is not available, or if libqmi is unavailable?), and some can be switched between QMI and AT mode.
Comment 18 Aleksander Morgado 2012-10-05 12:34:29 UTC
Done; fix is also in git master now.