Bug 817504 - ZTE MF60 3G Modem Not Working Without Boot Parameters
Summary: ZTE MF60 3G Modem Not Working Without Boot Parameters
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ModemManager
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-30 10:03 UTC by Marko Myllynen
Modified: 2015-04-07 07:40 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-07 07:40:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
dmesg output without boot params (2.17 KB, text/plain)
2012-04-30 10:05 UTC, Marko Myllynen
no flags Details
dmesg output with boot params (2.04 KB, text/plain)
2012-04-30 10:07 UTC, Marko Myllynen
no flags Details
lsusb output (5.97 KB, text/plain)
2012-06-25 18:11 UTC, Marko Myllynen
no flags Details
zte-log.txt (8.17 KB, text/plain)
2014-01-14 15:51 UTC, Marko Myllynen
no flags Details
zte-log-2.txt (11.00 KB, text/plain)
2014-02-26 10:53 UTC, Marko Myllynen
no flags Details
zte-mm-nm-debug.txt (126.65 KB, text/plain)
2014-03-10 16:43 UTC, Marko Myllynen
no flags Details

Description Marko Myllynen 2012-04-30 10:03:14 UTC
Description of problem:
When plugging in ZTE MF60 3G Modem with USB cable without any special boot parameters the standard storage dialog to either Open with Files or Eject is presented. If Eject is selected the device is still not recognized by NetworkManager.

When booting up with usbserial.vendor=0x19d2 usbserial.product=0x1402 boot parameters, plugging in the modem and selecting Eject, NetworkManager quickly detects the modem and it is shown under the Mobile Broadband menu, Internet access works then perfectly.

Adding new usb_modeswitch rules at /etc/usb_modeswitch.d/19d2:2000 and/or /lib/udev/rules.d/40-usb_modeswitch.rules does not seem to affect in any way how the device works (as there exists a rule for 19d2:2000 already).

There has been discussion elsewhere about this device:

http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=793
http://lists.freedesktop.org/archives/libqmi-devel/2012-March/000013.html

It is also worth to note that Ubuntu switched back from usbserial being built-in to build it as kernel module again due to many 3G modems not working:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/345002
http://packages.ubuntu.com/precise/i386/linux-image-3.2.0-23-generic/filelist


Dan, it might be that there's nothing NetworkManager can do about this but I'm filing this initially against NM to let you provide suggestions how to proceed with this one.


I'll attach the dmesg output for both cases described above.

Version-Release number of selected component (if applicable):
Fedora 17

Comment 1 Marko Myllynen 2012-04-30 10:05:41 UTC
Created attachment 581166 [details]
dmesg output without boot params

dmesg output without boot parameters after connecting the modem and selecting Eject in the dialog. NM does not recognize the device.

Comment 2 Marko Myllynen 2012-04-30 10:07:00 UTC
Created attachment 581167 [details]
dmesg output with boot params

dmesg output with boot parameters after connecting the modem and selecting Eject in the dialog. NM correctly recognizes the device and allows accessing Internet using Mobile Broadband.

Comment 3 Dan Williams 2012-06-25 15:08:15 UTC
Can you attach 'lsusb -v -d 19d2:1402' to the bug after doing the 'eject' sequence?

It likely is a kernel driver issue of not handling the IDs correctly.  Also, usbserial is not the correct driver here, as that will give you lower performance than 'option'.

Comment 4 Marko Myllynen 2012-06-25 18:11:19 UTC
Created attachment 594252 [details]
lsusb output

> Can you attach 'lsusb -v -d 19d2:1402' to the bug after doing the 'eject' sequence?

Sure, done.

Comment 5 Dan Williams 2012-08-08 17:34:59 UTC
Added upstream to the Option driver on 2012-07-02 in commit 8e16e33c.

    USB: option: add ZTE MF60
    
    Switches into a composite device by ejecting the initial
    driver CD.  The four interfaces are: QCDM, AT, QMI/wwan
    and mass storage.  Let this driver manage the two serial
    interfaces:
    
Unfortunately that means it's only in 3.5 and later.  That said, it *should* work if you force-bind it to usbserial or option, but only ttyUSB1 is expected to use AT commands, and ttyUSB0 is expected to be QCDM.  In 3.5 cdc_wdm and qmi_wwan will bind to the third USB interface.  There should never be more than two "tty" interface exposed by this device; the problem with option is that it's quite aggressive and only recently has the capability to bind only to specific interfaces where the vendor hasn't bothered to give each interface a different type.

We also might be running into usb_modeswitch's force-binding option; does it consistently work if you move usb_modeswitch out of the way and always "eject /dev/sr1"?

Comment 6 Fedora End Of Life 2013-07-03 21:59:48 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 JanS 2013-07-13 09:44:39 UTC
I just did managed to make ZTE MF60 modeswitch after being plugged in into Fedora 17. This could be treated as a workaround, since there is clearly something I do not understand about the difference between ATTR and ATTRS in udev.

