ZTE MF190, try to connect on bad ttyUSB2 (ubuntu 11.04 11.10 12.04)

Bug #875441 reported by almursi on 2011-10-16
54
This bug affects 11 people
Affects Status Importance Assigned to Milestone
ModemManager
New
Undecided
Unassigned
Baltix
Undecided
Unassigned
modemmanager (Ubuntu)
Undecided
Unassigned

Bug Description

Hi,

ZTE MF190 = ID 19d2:0124 ONDA Communication S.p.A.= (0x0149/0x124 CD/3g Modem)

also (19d2:0033)

This USB ADSL modem is connected properly on ttyUSB4 only. But the connection is attempted on ttyUSB2 mostly, although the possibility is reduced after canceling the request PIN useless (in an automatic connection, see https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/704123 ).

It's pretty annoying, since each retry takes minutes for the time necessary to activate the modem after ejecting the CD.

For this problem seems indifferent the updating of the usb_modeswitch database (and neither did manual updates to the latest version of modemmanager, eventually discarded to avoid conflicts with my current version of ubuntu).

Finally comment that my log files are really heavy, it may be better to tell me how to filter to avoid unnecessary messages before uploading.

Best regards.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: modemmanager 0.4+git.20110124t203624.00b6cce-2ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-11.50-generic-pae 2.6.38.8
Uname: Linux 2.6.38-11-generic-pae i686
NonfreeKernelModules: fglrx
Architecture: i386
Date: Sun Oct 16 04:10:22 2011
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta i386 (20100317.1)
ProcEnviron:
 LANGUAGE=es_ES:en
 LANG=es_ES.UTF-8
 SHELL=/bin/bash
SourcePackage: modemmanager
UpgradeStatus: Upgraded to natty on 2011-09-21 (24 days ago)

almursi (haqqshahid) wrote :
almursi (haqqshahid) on 2011-10-16
description: updated
almursi (haqqshahid) on 2011-10-16
summary: - ZTE MF190, try to connet on bad ttyUSB2
+ ZTE MF190, try to connect on bad ttyUSB2

Hi, It seems that only works after a segfault and restart:

Oct 16 08:31:50 almursi36 modem-manager[2489]: <info> (tty/ttyUSB2): released by modem /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-3
Oct 16 08:31:50 almursi36 modem-manager[2489]: <info> Modem /org/freedesktop/ModemManager/Modems/1: state changed (registered -> disabled)
Oct 16 08:31:50 almursi36 modem-manager[2489]: <info> Modem /org/freedesktop/ModemManager/Modems/1: state changed (disabled -> registered)
Oct 16 08:31:50 almursi NetworkManager[957]: <info> (ttyUSB2): now unmanaged
Oct 16 08:31:50 almursi init: modemmanager main process (2489) killed by SEGV signal
Oct 16 08:31:50 almursi init: modemmanager main process ended, respawning
Oct 16 08:31:50 almursi NetworkManager[957]: <info> (ttyUSB2): device state change: 3 -> 1 (reason 36)
Oct 16 08:31:50 almursi NetworkManager[957]: <info> (ttyUSB2): cleaning up...
Oct 16 08:31:50 almursi NetworkManager[957]: <info> (ttyUSB2): taking down device.
Oct 16 08:31:50 almursi kernel: [50780.861881] modem-manager[2489]: segfault at 45505954 ip b763ca7f sp bfcd22e0 error 4 in libglib-2.0.so.0.2800.6[b7610000+d5000]
Oct 16 08:31:50 almursi modem-manager[4442]: <info> ModemManager (version 0.4) starting...

I am gathering debug files, but now I only have a line of very low bandwidth, so I will publish only the most interesting.

Best regards.

almursi (haqqshahid) wrote :

(the name of the machine was modified by hand on logs; as well as personal data)

almursi (haqqshahid) wrote :

A comment that I found interesting (about another ZTE MF190 variant):

http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=719

Josh
Posted: Thu Aug 11, 2011 7:27 am

It's the old problem of Network Manager, or more precisely the helper component modem-manager, sometimes not using the correct port for connection out of the several ttyUSB interfaces a 3G modem is providing.
Not all modems want to be used with ttyUSB0; it's common for ZTE devices to connect via ttyUSB2 or ttyUSB3.

The common property of the "correct" ports is that they have a transfer type of "interrupt". usb_modeswitch will check for this and add a symlink "gsmmodem" in the /dev folder which points to the right port.
I know that the main developer of modem-manager was not aware of the interrupt thing until recently. Future versions may work as expected.

