4

I have a problem with Huawei modem. Ubuntu 16 does not detect it as a mobile broadband modem. I cannot choose it in my Network Connections.

$ lsusb
5266: executing lsusb
Bus 001 Device 004: ID 1bcf:2b8d Sunplus Innovation Technology Inc. 
Bus 001 Device 003: ID 8087:0a2a Intel Corp. 
Bus 001 Device 002: ID 8087:8001 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 0bc2:ab20 Seagate RSS LLC Backup Plus Portable Drive
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem (Mass Storage Mode)
Bus 002 Device 002: ID 047d:1042 Kensington Ci25m Notebook Optical Mouse [Diamond Eye Precision]
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
5266: executed
$ 

Have you got any idea what could I do?

I get the following error:

$ sudo grep 12d1 /lib/udev/rules.d/40-usb_modeswitch.rules ATTRS{idVendor}=="12d1", ATTR{bInterfaceNumber}=="00", ATTR{bInterfaceClass}=="08", RUN+="usb_modeswitch '%b/%k'"

grep: ATTRS{idVendor}==12d1,: No such file or directory

The output of lsusb | grep Huawei is:

Bus 002 Device 006: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
3
  • What is the command sudo grep 12d1 /lib/udev/rules.d/40-usb_modeswitch.rules ATTRS{idVendor}=="12d1", ATTR{bInterfaceNumber}=="00", ATTR{bInterfaceClass}=="08", RUN+="usb_modeswitch '%b/%k'" supposed to achieve? It looks like you copied the command from somewhere and included the supposed command output in the command itself. Jan 28, 2017 at 15:39
  • @DavidFoerster I tried with a new Ubuntu 16.04 UEFI and updated my BIOS, now it works like plug'n play. I had a too old installation with too many fixes and changes, now it just works. Thanks! Jan 28, 2017 at 16:28
  • @DacSaunders Please post that as an answer! It is a valid solution :)
    – Seth
    Jan 28, 2017 at 19:06

5 Answers 5

7

From your lsusb output I figure you are talking about a Huawei E352 USB 3G/4G modem, provided by T-Mobile NL. Most likely this is a Windows-induced problem. Windows first needs to install USB modem drivers to be able to mount the device as such. Instead of delivering a mini CD with drivers along with the USB modem, Huawei (and others) install some flash storage on their devices. So the device will be initially mounted as flash storage. Then, on a Windows machine, the installer will install the modem drivers and finally change the devices settings so it will be recognised as a modem next time.

For Linux users this is confusing, since their systems too will first recognise the flash storage, but not the modem. And the flash storage is not needed since the Linux kernel already has all necessary drivers onboard. I do not think you need to install any drivers.

What you need is the usb-modeswitch tool. Install it from the Ubuntu repositories:

sudo apt-get install usb-modeswitch

The following commands need to be run as root. So pay proper attention to what you are doing!

Connect your modem and find the vendor ID and product ID for your Huawei:

lsusb | grep Huawei

You will find what you already knew:

Bus 002 Device 003: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem

The vendor ID is '12d1' and the product ID is '14fe'. usb-modeswitch has a lot of ready configuration files in a tar-archive. First find your device's configuration file in the archive:

grep 12d1 /lib/udev/rules.d/40-usb_modeswitch.rules ATTRS{idVendor}=="12d1", ATTR{bInterfaceNumber}=="00", ATTR{bInterfaceClass}=="08", RUN+="usb_modeswitch '%b/%k'"

Then extract your configuration file from the archive:

tar xf /usr/share/usb_modeswitch/configPack.tar.gz 12d1\:14fe

And bring it up:

cat 12d1\14fe

It wil probably say:

# T-Mobile NL (Huawei E352)
TargetVendor=0x12d1
TargetProductList="1506,150f,151d"
HuaweiNewMode=1

Finally change the setting on your Huawei device:

usb_modeswitch -v 12d1 -p 14fe -c 12d1\:14fe

Now the flash storage driver will be detached and the modem driver activated. To check if everything went well run lsusb once more:

