User Tools

Site Tools


installing_huawei_s_e166_modem

Introduction

Huawei's E16 modem offers connection to 3G internet, but since the device has his own flash memory for storing the Windows driver and documentation, once you connect it running a Linux OS, it will recognized as a flash drive and not a modem. This guide will cover the basics to add the module drivers, software and configuration files to enable the access to the internet via 3G. This also applies to kernel 2.4 as it has been successfully done too!

Kernel modules compilation

First of all, you need to compile the usbserial module for you specific kernel (refer to the “Compiling and running kernel 2.6” guide for information regarding kernel modules compilation). In the kernel configuration menu go to

device drivers ---> 
    usb support ---> 
        usb serial converter support --->   

and activate the usbserial converter as a module:

<M> USB Serial Converter support
[*] USB Generic Serial Driver

Mark the ppp modules for kernel compilation. Go to

device drivers ---> 
    network devices support --->

and activate the ppp modules:

[*] Network device support
<M> PPP (point-to-point protocol) support
<M> PPP support for async serial ports
<M> PPP MPPE compression (encryption)

Filesystem configuration

Go ahead and run depmod for all the modules' dependencies to be created:

depmod -a

Open up the modules file

nano /etc/modules

and add the modules to be loaded at boot up time:

slhc
ppp_generic
crc-ccitt (for kernel 2.6 only)
ppp_async

Restart your system.

Plug in your modem and issue the command:

more /proc/bus/usb/devices

Make sure that the usb-storage driver hasn’t been assigned to the modem, if it has, uninstall the usb-storage module:

rmmod usb-storage

Install usbserial:

modprobe usbserial vendor=0x12d1 product=0x1001

Now type

more /proc/bus/usb/devices

should look at something like this:

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 3          	 
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0                             	 
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1               	 
P:  Vendor=0000 ProdID=0000 Rev= 0.00                                      	 
S:  Product=USB OHCI Root Hub                                              	 
S:  SerialNumber=e0020000                                                  	 
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA                                     	 
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub          	 
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms                              	 
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0          	 
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1               	 
P:  Vendor=12d1 ProdID=1001 Rev= 0.00                                      	 
S:  Manufacturer=�������������������                                       	 
S:  Product=HUAWEI Mobile                                                  	 
S:  SerialNumber=�������������������                                       	 
C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA                                     	 
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=serial       	 
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=128ms                              	 
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms                                	 
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms                                	 
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=serial       	 
E:  Ad=84(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms                                	 
E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms                                	 
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=serial       	 
E:  Ad=85(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms                                	 
E:  Ad=05(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms                                	 
I:  If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage       	 
E:  Ad=83(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms                                	 
E:  Ad=04(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

As you can see, the usbserial module has been correctly assigned to the modem. If the last part did not work for you, follow the next steps:

Go to the USB_modeswitch page, download usb-modeswitch-1.1.6 and usb-modeswitch-data and install them according to the instructions. Once you have installed both of them, copy the configuration file for the Huawei E166:

cp /etc/usb_modeswitch.d/12d1\:1001 /etc/usb_modeswitch.conf

Run the program using the correct configuration file:

usb_modeswitch -c /etc/usb_modeswitch.conf

Uninstall usbserial and install it again:

rmmod usbserial

modprobe usbserial vendor=0x12d1 product=0x1001

Check that the usb-serial driver has been correctly assigned:

more /proc/bus/usb/devices

Installing and configuring wvdial

Install wvdial on your board:

apt-get install wvdial

Follow the steps to automatically detect your modem or quit and run the configuration program to create the configuration file:

wvdialconf

Modify the /etc/wvdial.conf file according to your Internet connection. Mine looks like this:

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","kolbi3g"
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Phone = *99#
Username = "kolbi3g"
Password = "kolbi3g"
Stupid Mode = 1
Ask Password = 0
Dial Command = ATDT
Compuserve = 0
Force Address =
Idle Seconds = 3000
DialMessage1 =
DialMessage2 =

Fire up your Internet connection:

wvdial

Setting up static DNS's

If you want to configure your DNS's to be static, open up /etc/ppp/peers/wvdial

nano /etc/ppp/peers/wvdial

and comment the line usepeerdns:

#userpeerdns

Next, turn Auto DNS off in your wvdial.conf file, open up

nano /etc/wvdial.conf

and add the following lines:

check DNS = no
auto DNS = no

Now change your resolv.conf file and add your DNS’s:

nano /etc/resolv.conf

Mine looks like this:

200.91.75.5
200.91.75.6

Start up/turn off scripts

If you want, you can write your own scripts to start or stop the connection automatically (don't forget to make them executable). Create a start up script

nano /sbin/ppp-on

and write the following in it:

#!/bin/sh
PATH=/usr/local/bin:/bin:/usr/bin 
wvdial $* >/dev/null 2>&1 &

Create a another script to turn off the connection

nano /sbin/ppp-off

and write the following in it:

#!/bin/sh
PATH=/usr/local/bin:/bin:/usr/bin
echo -n "Disconnecting... "
killall wvdial
sleep 2
echo -e "\a\c"
echo "Complete!"

Now wvdial will run in the background and can be turned on or off using ppp-on and ppp-off respectively.

installing_huawei_s_e166_modem.txt · Last modified: 2017/01/03 21:26 by admin