For now, the problem is that modem-manager may pick a port that responds to AT commands but will do so only for diagnostic purposes. Since there is no manual override for the port in Network Manager, all you can do is to use alternative software which allows the setting of the port.

almursi (haqqshahid) on 2011-10-16
description: updated
almursi (haqqshahid) wrote :

Hi, sorry, correct segfault on modem-manager debug log is:

Oct 16 16:53:04 almursi kernel: [ 1145.974365] modem-manager[3317]: segfault at ffffffff ip b76dfa7f sp bfa5c020 error 4 in libglib-2.0.so.0.2800.6[b76b3000+d5000]

almursi (haqqshahid) wrote :

Hi, regression: on Ubuntu 11.10 always try to connect over bad ttyUSB2

almursi (haqqshahid) wrote :

Hi, 11.10 problem: another correction (may be no ttyUSB2, it try any port except ttyUSB4): I could debug minimally modemmanager while I did the installation and gives me the feeling that the problem is that no cracks modemmanager, ie a stability problem :D. When it restarts at 11.04, ttyUSB4 port is taken correctly.

I have a similar output to this:

modem-manager[3317]: (mm-generic-gsm.c:794):mm_generic_gsm_grab_port: runtime check failed: (port != NULL)
modem-manager[3317]: <warn> [1318776654.516730] [mm-manager.c:567] do_grab_port(): plugin 'ZTE' claimed to support tty/ttyUSB4 but couldn't: (-1) (unknown)

Of course, now it's mm_generic_gsm_c:825 and not mm-manager.c:567

Best regards.

almursi (haqqshahid) wrote :
almursi (haqqshahid) wrote :
summary: - ZTE MF190, try to connect on bad ttyUSB2
+ ZTE MF190, try to connect on bad ttyUSB2 (ubuntu 11.04), no connection
+ (ubuntu 11.10)

Hi, I can always include more logs, just say so. With modem-manager forcing to restart (with killall) on ubuntu 11.10, I get that ttyUSB4 to be used, but it gets stuck and fails to finish connection process.

almursi (haqqshahid) wrote :

Disabling network manager (and/or modem-manager) I don't have any problem with wvdial over ttyUSB4.

almursi (haqqshahid) wrote :

I see on ubuntu 11.10 log:

modem-manager[3148]: <debug> [1319209523.188058] [mm-at-serial-port.c:298] debug_log(): (ttyUSB4): --> 'ATD*99***1#<CR>'
modem-manager[3148]: <debug> [1319209523.206031] [mm-at-serial-port.c:298] debug_log(): (ttyUSB4): <-- '<CR><LF>ERROR<CR><LF>'
modem-manager[3148]: <debug> [1319209523.206076] [mm-serial-parsers.c:412] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error

ATD*99***1# Is incorrect because I have a set this: number *99# !!!

almursi (haqqshahid) on 2011-10-28
summary: ZTE MF190, try to connect on bad ttyUSB2 (ubuntu 11.04), no connection
- (ubuntu 11.10)
+ -wrong dial number- (ubuntu 11.10)

Here we see that is properly configured, but it dial an incorrect value:

modem-manager[3148]: <debug> [1319209492.490204] [mm-generic-gsm.c:5099] simple_connect(): (ttyUSB4): number => "*99#"

almursi (haqqshahid) wrote :

However, in Ubuntu 11.04 connects, although this use an incorrect dial. Modem-manger log with ttyUSB2 wrong on first attempt, followed by unplug and proper connection on ttyUSB4.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in modemmanager (Ubuntu):
status: New → Confirmed
almursi (haqqshahid) wrote :

Hi, perhaps interesting to note that this modem hangs when trying to connect to wrong port (such as ttyUSB1 or ttyUSB2). And any further attempt on ttyUSB4 not get any results (except a confusing "invalid dial command"). So with this modem does not serve the "trick" to try to connect to all available AT ports, to find the correct, because by then the modem is dead ... Regards.

almursi (haqqshahid) on 2011-12-06
summary: - ZTE MF190, try to connect on bad ttyUSB2 (ubuntu 11.04), no connection
- -wrong dial number- (ubuntu 11.10)
+ ZTE MF190, try to connect on bad ttyUSB2 (ubuntu 11.04)

Hi, today I try (xubuntu 11.10) with networkmanagar and I don't have any problem connecting. I don't understand why :) but it seems fixed in 11.10. Regards.

almursi (haqqshahid) wrote :

About 11.10 the only change is that the pin ask (on sim) is disabled now. I do not know if it has installed any software updates (I'm using 11.04 so I'm not sure). If no other reason the failure was due to mismanagement of the unlocking pin. Regards.

Dr. Amr Osman (dr3mro) wrote :

is there a patch or something this is realy annoying

almursi (haqqshahid) wrote :

Hi, yes: use of gnome-ppp/wvdial instead of modemmanager (i.e. disable mobile broadband on networkmanager applet). With a direct dialer and correct ttyUSB port, the modem's response is immediate as the LED changes from red to flashing green. Anyway it seems already fixed in later versions -correct me if I'm wrong- (I'm still using 11.04, I usually update once a year). Regards.

Dr. Amr Osman (dr3mro) wrote :

same problem ubuntu 12.04 / 11.10
the problem is that modem manager report /dev/ttyUSB3 as modem port but actually it's /dev/ttyUSB3

Dr. Amr Osman (dr3mro) wrote :

(sorry typo)
same problem ubuntu 12.04 / 11.10
the problem is that modem manager report /dev/ttyUSB2 as modem port but actually it's /dev/ttyUSB3
sakies script detects it fine but please this should be patched before LTS release

Dr. Amr Osman (dr3mro) on 2012-03-11
summary: - ZTE MF190, try to connect on bad ttyUSB2 (ubuntu 11.04)
+ ZTE MF190, try to connect on bad ttyUSB2 (ubuntu 11.04 11.10 12.04)
description: updated
Dr. Amr Osman (dr3mro) wrote :

I have discovered a workaround
http://ubuntuforums.org/showpost.php?p=11768480&postcount=10
check it

Dr. Amr Osman (dr3mro) wrote :

i have create a udev patch that fixes the issue in a dirty way until a fix is commited
this is the deb file

Amr Osman, please provide a proper patch instead of a deb package, we can't review a deb package.

Also, it would be nice if someone having this issue could report it upstream as suggested by Aleksander.

Dr. Amr Osman (dr3mro) wrote :

actually it's a workaround that using udev rules to execute a patch when connecting the modem
the patch delete /dev/ttyUSB2
and symlink /dev/ttyUSB3 to /dev/ttyUSB2

the dev rules
/etc/udev/rules.d/90-zte.rules

######################################################
ACTION!="add", GOTO="ZTE_End"

# Is this the ZeroCD device?
SUBSYSTEM=="block", ATTR{idProduct}=="2000",
ATTRS{idVendor}=="19d2", GOTO="ZTE_ZeroCD"

# Is this the actual modem?
SUBSYSTEM=="usb", ATTR{idProduct}=="0033",
ATTR{idVendor}=="19d2", GOTO="ZTE_Modem"

LABEL="ZTE_ZeroCD"
# This is the ZeroCD part of the card, remove
# the usb_storage kernel module so
# it does not get treated like a storage device
RUN+="/usr/bin/eject /media/ZTEMODEM"

LABEL="ZTE_Modem"
# This is the Modem part of the card, let's
# load usbserial with the correct vendor
# and product ID's so we get our usb serial devices
RUN+="/sbin/modprobe usbserial vendor=0x19d2 product=0x0033",
# Make users belonging to the dialout group
# able to use the usb serial devices.
MODE="666", GROUP="dialout"
RUN+="/usr/bin/fix-zte-mf190.sh"
LABEL="ZTE_End"

####################################################
 the patch

/usr/bin/fix-zte-mf190.sh
#####################################################
#!/bin/bash
sudo rm /dev/ttyUSB2
sudo ln -s /dev/ttyUSB3 /dev/ttyUSB2

#########################################################

This is not something we can use as a workaround, since you'd be losing USB2 which has a purpose (otherwise it wouldn't be provided).

This needs a fix in the modemmanager whitelist udev rules, or in the kernel driver in use.

These are the revelant udev lines from modemmanager's /lib/udev/rules.d/77-mm-zte-port-types.rules:

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

Could you please run 'sudo lsusb -d 12d1:0033' with the device plugged in, so we can see if there's something going wrong with how the ports are detected?

I suspect what is likely required here is either that these values are plain wrong, or as a more likely scenario your device uses a different firmware version than what was tested and lists its ports in a different order.

Changed in modemmanager (Ubuntu):
status: Confirmed → Incomplete
Dr. Amr Osman (dr3mro) wrote :

actually when i execute the command nothing appear only gives me the prompt again ?
sudo lsusb -d 12d1:0033

Dr. Amr Osman (dr3mro) wrote :

and I can confir, this workaround makes my modem works >> usb-storage / cdrom / modem
so , untill someone fixes this issue plz consider make the modem usable for users :)

