How to use my Huawei E3276 4G modem on Ubuntu 12.04

Asked by Dennis Carlson on 2012-10-12

I can not use my 4G modem. its not working with the network manager.
No access, no conection.

Question information

Can you please give the output of:

lsb_release -a; uname -a; lsusb

Thanks

Without usb modem it looks like this

dennis@dennis-K53U:~$ lsb_release -a; uname -a; lsusb

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 11.10

Release: 11.10

Codename: oneiric

Linux dennis-K53U 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 002: ID 04f2:b23b Chicony Electronics Co., Ltd

Bus 005 Device 002: ID 4168:1010

Bus 004 Device 003: ID 0cf3:3005 Atheros Communications, Inc.

dennis@dennis-K53U:~$

With the modem pluged in to the computer

dennis@dennis-K53U:~$ lsb_release -a; uname -a; lsusb
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric
Linux dennis-K53U 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04f2:b23b Chicony Electronics Co., Ltd
Bus 005 Device 002: ID 4168:1010
Bus 004 Device 003: ID 0cf3:3005 Atheros Communications, Inc.
dennis@dennis-K53U:~$ dennis@dennis-K53U:~$ lsb_release -a; uname -a; lsusb
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric
Linux dennis-K53U 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04f2:b23b Chicony Electronics Co., Ltd
Bus 005 Device 002: ID 4168:1010
Bus 004 Device 003: ID 0cf3:3005 Atheros Communications, Inc.
dennis@dennis-K53U:~$

Thomas Kr├╝ger (thkrueger) said : #3

I can't see any new device in the list.
Please make sure your device has been connected for at least 30s and run this again:

lsusb

Thanks!

dennis@dennis-K53U:~$ lsb_release -a; uname -a; lsusb
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
Codename: precise
Linux dennis-K53U 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 UTC 2012 i686 athlon i386 GNU/Linux
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 007: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
Bus 001 Device 004: ID 04f2:b23b Chicony Electronics Co., Ltd
Bus 005 Device 002: ID 4168:1010
Bus 004 Device 002: ID 0cf3:3005 Atheros Communications, Inc. AR3011 Bluetooth
dennis@dennis-K53U:~$

Try:

sudo modprobe usbserial vendor=0x12d1 product=0x1506

Then try using the device. Does it work, if it's good we can make it permanent

I am sorry to say it does not work.

Try:

sudo eject /dev/sr0

I've seen that on guides online. Basically if you search for:

12d1:1506 ubuntu

online, you will find tonnes of guides and how tos

OlofE (olof-e) said : #9

Hi Dennis!

Did you got your Huawei E3276 to work? I have spent several days on it as well, both trying to connect using pppd and /dev/cdc-wdm0 (QMI) but without success. Any luck on your end?

Hi Olof.

Its the same here. I have tried the same with on success.
Hope someone can help.

OlofE (olof-e) said : #11

Hi Dennis!

With the support of linux community the Huawei E3276 is supported now (see thread here http://lists.freedesktop.org/archives/libqmi-devel/2012-November/thread.html) . You need an updated cdc_ncm.ko driver and then connect with

echo -e "AT^NDISDUP=1,1,\"online.telia.se\"\r" > /dev/ttyUSB0
dhclient wwan0

Assuming you have configured usb modeswitch beforehand with:

echo "12d1 1506" > /sys/bus/usb-serial/drivers/option1/new_id

Works with telia in Sweden.

Bjorn will push this into the linux main branch soon, but if you are eager to hack, you can update drivers/net/usb/cdc_ncm.c with this:

diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 4cd582a..74fab1a 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -540,10 +540,12 @@ advance:
      (ctx->ether_desc == NULL) || (ctx->control != intf))
   goto error;

- /* claim interfaces, if any */
- temp = usb_driver_claim_interface(driver, ctx->data, dev);
- if (temp)
- goto error;
+ /* claim data interface, if different from control */
+ if (ctx->data != ctx->control) {
+ temp = usb_driver_claim_interface(driver, ctx->data, dev);
+ if (temp)
+ goto error;
+ }

  iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber;

@@ -623,6 +625,10 @@ static void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf)

  tasklet_kill(&ctx->bh);

+ /* handle devices with combined control and data interface */
+ if (ctx->control == ctx->data)
+ ctx->data = NULL;
+
  /* disconnect master --> disconnect slave */
  if (intf == ctx->control && ctx->data) {
   usb_set_intfdata(ctx->data, NULL);
@@ -1245,6 +1251,14 @@ static const struct usb_device_id cdc_devs[] = {
    .driver_info = (unsigned long) &wwan_info,
  },

+ /* Huawei NCM devices disguised as vendor specific */
+ { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x16),
+ .driver_info = (unsigned long)&wwan_info,
+ },
+ { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46),
+ .driver_info = (unsigned long)&wwan_info,
+ },
+
  /* Generic CDC-NCM devices */
  { USB_INTERFACE_INFO(USB_CLASS_COMM,
   USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),

moma (osmoma) said : #12

Hello,
I have Huawei E3276 in Ubuntu 13.04 (beta). It does not connect at all and no 4G/3G entries in the modem manager.
It works fine in Windows.
Do I still need to patch the driver as shown above?

$ lsusb
Bus 003 Device 005: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard

Marius B. Kotsbak (mariusko) said : #13

Please leave the bug link alone. I'm trying to follow up on a permanent fix for this.

Janis Jansons (janhouse) said : #14

While it hasn't been fixed in NetworkManager, you could send AT commands to the modem to get it up.
I wrote a script that does this: https://github.com/Janhouse/4g-connect-linux

Basically you do:

screen /dev/ttyUSB0

ATZ
ATQ0 V1 E1 S0=0
AT^NDISDUP=1,1,"internet.lmt.lv"

and then
dhcpcd wwan0

Pijo (pijo) said : #15

E3276 from polish operators -Polkomtel/Cyfrowy Polsat support RAS mode. (non-Hilink version)

AT^SETPORT? //(current mode)

AT^SETPORT=? // (suported modes)

^SETPORT:1: 3G MODEM
^SETPORT:2: 3G PCUI
^SETPORT:3: 3G DIAG
^SETPORT:5: 3G GPS
^SETPORT:A: BLUE TOOTH
^SETPORT:16: NCM
^SETPORT:A1: CDROM
^SETPORT:A2: SD
^SETPORT:10: 4G MODEM
^SETPORT:12: 4G PCUI
^SETPORT:13: 4G DIAG
^SETPORT:14: 4G GPS

Default mode is NCM (Network Card Mode) and looks like this :A1,A2;12,16,A1,A2

We have to change to RAS mode by sending AT command: AT^SETPORT="A1,A2;1,2,3"

After that E3276 works like any other Huawei RAS modem. Modem works with NM or we can use wvdial.

Sergio Henrique (smigmh) said : #16

When I use either Janis' or Pijo's suggestions, it does immediately work with NM but I get very low speeds. Meaning less than 1Mb download on speed test websites instead of the ~15Mbs I get on a Windows 7 laptop just beside it.

Is that an issue with my system or can it be the AT commands that cause that?

Long John Silver (sprager999) said : #17

When trying to get my E3276 [M150-1] to work, but am unable to get an IP address assigned.
I only installed the latest x64 Ubuntu and dhcpcd so perhaps i am missing something?

These are the commands i used:
usb_modeswitch -v 0x12d1 -p 0x14fe -M '55534243123456780000000000000011062000000100000000000000000000'
echo 'ATZ' > /dev/ttyUSB0
echo 'ATQ0 V1 E1 S0=0' > /dev/ttyUSB0
echo 'AT^NDISDUP=1,1,"drei.at"' > /dev/ttyUSB0

after about 30 seconds
dhcpcd wwan0

root@vBuntu:/dev# dhcpcd wwan0
err, wwan0: timed out
err, wwan0: lease information file `/var/lib/dhcpcd/dhcpcd-wwan0.info' does not exist
warn, wwan0: using IPV4LL address 169.254.246.200
root@vBuntu:/dev# dhcpcd.sh: interface wwan0 has been configured with new IP=169.254.246.200

root@vBuntu:/dev# lsb_release -a; uname -a; lsusb
LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 13.10
Release: 13.10
Codename: saucy
Linux vBuntu 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Bus 001 Device 005: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

before mode switching:
Bus 001 Device 002: ID 12d1:14fe Huawei Technologies Co., Ltd.

after mode switching:
Bus 001 Device 005: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard

Long John Silver (sprager999) said : #18

Is there anywhere documentation on what these AT commands do?

When i send them to the modem i don't get any replies if i monitor it with screen ttyUSB0 so i am thinking it is not working at all because it should respond? Tried it with an E398 and the mentioned E3276 in a Parallels Ubuntu VM.

Did the cdc_ncm.ko driver get updated in the latest Ubuntu release or is it still broken?

Marius B. Kotsbak (mariusko) said : #19

Is this helpful?: https://mail.gnome.org/archives/networkmanager-list/2013-May/msg00217.html

Seems like the modem should be working in 14.04 when qmi support is going to be available.

Long John Silver (sprager999) said : #20

Thanks Marius, i just tested the latest Ubuntu x64 trusty release and used the script Janis provided.

Now my modem establishes a connection(LED changes from blinking into a solid state) but i am unable to get an IP address from the modem.

Opening device: /dev/ttyUSB0
> ATZ
> OK
> ATZ
> OK
> ATQ0 V1 E1 S0=0
> OK
> AT^NDISDUP=1,1,"drei.at"
> OK
> ^NDISSTAT:1,,,"IPV4"
> AT^DHCP?
> ^DHCP: 16FF774D,FCFFFFFF,15FF774D,15FF774D,104E5ED5,114E5ED5,150000000,150000000
> OK
err, wwan0: timed out
warn, wwan0: using IPV4LL address 169.254.138.1
Hexadecimal number > 0xffffffff non-portable at e3276.pl line 73.
' ignored at e3276.pl line 73.
Hexadecimal number > 0xffffffff non-portable at e3276.pl line 73.

Marius B. Kotsbak (mariusko) said : #21

Okay, I think what you want to wait for is QMI support, and then watch this bug report: https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1264630

Long John Silver (sprager999) said : #22

Thanks, although even with qmi it does not work.
http://cgit.freedesktop.org/libqmi

root@vBuntu:/dev# qmi-network /dev/cdc-wdm0 start
Loading profile...
    APN: drei.at
Starting network with 'qmicli -d /dev/cdc-wdm0 --wds-start-network=drei.at --client-no-release-cid'...
error: couldn't create client for the 'wds' service: CID allocation failed in the CTL client: Transaction timed out
error: network start failed, client not allocated

Long John Silver (sprager999) said : #23

With my older E398 i can establish a connection with the qmi-network script and can successfully request an IP.

qmi-network /dev/cdc-wdm0 start
Loading profile...
    APN: drei.at
Starting network with 'qmicli -d /dev/cdc-wdm0 --wds-start-network=drei.at --client-no-release-cid'...
Saving state... (CID: 1)
Saving state... (PDH: 38750672)
Network started successfully

Marius B. Kotsbak (mariusko) said : #24

Ah, in that case, is any of these helpful?: https://www.google.com/search?q=E3276+&sitesearch=lists.freedesktop.org

If not, and you are using the latest libqmi version/from git, I suggest explaining the problem on that libqmi mailinglist to handle it as an upstream problem.

Long John Silver (sprager999) said : #25

I believe the message to switch my version of the E3276 is wrong.
In the logs of the dovado pro router i bought i can see that it switched to a different product id.

info USB: Detected new item: Vendor=0x12d1, Product=0x14fe
info USB: Detected new item: Vendor=0x12d1, Product=0x1c1e

Prior the dovado firmware update it was switched into a different product id[1506] and i was having the same problems with the dovado pro router.

My Huawei E3276 is working fine with the Ubuntu:

http://www.4gltemall.com/huawei-e3276-4g-lte-surfstick.html

Gunnar Steiner (k-gunnar) said : #27

My Huawei E3276 is not even detected on my system. What do I need to do?

root@sm000243130045-HM:/# lsb_release -a; uname -a; lsusb
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise
Linux sm000243130045-HM 3.8.13-bone26 #74 SMP Sat Mar 22 02:27:23 PDT 2014 armv7l armv7l armv7l GNU/Linux
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@sm000243130045-HM:/#

Any help much appreciated.
Thanks

Uqbar (uqbar) said : #28

As of Kubuntu 14.04.1 LTS updated, I just needed this command:

sudo modprobe usbserial vendor=0x12d1 product=0x1506

to have the modem accessible as /dev/ttyUSB0.
Maybe later on I'll also check with ppp.

You can make that stick with:

echo "options usbserial vendor=0x12d1 product=0x1506" | sudo tee /etc/modprobe.d/usbserial.conf > /dev/null

Then when you run:

sudo modprobe usbserial

It will use the options by default. If you also run:

echo "usbserial" | sudo tee -a /etc/modules > /dev/null

It will be loaded at boot, with the options.

Uqbar (uqbar) said : #30

I would make the change in the udev stuff so everything gets loaded at dongle insertion.

stephen wu (wdsjy1314) said : #31

Hi ,
    My kernel is 2.6.27,no cdc_ncm.c, can Huawei E3276 work on it?And How?
Any help much appreciated.
Thanks!

Can you help with this problem?

Provide an answer of your own, or ask Dennis Carlson for more information if necessary.

To post a message you must log in.