The problem was, that udev rule for device 19d2:2000 (in /lib/udev/rules.d/40-usb_modeswitch.rules) was not starting. The rule is:

 ATTRS{bInterfaceNumber}=="03", ATTRS{bInterfaceClass}=="08", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", GOTO="modeswitch_rules_begin"

The rule was not activated for any of those devices, that showed up after plugging in MF60 modem: 

When plugged in MF60 there device are added (udevadm monitor --udev):
UDEV  [43965.040359] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)
UDEV  [43965.046826] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3 (usb)
UDEV  [43965.055805] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/host30 (scsi)
UDEV  [43965.065657] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/host30/scsi_host/host30 (scsi_host)
....(and so on).

The
  udevadm info --path=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3 --attribute-walk
gives:

  looking at device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3':
    KERNEL=="1-1.2:1.3"
    SUBSYSTEM=="usb"
    DRIVER=="usb-storage"
    ATTR{bInterfaceClass}=="08"
    ATTR{bInterfaceSubClass}=="06"
    ATTR{bInterfaceProtocol}=="50"
    ATTR{bNumEndpoints}=="02"
    ATTR{supports_autosuspend}=="1"
    ATTR{bAlternateSetting}==" 0"
    ATTR{bInterfaceNumber}=="03"

  looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2':
    KERNELS=="1-1.2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="1.2"
    ATTRS{idVendor}=="19d2"
    ATTRS{speed}=="480"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="16"
    ATTRS{configuration}=="ZTE Configuration"
    ATTRS{bMaxPower}=="500mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="c0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="0"
    ATTRS{bcdDevice}=="0000"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{serial}=="MF60__ZTED010000"
    ATTRS{version}==" 2.00"
    ATTRS{urbnum}=="2513"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="ZTE,Incorporated"
    ATTRS{removable}=="removable"
    ATTRS{idProduct}=="2000"
    ATTRS{bDeviceClass}=="00"
    ATTRS{product}=="ZTE WCDMA Technologies MSM"

I did not understand why the rule did not work. However I did notice that changing the rule either to:
a)  ATTRS{bInterfaceNumber}=="03", ATTRS{bInterfaceClass}=="08", GOTO="modeswitch_rules_begin"
or to:
b)  ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", GOTO="modeswitch_rules_begin"
did worked.

First rule was fired for device /2-1.2:1.3 resulting in starting:
 usb_modeswitch_dispatcher --switch-mode /2-1.2:1.3 /usr/lib/udev/usb_modeswitch
which worked and changed mode of the device.
The second rule, only on VID and PID, was firing twice, for both /2-1.2 and /2-1.2:1.3 resulting in issuing commands:
 usb_modeswitch_dispatcher --switch-mode /2-1.2 /usr/lib/udev/usb_modeswitch
 usb_modeswitch_dispatcher --switch-mode /2-1.2:1.3 /usr/lib/udev/usb_modeswitch
one by one.
 
Why, o, why the full original rule did not fire for the /2-1.2:1.3 device but modified rule a) did, I HAVE NO IDEA. We require both conditions to fire the the command anyway!

In the process, I have noticed that attribute-walk actually returned ATTR{bInterfaceClass}=="08" and not ATTRS{bInterfaceClass}=="08" !
I have tried my chances, and changed udev rule to:

  ATTR{bInterfaceNumber}=="03", ATTR{bInterfaceClass}=="08", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", GOTO="modeswitch_rules_begin"
(where I changed ATTRS to ATTR) and it worked! But why?!

And why modified rule a) from above, despite having ATTRS and not ATTR, did work I do not know either.

Comment 8 Dan Williams 2013-07-30 18:39:18 UTC
Given this, moving to usb_modeswitch for rules updates.

Comment 9 Fedora End Of Life 2013-08-01 03:31:59 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 10 Marko Myllynen 2013-08-05 16:00:56 UTC
Jan, thanks a lot for the additional information - I'm reopening this since this is still an issue with fully up-to-date F19.

Comment 11 Marko Myllynen 2014-01-14 15:49:46 UTC
The modem still does not work with Fedora 20 with the following packages:

kernel-3.12.6-300.fc20
libqmi-1.6.0-1.fc20
usb_modeswitch-1.2.7-3.fc20
ModemManager-1.1.0-2.git20130913.fc20
NetworkManager-0.9.9.0-23.git20131003.fc20

I checked the current udev rules on F20 and they are not like the ones pasted in comment 7 at all, the only udev rule for the device is

ATTR{idVendor}=="19d2", ATTR{idProduct}=="2000", RUN+="usb_modeswitch '%b/%k'"

which is basically the same for almost all devices in the file 40-usb_modeswitch.rules.