lsusb | grep Huawei

If all is well, you should see another product ID. A minor change with huge usability consequences.

After this you can set up your 3G/4G internet connection as usual with Network Manager. Make sure you switch off your WiFi, since WiFi and GSM will not run alongside each other.

If you want to keep track of your data use, install the vnstat package. It is text based, but gives all the information. Might you prefer a GUI, also add the vnstati package.

(Many thanks to Filip Vervloesem who covers this topic in length in the Dutch Linux Magazine 09/2017 issue.)

4
  • 1
    I try but I get this error msg grep: ATTRS{idVendor}==12d1,: No such file or directory when running the cmd sudo grep 12d1 /lib/udev/rules.d/40-usb_modeswitch.rules ATTRS{idVendor}=="12d1", ATTR{bInterfaceNumber}=="00", ATTR{bInterfaceClass}=="08", RUN+="usb_modeswitch '%b/%k'". Output from lsusb | grep Huawei is Bus 002 Device 006: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard Jan 26, 2017 at 17:57
  • This instruction didn't work for me. Feb 12, 2020 at 8:13
  • This instruction worked perfectly for me, thank you very much! Aug 9, 2020 at 13:06
  • Look for target devices ... No devices in target mode or class found Look for default devices ... Found devices in default mode (1) Access device 083 on bus 001 Error opening the device. Abort Plz help Mar 3, 2022 at 7:10
3
+50

I have had the same problem and I have fix it. You need to install the Huawei driver for Ubuntu.

  1. Configuration
    With the result of lsusb in the terminal (for me, the pid of my Huawei was 12d1:15d2, for example) See here

  2. Download the drivers :
    HUAWEI Data Cards Linux (click on Download file). See here

  3. Installation
    See here

3
  • I get compiler errors. It feels idiotic. All I wanted was to connect to the internet and now I must compile C code. Jul 7, 2016 at 18:35
  • The installation part did not work for me: Install NDIS driver failed. The compiling environment is not all ready. Please check gcc, make and kernel buid(/lib/modules/4.15.0-24-generic/build) to be all installed? Feb 12, 2020 at 8:13
  • HUAWEI Data Cards Linux (click on Download file). See heer " Download link is not working any other alternate ?
    – Gautam
    Mar 26, 2020 at 4:45
2

I have same problem after upgrade to Debian Stretch (9.0).

Fixed it like:

  1. extract modeswitch config:

    $ sudo tar xf /usr/share/usb_modeswitch/configPack.tar.gz 12d1\:14fe -C /usr/share/usb_modeswitch/
    
  2. add line to file /lib/udev/rules.d/40-usb_modeswitch.rules:

    ATTR{idVendor}=="12d1", ATTR{idProduct}=="14fe", RUN+="usb_modeswitch '/%k'"
    
  3. and to file /lib/udev/rules.d/77-mm-usb-device-blacklist.rules:

    ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1506", ENV{ID_MM_DEVICE_IGNORE}="1"
    
  4. reboot and dongle0 detected by asterisk

1

I tried with a new Ubuntu 16.04 UEFI and updated my BIOS to latest version, now it works like plug'n play. I had a too old installation with too many fixes and changes, now it just works. Thanks!

enter image description here

0

I used instructions from the answer above to make ModemManager find my Huawei E173 USB dongle. This is exactly what I did in CentOS 8:

# dnf install ModemManager (+enable the service, reboot)
# mmcli -L
No modems were found

# lsusb | grep Huawei
Bus 003 Device 003: ID 12d1:1446 Huawei Technologies Co., Ltd. HSPA modem

# dnf install usb_modeswitch
# usb_modeswitch -v 12d1 -p 1446 -c "/usr/share/usb_modeswitch/12d1:1446"

# lsusb | grep Huawei
Bus 003 Device 004: ID 12d1:1436 Huawei Technologies Co., Ltd. Broadband stick

# mmcli -L
/org/freedesktop/ModemManager1/Modem/0 [huawei] E173

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .