10

Ubuntu 16.04 does not recognize my Huawei 15ca USB modem.

How can I fix this?

2
  • 1
    Please edit your question and add output of lsusb terminal command.
    – Pilot6
    May 25, 2016 at 9:28
  • 2
    That looks like a problem indeed but what's your question? May 28, 2016 at 10:58

5 Answers 5

11

This command worked for me. I just needed to execute it once.

lsusb

Note down vendor and product id. In my case it is 12d1 and 1f01 respectively.

Bus 002 Device 003: ID 05c8:038f Cheng Uei Precision Industry Co., Ltd (Foxlink) 
Bus 002 Device 002: ID 0438:7900 Advanced Micro Devices, Inc. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 0bda:b008 Realtek Semiconductor Corp. 
Bus 001 Device 003: ID 12d1:14db Huawei Technologies Co., Ltd. E353/E3131
Bus 001 Device 002: ID 0438:7900 Advanced Micro Devices, Inc. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Then execute this once.

sudo usb_modeswitch -v 12d1 -p 1f01 -J
3
  • 3
    from where did you got the 1f01 I don't see it in the above terminal extract Nov 22, 2016 at 17:09
  • From the lsusb output. The output I have posted is after executing usb_modeswitch which changes product id to 14db in my case. Feb 19, 2017 at 20:39
  • 2
    Yes, it worked but how can I run it only once and for al?l
    – X09
    Mar 18, 2017 at 23:23
8

The instructions on how to fix this are slightly different than 14.04.

One of these steps might not be needed, but here is how I got it to work:

vi /lib/udev/rules.d/40-usb_modeswitch.rules

and add this line:

ATTR{idVendor}=="12d1", ATTR{idProduct}=="15ca", RUN+="usb_modeswitch '%b/%k'"

Then:

sudo touch /etc/usb_modeswitch.d/12d1:15ca

Run this command:

sudo usb_modeswitch -J -v 0x12d1 -p 0x15ca

Now you should see it under available network connections and under lsusb it appears with a different product number:

Bus 003 Device 008: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard

You might have to reboot or remove and reinsert the modem a couple of times to get it to work. Also remember to add it into edit connection/add mobile broadband connection.

2
  • Is there a way to automate this, e.g. execute sudo usb_modeswitch -J -v 0x12d1 -p 0x15ca everytime the modem is connected? I remember this used to work automatically before 16.04 (after applying a similar fix like yours, of course).
    – ov1d1u
    Jul 22, 2016 at 18:25
  • Yes, there is a way. I am writing an answer.
    – Pilot6
    Feb 28, 2017 at 17:04
2

I had this problem today. I had 2 computers with Ubuntu 16.04 where the 12d7:1505 modem works well.

I bought another one and it does not work without the

sudo usb_modeswitch -v 12d1 -p 1506 -J

command.

I fixed it with another udev rule.

Add /etc/udev/rules.d/huawei.rules file with this content:

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1505", RUN+="/usr/sbin/usb_modeswitch -v 12d1 -p 1506 -J"

Then reboot, or run sudo udevadm control -R and insert the modem. You need to wait about 30 seconds for modem to boot, then you can use it.

2
  • solved my problem permanently Aug 12, 2017 at 9:45
  • Same here, it was so easy I learnt nothing. :|
    – Enjoy87
    Sep 7, 2018 at 5:55
0

None of these solutions works on my 16.04. (udev rules worked perfectly on 14.04).

I mean, sometimes this does work, but very rarely. I tested these manual commands

usb_modeswitch -v 12d1 -p 15ca -V 12d1 -P 1506 -M "55534243123456780000000000000011062000000100000000000000000000"

and

/usr/sbin/usb_modeswitch -J -v 0x12d1 -p 0x15ca

and they do work, but not every time, even, if entered by hand. The device remains listed as "mass storage" in more than half cases.

:(

Therefore I had to use a very dirty solution: I added the latter one to root's crontab to run every 10 seconds. I know it's ridiculous, but I cannot think of anything better in these circumstances. The command will work if the device is listed as mass storage (if it is already turned into a modem, it just exits with a message "No devices in default mode found. Nothing to do. Bye!" so it does not interfere with a properly working modem.

This is stupid, but in case somebody would like to use it, here are my crontab entries:

* * * * *           /usr/sbin/usb_modeswitch -J -v 0x12d1 -p 0x15ca  > /dev/null 2>&1
* * * * * sleep 10; /usr/sbin/usb_modeswitch -J -v 0x12d1 -p 0x15ca  > /dev/null 2>&1
* * * * * sleep 20; /usr/sbin/usb_modeswitch -J -v 0x12d1 -p 0x15ca  > /dev/null 2>&1
* * * * * sleep 30; /usr/sbin/usb_modeswitch -J -v 0x12d1 -p 0x15ca  > /dev/null 2>&1
* * * * * sleep 40; /usr/sbin/usb_modeswitch -J -v 0x12d1 -p 0x15ca  > /dev/null 2>&1
* * * * * sleep 50; /usr/sbin/usb_modeswitch -J -v 0x12d1 -p 0x15ca  > /dev/null 2>&1

The device starts working after either 10 or 20 seconds (if the command has to be run twice - which is most of the cases).

I also added this to my /etc/fstab to prevent an attempt to mount the usb mass storage shortly after inserting. This prevents the "Open files" window which normally shows up when a CD is inserted.

/dev/sr0 on /media/username/PLAY\ ONLINE iso9660 noauto

(you have to adjust the mounting place according to what the mount command shows after the device is mounted - mine mounts in the PLAY ONLINE folder, which is the name of my mobile provider).

0

You want to automate this? if you modem plug in you didn't setting again.

first

sudo nano /etc/usb_modeswitch.conf

copy this code

# HUAWEI E3131 DefaultVendor=0x12d1 DefaultProduct=0x15ca TargetVendor=0x12d1 TargetProduct=0x1506 MessageContent="55534243123456780000000000000a11062000000000000100000000000000"

save, and execute this on terminal

sudo usb_modeswitch -c /etc/usb_modeswitch.conf

and wait a minute, if you modem detected and you can use to connect to the internet, this setting is work.

Not the answer you're looking for? Browse other questions tagged or ask your own question.