getting huawei e8231 work on ubuntu 14.04

After connecting, i get following in lsusb

root@fwhlin:~ # lsusb | grep 12d1
Bus 009 Device 004: ID 12d1:1f01 Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)
root@fwhlin:~ # 

It says “Mass storage mode”. If you check demesg, you will see

[ 2385.775523] usb 9-2: New USB device found, idVendor=12d1, idProduct=1f01
[ 2385.775527] usb 9-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2385.775529] usb 9-2: Product: HUAWEI Mobile
[ 2385.775531] usb 9-2: Manufacturer: HUAWEI
[ 2385.775532] usb 9-2: SerialNumber: FFFFFFFFFFFFFFFF
[ 2385.837882] usb-storage 9-2:1.0: USB Mass Storage device detected
[ 2385.838108] scsi15 : usb-storage 9-2:1.0
[ 2386.858462] scsi 15:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[ 2386.859826] sr1: scsi-1 drive
[ 2386.859946] sr 15:0:0:0: Attached scsi CD-ROM sr1

Last line says, device mounted as “/dev/sr1”

root@fwhlin:~ # df -h | grep sr
/dev/sr1        4.3M  4.3M     0 100% /media/boby/MobileWiFi
root@fwhlin:~ # 

Changing Device Mode to Modem

I found some information about the device in file

sudo -s
cd /usr/share/usb_modeswitch
tar zxvf configPack.tar.gz
root@fwhlin:~ # cat /usr/share/usb_modeswitch/12d1:1f01
# Huawei E353 (3.se) and others
TargetVendor=0x12d1
TargetProductList="14db,14dc"
MessageContent="55534243123456780000000000000011062000000101000100000000000000"
NoDriverLoading=1
root@fwhlin:~ # 

It says device can operate as products “14db” and “14dc”.

I tried changing device mode to product id 14db, it did not work, so tried 14dc and it worked.

usb_modeswitch -v 12d1 -p 1f01 -V 12d1 -P 14dc -M "55534243123456780000000000000011062000000101000100000000000000"
root@fwhlin:~ # usb_modeswitch -v 12d1 -p 1f01 -V 12d1 -P 14dc -M "55534243123456780000000000000011062000000101000100000000000000"
Look for target devices ...
 No devices in target mode or class found
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 002 on bus 009
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: FFFFFFFFFFFFFFFF
-------------------------
Looking for active driver ...
 No active driver found. Detached before or never attached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Reset response endpoint 0x81
Reset message endpoint 0x01
-> Run lsusb to note any changes. Bye!

root@fwhlin:~ #

Now “ifconfig” shows usb0.

root@fwhlin:~ # ifconfig
...
...
...
usb0      Link encap:Ethernet  HWaddr be:69:7c:b1:a3:b6  
          inet addr:192.168.8.100  Bcast:192.168.8.255  Mask:255.255.255.0
          inet6 addr: fe80::bc69:7cff:feb1:a3b6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6315 (6.3 KB)  TX bytes:8138 (8.1 KB)

root@fwhlin:~ # 

If you check “lsusb”, now device have different product id.

root@fwhlin:~ # lsusb | grep 12d1
Bus 009 Device 003: ID 12d1:14dc Huawei Technologies Co., Ltd. 
root@fwhlin:~ # 

Connecting To Internet

You will need to disable eth0 or all traffic will be routed through it by default.

suo ifconfig eth0 down
root@fwhlin:~ # curl http://iptools.bizhat.com/ipv4.php
59.98.137.87
root@fwhlin:~ # sudo ifconfig eth0 down
root@fwhlin:~ # curl http://iptools.bizhat.com/ipv4.php
106.77.164.191
root@fwhlin:~ #
Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *