This article will guide you through the installation and configuration steps of 3G Huawei Modem on CentOS 6.x

Follow the steps mentioned in the following order.

1) Prerequisite

  • CentOS/RHEL 6. in working condition.
  • Following dependent package that needs to be installed first.

First download the appropriate rpmforge-release package for your distribution:

Then you can use or to the downloaded package. The package installation will enable the RepoForge repo for subsequent use via yum.

  yum install wvdial usb_modeswitch-data usb_modeswitch

Connect the USB 3G  on the system and check the device is detected using lsusb command or in /var/log/messages.

   lsusb
   Bus 001 Device 003: ID 12d1:140c Huawei Technologies Co., Ltd.

OR

   tail -f /var/log/messages

   Aug 1 11:09:04 localhost : usb 1-7: Product: HUAWEI Mobile
   Aug 1 11:09:04 localhost : usb 1-7: Manufacturer: HUAWEI Technology

Check the device type by which modem is connected using dmesg.

   dmesg | grep tty

   usb 1-8: GSM modem (1-port) converter now attached to ttyUSB0
   usb 1-8: GSM modem (1-port) converter now attached to ttyUSB1
   usb 1-8: GSM modem (1-port) converter now attached to ttyUSB2
   usb 1-8: GSM modem (1-port) converter now attached to ttyUSB3

Once USB is connected and detected, now is the time to configure wvdial.

   vi /etc/wvdial.conf 
   [Dialer Defaults]
   Init1 = ATZ
   Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
   Init3 = AT+CGDCONT=1,"","airtelgprs.com"
   stupid mode = 1
   Modem Type = USB Modem
   Baud = 460800
   New PPPD = yes
   Modem = /dev/ttyUSB0
   ISDN = 0
   Phone = *99#
   Carrier Check = no
    = airtel
   Username = airtel
   FlowControl=Hardware(CRTSCTS)

Once we have prepared the config file now is the time to connect wvdial.

   wvdial
   --> WvDial: Internet dialer version 1.60
   --> Cannot get information for serial port.
   --> Initializing modem.
   --> Sending: ATZ
   OK
   --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
   ATQ0 V1 E1 S0=0 &C1 &D2
   OK
   --> Sending: AT+CGDCONT=1,"IP","gocit.vn"
   AT+CGDCONT=1,"IP","gocit.vn"
   OK
   --> Modem initialized.
   --> Sending: ATDT*99#
   --> Waiting for carrier.
   ATDT*99#
   CONNECT
   --> Carrier detected.  Starting PPP immediately.
   --> Starting pppd at Mon Aug  5 18:55:58 2013
   --> Pid of pppd: 3070
   --> Using interface ppp0
   --> pppd: ?
   --> pppd: ?
   --> pppd: ?
   --> pppd: ?
   --> pppd: ?
   --> local  IP address 223.228.201.19
   --> pppd: ?
   --> remote IP address 10.64.64.64
   --> pppd: ?
   --> primary    address 125.22.47.102
   --> pppd: ?
   --> secondary  address 125.22.47.103
   --> pppd: ?

Check the logs (/var/log/messages) and try to make entry of Primary and Secondary DNS server in /etc/resolv.conf, if it is not updated.

   Aug 1 14:35:40 localhost pppd[3794]: pppd 2.4.5 started by , uid 0
   Aug 1 14:35:40 localhost pppd[3794]: Using interface ppp0
   Aug 1 14:35:40 localhost pppd[3794]: Connect: ppp0 <--> /dev/ttyUSB0
   Aug 1 14:35:40 localhost pppd[3794]: CHAP authentication succeeded
   Aug 1 14:35:40 localhost pppd[3794]: CHAP authentication succeeded
   Aug 1 14:35:43 localhost pppd[3794]: Could not determine remote IP address: defaulting to 10.64.64.64
   Aug 1 14:35:43 localhost pppd[3794]: local IP address 106.200.21.246
   Aug 1 14:35:43 localhost pppd[3794]: remote IP address 10.64.64.64
   Aug 1 14:35:43 localhost pppd[3794]: primary DNS address 125.22.47.102
   Aug 1 14:35:43 localhost pppd[3794]: secondary DNS address 125.22.47.103
   Aug 1 14:35:45 localhost ntpd[2903]: Listening on interface #5 ppp0, 106.200.21.246#123 Enabled

Resolv file will look like

   vi /etc/resolv.conf 
   nameserver 8.8.8.8
   nameserver 208.67.222.222

Congratulation now you are connected, grap a glass of bear and enjoy surfing the Net.

Debugging steps

*) Check device is in Storage or Modem Mode.

**) Use usb-devices or lsusb command to check.

   usb-devices
   T: Bus=01 Lev=01 Prnt=01 Port=07 Cnt=01 Dev#= 9 Spd=480 MxCh= 0
   D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
   P: Vendor=12d1 ProdID=1446 Rev=00.00
   S: Manufacturer=HUAWEI Technology
   S: Product=HUAWEI Mobile
   C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
   I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
   I: If#= 1 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

OR

   lsusb
   Bus 001 Device 003: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800/E173 (HSPA modem)

1446” is the product id for the file mode of this dongle. (It is in Storage mode).

   lsusb
   Bus 001 Device 003: ID 12d1:140c Huawei Technologies Co., Ltd.

140c” is the product id for the file mode of this dongle. (It is in USB mode).

**) Load the usbserial kernel module using following command.

   modprobe usbserial vendor=0x12d1 product=0x140c

**) usb_modeswitch package is used to the USB dongle from CDROM file system to Modem mode (→ flip flop).

Create the following file.

   cat /etc/usb_modeswitch.conf
   DefaultVendor= 0x12d1 
   DefaultProduct=0x1446 

   TargetVendor= 0x12d1 
   TargetProductList="1001,1406,140b,140c,141b,14ac" 

   CheckSuccess=20 MessageContent="55534243123456780000000000000011060000000000000000000000000000" 

**) Now run the following command to switch from storage to modem mode.

   usb_modeswitch -c /etc/usb_modeswitch.conf
   Check the /var/log/message it will show something like
   Aug 1 14:35:08 localhost kernel: usb 1-8: configuration #1 chosen from 1 choice
   Aug 1 14:35:08 localhost kernel: option 1-8:1.0: GSM modem (1-port) converter detected
   Aug 1 14:35:08 localhost kernel: usb 1-8: GSM modem (1-port) converter now attached to ttyUSB0
   Aug 1 14:35:08 localhost kernel: option 1-8:1.1: GSM modem (1-port) converter detected
   Aug 1 14:35:08 localhost kernel: usb 1-8: GSM modem (1-port) converter now attached to ttyUSB1
   Aug 1 14:35:08 localhost kernel: option 1-8:1.2: GSM modem (1-port) converter detected
   Aug 1 14:35:08 localhost kernel: usb 1-8: GSM modem (1-port) converter now attached to ttyUSB2
   Aug 1 14:35:08 localhost kernel: option 1-8:1.3: GSM modem (1-port) converter detected
   Aug 1 14:35:08 localhost kernel: usb 1-8: GSM modem (1-port) converter now attached to ttyUSB3
   Aug 1 14:35:08 localhost kernel: scsi23 : SCSI emulation for USB Mass Storage devices
   Aug 1 14:35:08 localhost kernel: scsi24 : SCSI emulation for USB Mass Storage devices
   Aug 1 14:35:09 localhost modem-manager: (ttyUSB0) opening serial device...

**) Now try the steps mentioned from Steps 5 onwards.

*) Also try to remove any other mounted usb storage media and try the steps mentioned above once again.

 

Print Friendly, PDF & Email

Comments

comments

Bài viết liên quan