[Pkg-utopia-maintainers] Bug#533645: network-manager: Huawei E220 3G modems require a LONG settle time to work

Cyrille Chépélov cyrille at chepelov.org
Fri Jun 19 15:00:00 UTC 2009


Package: network-manager
Version: 0.7.1-1
Severity: normal

Executive summary
------------------
Upgrading N-M from 0.7.0(ish) to 0.7.1 apparently broke 3G connectivity with my Huawei
E220 HSDSPA modem (which might actually be an E270 HSUPA/HSDPA unit).

After some gnashing of teeth, the problem appears to be with the Huawei E220
requiring a little more settle time (8 to 10 seconds) than what is afforded by
NetworkManager's udev scripts and helpers.

Patch ready.

	-- Cyrille

Analysis (typed as events happened)

This bug is different from #525066 as in that other case, one of the
/dev/ttyUSB* avatars from that modem were accepted as 3G-capable units. In
the E220 case, both ttyUSB0 and ttyUSB1 are rejected with the following
messages:
 
lt-NetworkManager: <info>  (ttyUSB1): ignoring due to lack of mobile
broadband capabilties
lt-NetworkManager: <info>  (ttyUSB0): found serial port (udev:  hal:GSM)
lt-NetworkManager: <info>  (ttyUSB0): ignoring due to lack of probed mobile
broadband capabilties

apparently, what this means is that the ttyUSB1 side of the modem is just
not that interesting for my purpose, and for ttyUSB0, we fall on 
	/* Case (c): HAL thinks it's a modem, but udev doesn't */
from nm-hal-manager.c

udev is version 0.141-1, which apparently is the latest. Kernel is 2.6.29-2
version 2.6.29-5 (in Debian at least)
After build-deping network-manager, ./configure --as-in-debian-rules gave 
	#define HAVE_LIBUDEV 0

wihen not using HAVE_LIBUDEV, a different function is used to query udev
about the modem than when HAVE_LIBUDEV.
In the "have not" case, we call /sbin/udevadm (yes, hardcoded name without
regards to the prefix..) 

Manually calling 
	/sbin/udevadm info --query=env --path=/sys/class/tty/ttyUSB0
returns the following:

UDEV_LOG=3
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/ttyUSB0/tty/ttyUSB0
MAJOR=188
MINOR=0
DEVNAME=/dev/ttyUSB0
ID_PORT=0
ID_PATH=pci-0000:00:1d.1-usb-0:1:1.0
ID_VENDOR=HUAWEI_Technologies
ID_VENDOR_ENC=HUAWEI\x20Technologies
ID_VENDOR_ID=12d1
ID_MODEL=HUAWEI_Mobile
ID_MODEL_ENC=HUAWEI\x20Mobile
ID_MODEL_ID=1003
ID_REVISION=0000
ID_SERIAL=HUAWEI_Technologies_HUAWEI_Mobile
ID_TYPE=generic
ID_BUS=usb
ID_USB_INTERFACES=:ffffff:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=option
ID_IFACE=00
NM_MODEM_DRIVER=option
NM_MODEM_USB_INTERFACE_NUMBER=00
ID_NM_MODEM_PROBED=1
DEVLINKS=/dev/char/188:0 /dev/serial/by-path/pci-0000:00:1d.1-usb-0:1:1.0-port0
/ /dev/serial/by-id/usb-HUAWEI_Technologies_HUAWEI_Mobile-if00-port0

bearing in mind the following constants:
#define PROP_GSM   "ID_NM_MODEM_GSM"
#define PROP_CDMA  "ID_NM_MODEM_IS707_A"
#define PROP_EVDO1 "ID_NM_MODEM_IS856"
#define PROP_EVDOA "ID_NM_MODEM_IS856_A"

it appears that my modem stopped being supported, even though HAL detected
it properly as a GSM modem, just because udev now doesn't advertise it as a
GSM module. Oh but udev advertises what the NM support modules are telling
it to advise?!

Running: 
	/lib/udev/nm-modem-probe -x /dev/ttyUSB0
returns 
	ID_NM_MODEM_GSM=1
	ID_NM_MODEM_PROBED=1
which is what I expect.

/lib/udev/rules.d/77-nm-probe-modem-capabilities.rules exists and seems
sane at first glance. 

Ran /sbin/udevd --debug, in the same console as NM, and plugged the modem
back in. A sea of messages ensued, including:

