Sagar Behere

I doubt, therefore I might be

Huawei e5776s-32 with Debian Wheezy

I recently got a Huawei E5776s-32 4G router which offers a wireless interface as well as a USB cable to connect it to a PC. While usage via the wireless interface is straightforward, using the device in Linux (Debian Wheezy. Actually Crunchbang 11 Waldorf.) took a little bit of work. This post explains how to use the device via the USB cable.

The default Crunchbang installation comes with kernel 3.2.0 and this kernel seems to be too old to detect the usb networking interface offered by the e5776s-32. I installed kernel 3.13 from the wheezy backports repository, which is the latest version in the repo at the time of this writing. However, kernel 3.13 seems to have a bug which prevents the huawei_cdc_ncm interface from working via the usb-cable. See

  1. https://bugs.archlinux.org/task/39021 and
  2. http://www.spinics.net/lists/linux-usb/msg97112.html

So I eventually installed kernel 3.12 from the wheezy backports repository and that works well.

Conclusion: Use kernel 3.12

When the e5776s-32 device is plugged into the usb port, upto 4 different devices pop up.

  1. A usb networking device. This is usually presented as wwan0
  2. A usb GSM modem
  3. MicroSD card becomes available as a standard usb storage device and
  4. A small (8Mb) "CD-ROM" device, which is actually a bit of storage in the e5776s-32 contaning the windows drivers

dmesg shows the following output

Apr 23 14:47:38 maya kernel: [  221.400261] usb 3-2: new high-speed USB device number 4 using ehci-pci
Apr 23 14:47:38 maya kernel: [  221.534407] usb 3-2: New USB device found, idVendor=12d1, idProduct=1506
Apr 23 14:47:38 maya kernel: [  221.534421] usb 3-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
Apr 23 14:47:38 maya kernel: [  221.534428] usb 3-2: Product: HUAWEI Mobile
Apr 23 14:47:38 maya kernel: [  221.534434] usb 3-2: Manufacturer: HUAWEI Technology
Apr 23 14:47:38 maya kernel: [  221.540938] usb-storage 3-2:1.2: USB Mass Storage device detected
Apr 23 14:47:38 maya kernel: [  221.541137] scsi7 : usb-storage 3-2:1.2
Apr 23 14:47:38 maya kernel: [  221.541434] usb-storage 3-2:1.3: USB Mass Storage device detected
Apr 23 14:47:38 maya kernel: [  221.541584] scsi8 : usb-storage 3-2:1.3
Apr 23 14:47:38 maya mtp-probe: checking bus 3, device 4: "/sys/devices/pci0000:00/0000:00:06.1/usb3/3-2"
Apr 23 14:47:38 maya mtp-probe: bus: 3, device: 4 was not an MTP device
Apr 23 14:47:38 maya kernel: [  221.566414] usb 3-2: MAC-Address: 0c:5b:8f:27:9a:64
Apr 23 14:47:38 maya kernel: [  221.566764] cdc_ncm 3-2:1.1 wwan0: register 'cdc_ncm' at usb-0000:00:06.1-2, Mobile Broadband Network Device, 0c:5b:8f:27:9a:64
Apr 23 14:47:38 maya kernel: [  221.566792] usbcore: registered new interface driver cdc_ncm
Apr 23 14:47:38 maya kernel: [  221.585591] usbcore: registered new interface driver usbserial
Apr 23 14:47:38 maya kernel: [  221.585607] usbcore: registered new interface driver usbserial_generic
Apr 23 14:47:38 maya kernel: [  221.585616] usbserial: USB Serial support registered for generic
Apr 23 14:47:38 maya kernel: [  221.600829] usbcore: registered new interface driver option
Apr 23 14:47:38 maya kernel: [  221.600981] usbserial: USB Serial support registered for GSM modem (1-port)
Apr 23 14:47:38 maya kernel: [  221.601115] option 3-2:1.0: GSM modem (1-port) converter detected
Apr 23 14:47:38 maya kernel: [  221.601188] usb 3-2: GSM modem (1-port) converter now attached to ttyUSB0
Apr 23 14:47:39 maya kernel: [  222.542333] scsi 7:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
Apr 23 14:47:39 maya kernel: [  222.542414] scsi 8:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
Apr 23 14:47:39 maya kernel: [  222.661300] sr1: scsi-1 drive
Apr 23 14:47:39 maya kernel: [  222.661866] sr 7:0:0:0: Attached scsi generic sg3 type 5
Apr 23 14:47:39 maya kernel: [  222.662037] sd 8:0:0:0: Attached scsi generic sg4 type 0
Apr 23 14:47:39 maya kernel: [  222.901417] sd 8:0:0:0: [sdc] Attached SCSI removable disk

We can interact with the device either via the GSM modem (attached to /dev/ttyUSB0 in this case) or via the usb network interface. The latter option is easier and the one we will use. It simply consists of bringing up the interface and acquiring a DHCP address. This is achieved via the following commands

sudo ifconfig wwan0 up;
sudo dhclient wwan0;

If everything succeeds, you will see that the interface has acquired an ip address

sagar@maya:~$ sudo ifconfig wwan0
wwan0     Link encap:Ethernet  HWaddr 0c:5b:8f:27:9a:64  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::e5b:8fff:fe27:9a64/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10888 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8451 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3301425 (3.1 MiB)  TX bytes:97213554 (92.7 MiB)

Now you can open a browser and visit http://192.168.1.1 for doing further configuration of the device via its web interface.

Tip

By default the sudo dhclient wwan0 command sets the DNS server to be the device itself i.e. 192.168.1.1. You can see this be examining the contents of /etc/resolv.conf. You may want to use other DNS servers, for example 8.8.8.8, in certain cases, to get faster name lookups.