Looking at current logs makes me think this is not a usb_modeswitch issue:

Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <info>  Creating modem with plugin 'ZTE' and '4' ports
Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <warn>  Could not grab port (net/wwp0s29f7u8i2): 'Ignoring net port in non-Icera ZTE modem'
Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <warn>  Could not grab port (usbmisc/cdc-wdm0): 'unsupported subsystem: 'usbmisc''
Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <warn>  (ttyUSB1): port attributes not fully set
Jan 14 17:24:15 localhost.localdomain ModemManager[359]: <info>  Modem for device at '/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-8' successfully created
Jan 14 17:24:16 localhost.localdomain ModemManager[359]: <info>  Modem: state changed (unknown -> disabled)

I'll attach full log when inserting the modem and reassign to ModemManager, please feel free to rereassign if you think that's not the correct component.

Thanks.

Comment 12 Marko Myllynen 2014-01-14 15:51:09 UTC
Created attachment 850015 [details]
zte-log.txt

Log from F20.

Comment 13 Marko Myllynen 2014-02-26 10:51:56 UTC
With ModemManager/libqmi from Rawhide things are looking slightly better but we still have an issue:

Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <info>  Creating modem with plugin 'ZTE' and '4' ports
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <info>  Modem for device at '/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-8' successfully created
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Checking version info (10 retries)...
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] QMI Device supports 4 services:
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0]    ctl (1.3)
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0]    wds (1.5)
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0]    dms (1.2)
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0]    nas (1.0)
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Setting network port data format...
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Network port data format operation finished
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Registered 'dms' (version 1.2) client with ID '4'
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: [/dev/cdc-wdm0] Registered 'nas' (version 1.0) client with ID '4'
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  (ttyUSB1): port attributes not fully set
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load Supported Bands: 'QMI operation failed: Cannot send message: QMI service 'dms' version '1.3' required, got version '1.2''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load SIM identifier: 'QMI operation failed: Cannot send message: QMI service 'dms' version '1.3' required, got version '1.2''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load IMSI: 'QMI operation failed: Cannot send message: QMI service 'dms' version '1.3' required, got version '1.2''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load list of Own Numbers: 'Couldn't get MSISDN: QMI protocol error (16): 'NotProvisioned''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load current allowed/preferred modes: 'Loading current modes is not supported by this device'
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <warn>  couldn't load current Bands: 'QMI operation failed: Cannot send message: QMI service 'nas' version '1.1' required, got version '1.0''
Feb 26 10:42:48 localhost.localdomain ModemManager[354]: <info>  Modem: state changed (unknown -> disabled)

The packages in use were:

ModemManager-1.2.0-1.fc21
ModemManager-glib-1.2.0-1.fc21
NetworkManager-0.9.9.0-30.git20131003.fc20
NetworkManager-glib-0.9.9.0-30.git20131003.fc20
kernel-3.13.3-201.fc20
libqmi-1.8.0-1.fc21
usb_modeswitch-1.2.7-3.fc20

I'll attach full log captured after inserting the modem and clicking Eject on the presented pop-up dialog.

Thanks.

Comment 14 Marko Myllynen 2014-02-26 10:53:01 UTC
Created attachment 867919 [details]
zte-log-2.txt

Comment 15 Marko Myllynen 2014-03-10 16:43:58 UTC
Created attachment 872797 [details]
zte-mm-nm-debug.txt

Debug log created as instructed in http://www.freedesktop.org/wiki/Software/ModemManager/Debugging/.

Comment 16 Dan Williams 2014-03-10 17:52:04 UTC
MM sends StartNetwork at 1394467151.  MM gets no response to the StartNetwork command, so it aborts the StartNetwork request at 1394467196.  Then the modem firmware appears to crash.  I guess the big question is what's taking the modem so long to start the network, or is something else going on here.

Comment 17 Marko Myllynen 2014-03-10 18:06:22 UTC
(In reply to Dan Williams from comment #16)
> MM sends StartNetwork at 1394467151.  MM gets no response to the
> StartNetwork command, so it aborts the StartNetwork request at 1394467196. 
> Then the modem firmware appears to crash.

That's indeed the case.

> I guess the big question is what's taking the modem so long to start the
> network, or is something else going on here.

The modem is configured to autoconnect so I've waited its on-screen display to say "Connected" before plugging it in.

Thanks.

Comment 18 Aleksander Morgado 2014-03-10 19:55:46 UTC
Firmware crash when running WDS Start Network is what Bjorn reported for the MF60 long ago:

http://lists.freedesktop.org/archives/libqmi-devel/2012-July/000098.html

Comment 19 Marko Myllynen 2014-09-08 05:22:55 UTC
Thanks to Aleksander, the required changes are now in ModemManager master/1.4 branch.

Comment 20 Marko Myllynen 2015-04-07 07:40:02 UTC
And ModemManager 1.4 is now part of Fedora 22 Alpha, thanks!


Note You need to log in before you can comment on or make changes to this bug.