[3183] udev_rules_apply_to_event: LINK 'serial/by-id/usb-HUAWEI_Technologies_HUAWEI_Mobile-if00-port0' /lib/udev/rules.d/60-persistent-serial.rules:18
[3183] udev_rules_apply_to_event: IMPORT 'nm-modem-probe --vid 0x12d1 --pid 0x1003 --usb-interface 00 --driver option --delay 3000 --export /dev/char/188:0' /lib/udev/rules.d/77-nm-probe-modem-capabilities.rules:20
[3183] util_run_program: 'nm-modem-probe --vid 0x12d1 --pid 0x1003 --usb-interface 00 --driver option --delay 3000 --export /dev/char/188:0'
[3183] util_run_program: '/lib/udev/nm-modem-probe' (stdout) 'ID_NM_MODEM_PROBED=1'
[3183] util_run_program: '/lib/udev/nm-modem-probe' returned with status 0

This proves the NM-supplied udev rule is applied as expected.

Running nm-modem-probe manually, this way:
    /lib/udev/nm-modem-probe --vid 0x12d1 --pid 0x1003 \
	--usb-interface 00 --driver option --delay 3000 /dev/ttyUSB0 \
	--export
returns not one but two lines:
   ID_NM_MODEM_GSM=1
   ID_NM_MODEM_PROBED=1
which is indeed what I want.

I finally traced the problem by intercepting /lib/udev/nm-modem-probe
with a wrapper script, and adding a couple seconds worth of delay just
before calling the real nm-modem-probe. 
			That did work around the problem !
This Huawei dongle simply requires more time before it is ready.

Turns out the --delay cannot be increased beyond 3000 even for slow
devices, because a test in nm-modem-probe.c rejects this.


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (800, 'testing'), (600, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.29-2-686 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages network-manager depends on:
ii  adduser      3.110                       add and remove users and groups
ii  dbus         1.2.12-1                    simple interprocess messaging syst
ii  dhcp3-client 3.1.1-6                     DHCP client
ii  hal          0.5.12~git20090406.46dc48-2 Hardware Abstraction Layer
ii  ifupdown     0.6.8+nmu1                  high level tools to configure netw
ii  libc6        2.9-12                      GNU C Library: Shared libraries
ii  libdbus-1-3  1.2.12-1                    simple interprocess messaging syst
ii  libdbus-glib 0.80-4                      simple interprocess messaging syst
ii  libgcrypt11  1.4.4-2                     LGPL Crypto library - runtime libr
ii  libglib2.0-0 2.20.0-2                    The GLib library of C routines
ii  libgnutls26  2.6.6-1                     the GNU TLS library - runtime libr
ii  libgpg-error 1.6-1                       library for common error values an
ii  libhal1      0.5.12~git20090406.46dc48-2 Hardware Abstraction Layer - share
ii  libnl1       1.1-5                       library for dealing with netlink s
ii  libnm-glib0  0.7.1-1                     network management framework (GLib
ii  libnm-util1  0.7.1-1                     network management framework (shar
ii  libpolkit-db 0.9-3                       library for accessing PolicyKit vi
ii  libpolkit2   0.9-3                       library for accessing PolicyKit
ii  libtasn1-3   1.8-1                       Manage ASN.1 structures (runtime)
ii  libuuid1     1.41.3-1                    universally unique id library
ii  lsb-base     3.2-22                      Linux Standard Base 3.2 init scrip
ii  wpasupplican 0.6.9-2                     client support for WPA and WPA2 (I
ii  zlib1g       1:1.2.3.3.dfsg-13           compression library - runtime

Versions of packages network-manager recommends:
ii  dnsmasq-base               2.47-3        A small caching DNS proxy and DHCP
ii  iptables                   1.4.3.2-2     administration tools for packet fi
ii  network-manager-gnome      0.7.1-1       network management framework (GNOM
ii  policykit                  0.9-3         framework for managing administrat
ii  ppp                        2.4.4rel-10.1 Point-to-Point Protocol (PPP) - da

Versions of packages network-manager suggests:
ii  avahi-autoipd                 0.6.25-1   Avahi IPv4LL network address confi

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: n-m.patch
Type: text/x-diff
Size: 3962 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20090619/fedacc17/attachment.patch>


More information about the Pkg-utopia-maintainers mailing list