No, we can't use this workaround at all. Sorry.

If lsusb just returns, that means it's the wrong USB ID. Does lsusb (without parameters) list a device starting with 12d1? That's the one you'll want to use, with vendor and product ID to pass to lsusb with the -d switch.

Dr. Amr Osman (dr3mro) wrote :

this is my lsusb output

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 19d2:0033 ONDA Communication S.p.A.
Bus 004 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

What is the output of "sudo lsusb -d 19d2:0033" ?

Dr. Amr Osman (dr3mro) wrote :

still none ??
no output at all ?

The device needs to be connected. If it's listed in lsusb itself, then running the same "sudo lsusb -d 19d2:0033" command should list the device properties. Without those, there is nothing I can do about this bug.

Maybe try another number for the modem if that's what shows up; anything starting with 19d2 is most likely to be the modem, but the actual product ID might differ.

fredi (frederico-pflug) wrote :

Running 12.04 on Asus UX21.
"#lsusb -d 19d2:0031 " results in nothing but:
Bus 002 Device 007: ID 19d2:0031 ZTE WCDMA Technologies MSM MF110/MF627/MF636

When connecting to another USB port:
"#lsusb -d 19d2:2000" results in nothing but:
Bus 003 Device 003: ID 19d2:2000 ZTE WCDMA Technologies MSM MF627/MF628/MF628+/MF636+ HSDPA/HSUPA
In this port, network-manager doesn't recognize the modem and I don't see any /dev/ttyUSB.

Attachments:
fpflug-syslog.txt
fpflug-lsusb-v.txt

perdigueiro (alves-lcc) wrote :

Still nothing I've disabled PIN, restart modemmanager and network-manager but nothing start the modem

Samsung RC530
Ubuntu Precise 12.04 - amd64 - 3.5.0-030500-generic

Bus 001 Device 023: ID 19d2:0031 ZTE WCDMA Technologies MSM MF110/MF627/MF636

usb_modeswitch corrrectly switch from 19d2:2000 to 19d2:0031 as in defined in /lib/udev/rules.d/40-usb_modeswitch.rules

modemmanager works sometimes (after lots of plugin plugout) usualy after a SEGFAULT

checking /lib/udev/rules.d/77-mm-zte-port-types.rules
  ATTRS{idProduct}=="0031", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1"
  ATTRS{idProduct}=="0031", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1"
it seams correct to me the error must be some were else.

Jerzy Golonko (jgolonko) wrote :
Download full text (8.0 KiB)

I've got the same problem with ZTE MF636 - modem manager uses ttyUSB2, while it should be ttyUSB3.
I think I found a little simpler solution to this problem, just added one line to /lib/udev/rules.d/77-mm-zte-port-types.rules:

ATTRS{idProduct}=="0033", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1"
ATTRS{idProduct}=="0033", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1"
# this is what I added
ATTRS{idProduct}=="0033", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="0"

Now modem manager uses proper ttyUSB3 and everything works as expected.
There is one difference I've noticed using lsusb between ttyUSB2 and ttyUSB3 - the last has
Transfer Type Interrupt
and the others have
Transfer Type Bulk
maybe it can be utilized to help modem manager to find right device.

below I send full output of 'lsusb -d 19d2:0033 -v' :

Bus 001 Device 068: ID 19d2:0033 ZTE WCDMA Technologies MSM
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 2.00
  bDeviceClass 0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 64
  idVendor 0x19d2 ZTE WCDMA Technologies MSM
  idProduct 0x0033
  bcdDevice 0.00
  iManufacturer 3 ZTE,Incorporated
  iProduct 2 ZTE CDMA Technologies MSM
  iSerial 4 1234567890ABCDEF
  bNumConfigurations 1
  Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 131
    bNumInterfaces 5
    bConfigurationValue 1
    iConfiguration 1 ZTE Configuration
    bmAttributes 0xe0
      Self Powered
      Remote Wakeup
    MaxPower 500mA
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 2
      bInterfaceClass 255 Vendor Specific Class
      bInterfaceSubClass 255 Vendor Specific Subclass
      bInterfaceProtocol 255 Vendor Specific Protocol
      iInterface 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x81 EP 1 IN
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0200 1x 512 bytes
        bInterval 32
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x01 EP 1 OUT
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0200 1x 512 bytes
        bInterval 32
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 1
      bAlternateSetting 0
      bNumEndpoints 2
      bInterfaceClass 255 Vendor Specific Class
      bInterfaceSubCla...

Read more...

To post a comment you must log in.