[SOLVED]Huawei E220 and E1550 can't connect on Ubuntu 12.04

Bug #991680 reported by garybrlow
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
modemmanager (Ubuntu)
Fix Released
Undecided
graham nixon

Bug Description

This is a similar problem to https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/868034 but affects Ubuntu Precise and derivatives.

Modem is recognized as storage/CD only. Network Manager and Huawei Mobile Partner fails to detect the USB modem. Apparently this bug does not happen on an upgraded system (previous to 12.04) but directly occurs on a fresh install.

System:
Xubuntu Precise 12.04
3.2.0-24-generic
Huawei E220

garybrlow (garybrlow)
tags: added: modemmanager
Revision history for this message
Josua Dietze (digidietze) wrote :

This is not a problem with modem-manager. It looks like the device was not mode-switched properly.

Please enable logging of usb_modeswitch; to do this, edit "/etc/usb_modeswitch.conf". It tells you about the log destiantion.

affects: modemmanager (Ubuntu) → usb-modeswitch (Ubuntu)
garybrlow (garybrlow)
summary:
Revision history for this message
garybrlow (garybrlow) wrote :

Results of usb_modeswitch.log:

---------------------------------------------------------------------------------------------------------
USB_ModeSwitch log from Mon Apr 30 23:08:12 2012

Using global config file: /etc/usb_modeswitch.conf

Raw args from udev: /4-4:1.0

Bus ID for device not given by udev.
 Trying to determine it from kernel name (4-4:1.0) ...
Top device directory not found (/sys/bus/usb/devices/4-4)! Exiting.
---------------------------------------------------------------------------------------------------------

Some updates on bug description as well.

Cheers. :)

description: updated
description: updated
garybrlow (garybrlow)
tags: added: usb-modeswitch
Revision history for this message
Josua Dietze (digidietze) wrote :

Can you check for the directory mentioned in the log (while stick inserted) ?

What's the content of "/sys/bus/usb/devices" ?

Revision history for this message
garybrlow (garybrlow) wrote :

Contents of /sys/bus/usb/devices (Modem is plugged-in):

------------------------------------------------------------------------------------
mycomputer@xubuntu-notebook:~$ cd /sys/bus/usb/devices
mycomputer@xubuntu-notebook:/sys/bus/usb/devices$ ls
1-0:1.0 1-4:1.1 2-4:1.0 2-4:1.3 4-1 4-1:1.2 4-5:1.1 usb2
1-4 2-0:1.0 2-4:1.1 3-0:1.0 4-1:1.0 4-5 4-5:1.2 usb3
1-4:1.0 2-4 2-4:1.2 4-0:1.0 4-1:1.1 4-5:1.0 usb1 usb4
------------------------------------------------------------------------------------

Cheers. :)

description: updated
Revision history for this message
Josua Dietze (digidietze) wrote :

If you compare the current log with this directory listing and the path that udev provides (4-4:1.0) does not exist, then the hotplug system may be to blame.

Could you post the end (starting from "new USB device") of the output from the "dmesg" command, right after plugging the stick in ?

Revision history for this message
garybrlow (garybrlow) wrote :

[ 2729.139786] USB Serial support registered for GSM modem (1-port)
[ 2729.140454] usbcore: registered new interface driver option
[ 2729.140461] option: v0.7.2:USB Driver for GSM modems
dmesg results(end section):
-----------------------------------------------------------------------------------------------------------------------------
[ 2734.776102] usb 2-4: new high-speed USB device number 17 using ehci_hcd
[ 2734.922094] option 2-4:1.0: GSM modem (1-port) converter detected
[ 2734.922370] usb 2-4: GSM modem (1-port) converter now attached to ttyUSB0
[ 2734.923223] option 2-4:1.1: GSM modem (1-port) converter detected
[ 2734.923454] usb 2-4: GSM modem (1-port) converter now attached to ttyUSB1
[ 2734.935778] scsi37 : usb-storage 2-4:1.2
[ 2734.941384] scsi38 : usb-storage 2-4:1.3
[ 2735.940803] scsi 37:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
[ 2735.947244] scsi 38:0:0:0: Direct-Access HUAWEI MMC Storage 2.31 PQ: 0 ANSI: 2
[ 2735.956243] sr0: scsi-1 drive
[ 2735.956695] sr 37:0:0:0: Attached scsi CD-ROM sr0
[ 2735.957029] sr 37:0:0:0: Attached scsi generic sg1 type 5
[ 2735.959535] sd 38:0:0:0: Attached scsi generic sg2 type 0
[ 2735.967036] sd 38:0:0:0: [sdb] Attached SCSI removable disk
[ 2945.832114] usb 4-5: new full-speed USB device number 7 using ohci_hcd
-----------------------------------------------------------------------------------------------------------------------------

Revision history for this message
Josua Dietze (digidietze) wrote :

Hmm, it looks like your device has in fact switched to modem mode ...

It's not unusual for some devices to provide their "install storage" again after the mode switching. I'm just wondering which program or event is responsible for the switch.

In the dmesg output the mode switch process will show up with the following sequence:

... new high-speed USB device ... [just storage]
   ...
... device disconnected ... [device is switching modes]
   ...
... new high-speed USB device ... [modem and storage]

Can you spot that sequence after plugging ? It might take several seconds to complete with Huawei devices.

Revision history for this message
garybrlow (garybrlow) wrote :

Yup it's the same sequence and apparently the devices are recognized as they should be but network-manager and Mobile Partner don't . And before anyone says that the USB modem is broken, it works in Windows 7 including Mobile Partner for Windows.

One interesting thing though: if you uninstall Mobile Partner, Network Manager will detect the USB modem properly a mobile internet device. But these two worked together with no problem before. I use Mobile Partner for SMS and SIM card data management.

Revision history for this message
Josua Dietze (digidietze) wrote :

So, did you install Mobile Partner from the stick or is there an official Ubuntu package ?

Revision history for this message
garybrlow (garybrlow) wrote :

No official ubuntu package, updated stick version. It's just weird that i worked before and after upgrade and not on a fresh install.

Revision history for this message
Josua Dietze (digidietze) wrote :

Unfortunately, you may be on your own then. Huawei software installs its own mode switching program, regardless of what is present on the system. It may switch the stick to a mode which is unsuitable for Network Manager (Huawei modems have more than two different modes).
You can try to find this mode switching program and disable it. See if it makes a difference to let usb_modeswitch handle the stick.

In any case, this is not an Ubuntu bug.

Changed in usb-modeswitch (Ubuntu):
status: New → Invalid
garybrlow (garybrlow)
summary: - Huawei E220 and E1550 can't connect on Ubuntu 12.04
+ [SOLVED]Huawei E220 and E1550 can't connect on Ubuntu 12.04
Revision history for this message
Pablo (pjferra) wrote :

Why is this bug tagged as "solved"?
Which is the solution?
I cannot use my Huawei e220 modem but just sometimes (when it wants to work)
With ubuntu 10.04 no problem. Upgrading to 11.10 o 12.04 breaks the recognizing of the modem
I've tried the "solutions" proposed in other thread:
        1) sudo usb_modeswitch -v 0x12d1 -p 1003 -V 0x12d1 -P 1003 -R
        2) sudo echo "AT^U2DIAG=0" >> /dev/ttyUSB1
        3) modify the /lib/udev/rules.d/40-usb_modeswitch.rules file
        4) downgrade modemmanager to 0.4 version
None of them worked for me. Some times the modem is recognized and many many times not.
It's really annoying.
Thanks in advance

Revision history for this message
Graham Aiken (gjaiken) wrote :

It seems many people using more recent editions of Ubuntu and its ofshoot Linux Mint (LM) are reporting problems achieving mobile broadband connections with older Huawei modems. This is despite these modems working well in previous Ubuntu and LM editions. I believe that many of these problems may be due to a bug in the ModemManager Huawei plugin.

I have a Huawei modem branded as an E160E but the 'lsusb' command gives the following specifications:
'Bus 001 Device 006: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem'

The modem functioned perfectly well in Ubuntu 10.10 and LM 10 but I have had problems connecting in more recent Ubuntu and LM editions, including the latest Ubuntu 12.04 and LM 13. Sometimes after various "fiddles" including plugging and unplugging the modem a number of times, it is recognised by network manager and it may be possible to set up a connection and actually connect. But the work involved to achieve this is really not acceptable.

After plugging in the modem, there is a partial system "freeze" for a couple of minutes, during which programs may run spasmodically and it is only possible to type intermittently in a terminal. Finally issuing a 'dmesg' command indicates that the modem is disconnected.

After trying various recommended solutions, I came up with following:

1. Backup the file '/usr/lib/ModemManager/libmm-plugin-huawei.so' and replace it with the same file from Ubuntu 10.10 (or LM10). You could get this by running the live CD from one of these editions.

After plugging in the modem, there is no more system freeze and issuing a 'dmesg' command indicates that the modem is attached to ttyUSB0 and ttyUSB1.

2. Setup an internet connection using 'sudo pppconfig'.

(a) My connection doesn't need a username or password but pppconfig requires some input for these so I simply inserted the word 'blank' for both.
(b) I specified ttyUSB0 as the modem port.
(c) After writing the configuration files and exiting, edit the /etc/chatscripts/provider file to insert line:
  OK 'AT+CGDCONT=1,"IP","<YOUR APN>"'

Here is my /etc/chatscripts/provider file as an example:

# This chatfile was generated by pppconfig 2.3.18.
# Please do not delete any of the comments. Pppconfig needs them.
#
# ispauth PAP
# abortstring
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
# modeminit
'' ATZ
# ispnumber
OK 'AT+CGDCONT=1,"IP","preconnect"'
OK-AT-OK "ATDT*99#"
# ispconnect
CONNECT \d\c
# prelogin

# ispname
# isppassword
# postlogin

# end of pppconfig stuff

3. Connect with 'sudo pon' and disconnect with 'sudo poff'.

Whilst I have found this solution works well, my modem is still not recognised by network manager (? a separate issue). However I have found that a connection is achieved faster using 'pon' than is usual with network manager.

Revision history for this message
Didier Raboud (odyx) wrote :

According to the last comment, this is rather a bug in modemmanager; reassigning.

affects: usb-modeswitch (Ubuntu) → modemmanager (Ubuntu)
Changed in modemmanager (Ubuntu):
status: Invalid → New
Changed in modemmanager (Ubuntu):
status: New → Fix Released
Revision history for this message
Guilherme Buonfiglio de Castro Monteiro (gbuonfiglio) wrote :

Hello,

On fresh 12.10 install, remember to install package "modemmanager":
 sudo apt-get install modemmanager

[]s,
Guilherme

graham nixon (gni45977)
Changed in modemmanager (Ubuntu):
assignee: nobody → graham nixon (gni45977)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.