Ubuntu 12.04 support for Huawei E392

One of the best 4G/LTE modem available on the market doesn’t work with Ubuntu 12.04, given the default settings, even if it is supported by the kernel supplied. The problem resides in the usb_modeswitch tool, which misses the configuration for switching the device from the USB storage device mode to 4G modem.

The problem

USB modem sticks act like storage devices once connected to a computer. This is the default behaviour because you usually plug the modem in your Windows machine and install an application provided by your data carrier. This application is responsible for switching modem from storage device to 4G/3G modem mode. However, most of the time, the carrier supplies only a Windows version of their app and you will have to deal on your own with the problems that arise from connecting the device to a Linux-powered computer.

But Ubuntu and other distros are prepared for this(unlike the default drivers from Windows systems). There is an application called usb_modeswitch which detects the modem and switches the mode from usb storage device to data modem. This is done by writing a specific set of bytes on the USB data bus. Once this is done, you will get one or two /dev/ttyUSBX entries in /dev folder and the Broadband Connections widgets will handle the PPP connection (with minimal settings supplied by the user).

Solution for Huawei E392

I recently got a new unlocked Huawei E392u-12 and I wanted to connect my laptop to the internet using it. However, once I plugged it into the USB port, all I could do was to browse the contents of the stick.

After some google research, I understood that the device is not automatically switched to USB 4G modem mode. I had to use the usb_modeswitch tool to switch it manually (as root).

usb_modeswitch -v 12d1 -p 151a -V 12d1 -P 151b -W -M “55534243123456780000000000000011062000000100000000000000000000″

The -V and -P options can be omitted if you are trying to switch another modem from Huawei. The message content should work for most Huawei sticks.

Once this is done, you should see a device with 12d1:151b vendor/device IDs in the output of lsusb.

After that, just use the Network Manager and setup your Broadband Connection.

The system should perform everything automatically, once the USB stick is plugged in. Create the /etc/usb_modeswitch.d/12d1\:151a file with the following content:

usb_modeswitch config

usb_modeswitch configuration for Huawei E392

If you need to copy paste it:

# Huawei E392u-12

TargetVendor=  0x12d1
TargetProduct= 0x151b


You should also edit the /lib/udev/rules.d/40-usb_modeswitch.rules file and add the following content after LABEL=”modeswitch_rules_begin” line:

# Huawei E392u-12
ATTRS{idVendor}==”12d1″, ATTRS{idProduct}==”151a”, RUN+=”usb_modeswitch ‘%b/%k’”

udev rule

Udev Rule

From this point on, your modem should be automatically recognized as a 4G Modem once you plug it in the USB port.

Note that the solution presented here can be adapted for other Huawei modems also. Just test switching using the usb_modeswitch tool. Also report new results to http://www.draisberghof.de/usb_modeswitch/ .