GNOME Bugzilla – Bug 694759
modem port incorrectly detected as ttyUSB2
Last modified: 2013-02-27 11:16:31 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.
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.
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
Created attachment 237469 [details] Log of a failed connection attampt - traces using previous patch
> 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.
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.
Created attachment 237476 [details] [review] Patch for the issue. Minor change in the commit log fixing a bit the explanation.
That's just bizarre. Nice find; please commit.
Works here as well. Thanks.
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.