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 637140 - Linktop HSPADataCard: use secondary port for data
Linktop HSPADataCard: use secondary port for data
Status: RESOLVED NOTGNOME
Product: NetworkManager
Classification: Platform
Component: ModemManager
git master
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-12-13 10:53 UTC by Amit Mendapara
Modified: 2014-10-14 10:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
modem-manager --debug (20.33 KB, text/x-log)
2010-12-16 06:10 UTC, Amit Mendapara
  Details
modem-manager --debug (CIEV disabled) (19.50 KB, text/x-log)
2010-12-16 06:18 UTC, Amit Mendapara
  Details
Use secondary port if available (1.49 KB, patch)
2010-12-23 18:09 UTC, Amit Mendapara
none Details | Review
Use secondary port if available (3.31 KB, patch)
2010-12-24 10:42 UTC, Amit Mendapara
none Details | Review
modem-manager --debug (33.05 KB, text/x-log)
2011-01-24 08:49 UTC, Amit Mendapara
  Details
wvdial.conf (313 bytes, text/plain)
2011-01-24 14:54 UTC, Amit Mendapara
  Details
ofono log (22.20 KB, text/x-log)
2011-02-03 14:46 UTC, Amit Mendapara
  Details
windows-modem-log (108.11 KB, text/x-log)
2011-05-29 06:58 UTC, Amit Mendapara
  Details

Description Amit Mendapara 2010-12-13 10:53:13 UTC
I think there is some issue with unsolicited message handling. ModemManager fails to handle +CIEV messages enabled with +CMER if +CIND is supported by the device.

See my comment (https://bugzilla.gnome.org/show_bug.cgi?id=636040#c6). It also prevent +CIND to function properly. I tried with removing CMER/CIEV feature then +CIND signal reporting works perfect.

I don't this as device issue because this works fine with OFONO. I think unsolicited message handling should be improved or modem-manager should provide a way to disable unsolicited message handling via plugin.
Comment 1 Dan Williams 2010-12-16 00:26:50 UTC
Could you attach full --debug output from modem-manager so I can take a look and see if there's something else going wrong?  I'd like to see what happens after connect with both ports.
Comment 2 Amit Mendapara 2010-12-16 06:10:36 UTC
Created attachment 176515 [details]
modem-manager --debug

You can see after connection is established the +CIND responses are missing and +CIEV messages are blocked but when I disconnect the device those +CIEV messages are printed.
Comment 3 Amit Mendapara 2010-12-16 06:18:13 UTC
Created attachment 176516 [details]
modem-manager --debug (CIEV disabled)

And here is the debug output of modem-manager where I disabled the CIEV messages (removed that code from the source). You can see now the +CIND responses are properly handled.

I have also tested with latest build of oFono that successfully handles both +CIND & +CIEV responses without such issue. So I don't think it's a device issue.
Comment 4 Amit Mendapara 2010-12-23 17:32:19 UTC
I think, the issue is, +CMER is issued to the primary port which is then used for data connection. The primary port can't be used for AT commands once connection is established.

So in my opinion, unsolicited message handlers should be registered with secondary port.
Comment 5 Amit Mendapara 2010-12-23 18:09:52 UTC
Created attachment 176958 [details] [review]
Use secondary port if available

I am not sure whether this is the right approach but it has solved the issue and now +CIEV messages are handled properly.
Comment 6 Amit Mendapara 2010-12-24 10:42:23 UTC
Created attachment 176996 [details] [review]
Use secondary port if available

Consider +CREG and +CGREG as well.
Comment 7 Amit Mendapara 2011-01-12 05:46:55 UTC
Hi Dan,

Would you please review this patch? It's working perfect with my device. Please also have a look at bug #637934 which is another major issue with these devices.

Regards
--
Amit
Comment 8 Dan Williams 2011-01-24 05:38:34 UTC
So I think we should do it a bit differently, since we can't always trust modems to do the right thing, especially with secondary ports.  Some modems will say they support enabling on the secondary port, but they actually use a minimal command parser on those ports and don't send the unsolicited codes (like some Sierra modems).  So instead, I pushed:

476cc44bc1c991b9ad940d1de9cb42baf93555ab

to fix that.  Can you test it out and see if that fixes the issue for you with this modem?
Comment 9 Amit Mendapara 2011-01-24 08:49:59 UTC
Created attachment 179136 [details]
modem-manager --debug

Unfortunately the fix doesn't work with my device. I have observed that it works only if exclusively registered to the secondary port.

If there is no standard way, I think, plugins should be allowed to select proper ports otherwise there will be lots of duplication in plugin code.
Comment 10 Amit Mendapara 2011-01-24 14:54:05 UTC
Created attachment 179174 [details]
wvdial.conf

After reverse engineering the binary (32bit only) package that comes with the device and sniffing the usb ports. I found some interesting facts about this device.

It has two ports with same capabilities. Either of the port can be used for AT commands (as a control port) or for communication (as data port).

After sniffing the ports, I found that the /dev/ttyACM1 is used for almost every AT commands including switching the preferred mode to register the network to check the signal quality. And /dev/ttyACM0 is used to send only two AT commands:

1. AT
OK
2. ATDT*99#
+DR: NONE
CONNECT
..
..

Clearly, this is a dial command to start communication. So decided to test it manually using wvdial and it worked. Here the wvdial.conf that I have used to test the device.

So, I think, if there is any way to use the secondary port to dial the number, there is no need to make these changes. I tried with custom `do_connect` function in mm-modem-linktop.c which is then attached to the modem class in `modem_init` but that doesn't work.

Would you suggest me a proper way to ensure that the secondary port will be used to dial the number?
Comment 11 Amit Mendapara 2011-02-03 14:46:13 UTC
Created attachment 179991 [details]
ofono log

I have implemented ofono plugin for this modem and it's working exactly as it should (not integrated yet). Here I am attaching ofono log. You can see that the control port is used for most of the AT commands while modem port is used just for making connection. Also, the CIEV messages are received on control port only.
Comment 12 Amit Mendapara 2011-05-29 06:58:15 UTC
Created attachment 188825 [details]
windows-modem-log

Here I am attaching the log of the windows modem application that comes with this device.
Comment 13 Dan Williams 2013-03-27 22:56:38 UTC
What was should probably do here is tag this specific device like we tag ZTE and other devices, to specify which port should be data and which port should be primary.
Comment 14 Aleksander Morgado 2013-05-08 08:00:13 UTC
So this modem should use the secondary port as Data port. Is this something applicable to all Linktop modems, or just to this specific model?
Comment 15 Dan Williams 2013-05-08 16:32:12 UTC
It's not applicable to all devices; none of mine care which port gets used.
Comment 16 Aleksander Morgado 2014-10-14 10:17:12 UTC
Moving bugreport to the new ModemManager bugzilla in fd.o; summarized the issue
there as well. Please subscribe to the new bugreport to get new updates.

https://bugs.freedesktop.org/show_bug.cgi?id=84980

Closing this report as NOTGNOME.