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 694759 - modem port incorrectly detected as ttyUSB2
modem port incorrectly detected as ttyUSB2
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: ModemManager
0.9.8
Other Linux
: Normal normal
: ---
Assigned To: Aleksander Morgado
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-02-26 18:45 UTC by Tzafrir Cohen
Modified: 2013-02-27 11:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Log of a failed connection attampt (199.69 KB, text/plain)
2013-02-26 18:45 UTC, Tzafrir Cohen
  Details
Patch to add more logs (1.34 KB, patch)
2013-02-26 19:39 UTC, Aleksander Morgado
none Details | Review
Log of a failed connection attampt - traces using previous patch (66.94 KB, text/plain)
2013-02-26 20:19 UTC, Tzafrir Cohen
  Details
Patch for the issue (55.94 KB, patch)
2013-02-26 22:20 UTC, Aleksander Morgado
none Details | Review
Patch for the issue. (56.05 KB, patch)
2013-02-26 22:25 UTC, Aleksander Morgado
committed Details | Review

Description Tzafrir Cohen 2013-02-26 18:45:30 UTC
Created attachment 237465 [details]
Log of a failed connection attampt

wvdial works for this modem (using /dev/gsmmodem , set by usb-modeswitch). NetworkManager / ModemManager fail (see attached log). This repeats itself with various versions.

The problem seems to be basically that NM/MM connect to ttyUSB2 instead of ttyUSB4. If I tell wvdial to connect to ttyUSB2 instead, I get a similar result.


System: Debian Wheezy (7.0).

Packages installed on the system:

modemmanager   0.5.2.0-2
network-manage 0.9.4.0-10

In order to test this I stopped / killed them and built from git:

NetworkManager: Branch nm-0-9-8 (0.9.8.0-1-g3f3b99a)
ModemManager: Branch MM_06 (0.6.0-65-ge04ddef)

  ./configure --prefix=$PWD/root
  make
  make install DESTDIR=$PWD/destdir
  # or similar for ModemManager
  ln -s destdir/home/tzafrir/Proj/Packs/network-manager/NetworkManager/root .

which essentially allows me to run ./root/sbin/NetworkManager (and similar for ModemManager) with no fuss. Sadly I found no simpler shortcut.

The modem used is: 19d2:0124 ZTE WCDMA Technologies MSM

In /lib/udev/rules.d/77-mm-zte-port-types.rules I have:

ATTRS{idProduct}=="0124", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1"
ATTRS{idProduct}=="0124", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1"
 

From what I by adding debug prints, both ttyUSB2 and ttyUSB4 get ID_MM_ZTE_PORT_TYPE_MODEM set (plugins/mm-plugin-zte.c:grab_port() ).

I can't seem to find any other any udev rule that will set ID_MM_ZTE_PORT_TYPE_AUX for ttyUSB2.
Comment 1 Aleksander Morgado 2013-02-26 19:39:27 UTC
Created attachment 237468 [details] [review]
Patch to add more logs

The attached patch adds some more logs in the ZTE plugin when we look at the port type hints we get from udev. Could you apply the patch on top of MM_06 and re-run in debug mode? The udev rules seem to be ok, so just to make sure we read the flags properly... Thanks.
Comment 2 Tzafrir Cohen 2013-02-26 20:18:15 UTC
I used similar patches. Your patched missed the line '#include mm-log.h'

Relevant lines from the resulting log:

[mm-plugin-zte.c:173] grab_port(): ZTE: port 'ttyUSB1' flagged as secondary
[mm-plugin-zte.c:170] grab_port(): ZTE: port 'ttyUSB2' flagged as primary
[mm-plugin-zte.c:170] grab_port(): ZTE: port 'ttyUSB4' flagged as primary
[mm-plugin-zte.c:176] grab_port(): ZTE: port 'ttyUSB0' not flagged

Full log attached.

A few other extra details.

I also forgot the command-line I used:

 ( ./mm/ModemManager/root/sbin/modem-manager 2>&1 --debug --log-level=DEBUG & NM_PPP_DEBUG=1 ./NetworkManager/root/sbin/NetworkManager 2>&1 --no-daemon --log-level=DEBUG &) | tee nmlog

On each test I start MM and NM with the modem unplugged and then plug the modem.

After a while I run 'nmcli con up id GSM_golan' . The NetworkManager configuration I use is:
[connection]
type=gsm
id=GSM_golan
uuid=25b79b63-8dcf-488c-87a3-cb318fda701f
autoconnect=false

[gsm]
number = *99#
username = pcl@3g
password = pcl
apn = internet.golantelecom.net.il
Comment 3 Tzafrir Cohen 2013-02-26 20:19:20 UTC
Created attachment 237469 [details]
Log of a failed connection attampt - traces using previous patch
Comment 4 Aleksander Morgado 2013-02-26 20:25:11 UTC
> Relevant lines from the resulting log:
> 
> [mm-plugin-zte.c:173] grab_port(): ZTE: port 'ttyUSB1' flagged as secondary
> [mm-plugin-zte.c:170] grab_port(): ZTE: port 'ttyUSB2' flagged as primary
> [mm-plugin-zte.c:170] grab_port(): ZTE: port 'ttyUSB4' flagged as primary
> [mm-plugin-zte.c:176] grab_port(): ZTE: port 'ttyUSB0' not flagged
> 

Now, that's weird. I actually can reproduce it here with a ZTE modem I have, two ports get tagged as primary instead of one.
Comment 5 Aleksander Morgado 2013-02-26 22:20:59 UTC
Created attachment 237475 [details] [review]
Patch for the issue

Please test with the attached patch (on top of the previous one).

Make sure you reload the udev rules (e.g. with "sudo udevadm control --reload-rules") and also restart MM and replug the modem.
Comment 6 Aleksander Morgado 2013-02-26 22:25:49 UTC
Created attachment 237476 [details] [review]
Patch for the issue.

Minor change in the commit log fixing a bit the explanation.
Comment 7 Dan Williams 2013-02-26 23:49:44 UTC
That's just bizarre.  Nice find; please commit.
Comment 8 Tzafrir Cohen 2013-02-27 10:57:37 UTC
Works here as well. Thanks.
Comment 9 Aleksander Morgado 2013-02-27 11:16:31 UTC
Pushed to MM_06 and git master.

This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.