User Tools

Site Tools


installing_huawei_s_e166_modem

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

installing_huawei_s_e166_modem [2017/01/03 21:26] (current)
admin created
Line 1: Line 1:
 +===== 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
 +
 +<​code>​
 +device drivers ---> ​
 +    usb support ---> ​
 +        usb serial converter support ---> ​  
 +</​code>​
 +
 +and activate the usbserial converter as a module:
 +
 +<​code>​
 +<M> USB Serial Converter support
 +[*] USB Generic Serial Driver
 +</​code>​
 +
 +Mark the ppp modules for kernel compilation. Go to
 +
 +<​code>​
 +device drivers ---> ​
 +    network devices support --->
 +</​code>​
 +
 +and activate the ppp modules:
 +
 +<​code>​
 +[*] Network device support
 +<M> PPP (point-to-point protocol) support
 +<M> PPP support for async serial ports
 +<M> PPP MPPE compression (encryption)
 +</​code>​
 +
 +==== Filesystem configuration ====
 +Go ahead and run ''​depmod''​ for all the modules'​ dependencies to be created:
 +
 +<​code>​
 +depmod -a
 +</​code>​
 +
 +Open up the modules file 
 +
 +<​code>​
 +nano /​etc/​modules
 +</​code>​
 +
 +and add the modules to be loaded at boot up time:
 +
 +<​code>​
 +slhc
 +ppp_generic
 +crc-ccitt (for kernel 2.6 only)
 +ppp_async
 +</​code>​
 +
 +Restart your system.
 +
 +Plug in your modem and issue the command: ​
 +
 +<​code>​
 +more /​proc/​bus/​usb/​devices
 +</​code>​
 +
 +Make sure that the usb-storage driver hasn’t been assigned to the modem, if it has, uninstall the usb-storage module:
 +
 +<​code>​
 +rmmod usb-storage
 +</​code>​
 +
 +Install usbserial:
 +
 +<​code>​
 +modprobe usbserial vendor=0x12d1 product=0x1001
 +</​code>​
 +
 +Now type
 +
 +<​code>​
 +more /​proc/​bus/​usb/​devices
 +</​code>​
 +
 +should look at something like this:
 +
 +<​code>​
 +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
 +</​code>​
 +
 +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 [[http://​www.draisberghof.de/​usb_modeswitch/​|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:
 +
 +<​code>​
 +cp /​etc/​usb_modeswitch.d/​12d1\:​1001 /​etc/​usb_modeswitch.conf
 +</​code>​
 +
 +Run the program using the correct configuration file:
 +
 +<​code>​
 +usb_modeswitch -c /​etc/​usb_modeswitch.conf
 +</​code>​
 +
 +Uninstall usbserial and install it again:
 +
 +<​code>​
 +rmmod usbserial
 +
 +modprobe usbserial vendor=0x12d1 product=0x1001
 +</​code>​
 +
 +Check that the usb-serial driver has been correctly assigned:
 +
 +<​code>​
 +more /​proc/​bus/​usb/​devices
 +</​code>​
 +
 +==== Installing and configuring wvdial ====
 +Install wvdial on your board:
 +
 +<​code>​
 +apt-get install wvdial
 +</​code>​
 +
 +Follow the steps to automatically detect your modem or quit and run the configuration program to create the configuration file:
 +
 +<​code>​
 +wvdialconf
 +</​code>​
 +
 +Modify the /​etc/​wvdial.conf file according to your Internet connection. Mine looks like this:
 +
 +<​code>​
 +[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 =
 +</​code>​
 +
 +Fire up your Internet connection:
 +
 +<​code>​
 +wvdial
 +</​code>​
 +
 +=== Setting up static DNS's ===
 +If you want to configure your DNS's to be static, open up /​etc/​ppp/​peers/​wvdial
 +
 +<​code>​
 +nano /​etc/​ppp/​peers/​wvdial
 +</​code>​
 +
 +and comment the line usepeerdns:
 +
 +<​code>​
 +#​userpeerdns
 +</​code>​
 +
 +Next, turn Auto DNS off in your wvdial.conf file, open up
 +
 +<​code>​
 +nano /​etc/​wvdial.conf
 +</​code>​
 +
 +and add the following lines:
 +
 +<​code>​
 +check DNS = no
 +auto DNS = no
 +</​code>​
 +
 +Now change your resolv.conf file and add your DNS’s:
 +
 +<​code>​
 +nano /​etc/​resolv.conf
 +</​code>​
 +
 +Mine looks like this:
 +
 +<​code>​
 +200.91.75.5
 +200.91.75.6
 +</​code>​
 +
 +=== 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
 +
 +<​code>​
 +nano /​sbin/​ppp-on
 +</​code>​
 +
 +and write the following in it:
 +
 +<​code>​
 +#!/bin/sh
 +PATH=/​usr/​local/​bin:/​bin:/​usr/​bin ​
 +wvdial $* >/​dev/​null 2>&1 &
 +</​code>​
 +
 +Create a another script to turn off the connection
 +
 +<​code>​
 +nano /​sbin/​ppp-off
 +</​code>​
 +
 +and write the following in it:
 +
 +<​code>​
 +#!/bin/sh
 +PATH=/​usr/​local/​bin:/​bin:/​usr/​bin
 +echo -n "​Disconnecting... "
 +killall wvdial
 +sleep 2
 +echo -e "​\a\c"​
 +echo "​Complete!"​
 +</​code>​
 +
 +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