jump to navigation

Centos 6.3 – D-Link DWM-652 3G HSDPA Modem – DiGi 3 February 2013

Posted by Maulvi Bakar in : Linux,System , trackback

Recently I had a need to have a CentOS 6.3 Server connected to the Internet. So, I dug out my old trusty D-Link DWM-652 3G HSDPA Modem and subscribed to a Data-Only DiGi Broadband Internet.

The next challenge is to configure it.

Fortunately, CentOS 6.3 and its most recent kernel – 2.6.32-279.19.1 (at the time of writing) seems modern enough, that it detects the built-in cd-rom storage of the D-Link DWM-652 and promptly ejects it and re-detects the GSM Modem and properly mounts it.

Dmesg Output –
# dmesg
much truncated
usb 5-4: new full speed USB device number 2 using ohci_hcd
usb 5-4: New USB device found, idVendor=1186, idProduct=3e02
usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 5-4: Product: USB Mass Storage
usb 5-4: Manufacturer: D-Link Corporation
usb 5-4: SerialNumber: 000000000002
usb 5-4: configuration #1 chosen from 1 choice
Initializing USB Mass Storage driver...
scsi6 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb-storage: device scan complete
scsi 6:0:0:0: CD-ROM D-Link CDROM 1.01 PQ: 0 ANSI: 4
scsi 6:0:0:0: Attached scsi generic sg2 type 5
sr0: scsi3-mmc drive: 0x/0x caddy
Uniform CD-ROM driver Revision: 3.20
sr 6:0:0:0: Attached scsi CD-ROM sr0
sr0: CDROM (ioctl) error, command: Get configuration 46 00 00 00 00 00 00 00 20 00
sr: Sense Key : Hardware Error [current]
sr: Add. Sense: No additional sense information
sr0: CDROM (ioctl) error, command: Get configuration 46 00 00 00 00 00 00 00 20 00
sr: Sense Key : Hardware Error [current]
sr: Add. Sense: No additional sense information
sr0: CDROM (ioctl) error, command: Get configuration 46 00 00 00 00 00 00 00 20 00
sr: Sense Key : Hardware Error [current]
sr: Add. Sense: No additional sense information
usb 5-4: USB disconnect, device number 2
Buffer I/O error on device sr0, logical block 1
Buffer I/O error on device sr0, logical block 512
Buffer I/O error on device sr0, logical block 7
Buffer I/O error on device sr0, logical block 1
Buffer I/O error on device sr0, logical block 512
usb 5-4: new full speed USB device number 3 using ohci_hcd
usb 5-4: New USB device found, idVendor=1186, idProduct=3e04
usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=20
usb 5-4: Product: D-Link DWM-652 3.5G HSDPA Adapter
usb 5-4: Manufacturer: D-Link Corporation
usb 5-4: SerialNumber: 0000000000000000
usb 5-4: configuration #1 chosen from 1 choice
usb-storage: device ignored
usb-storage: device ignored
usb-storage: device ignored
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for GSM modem (1-port)
option 5-4:1.1: GSM modem (1-port) converter detected
usb 5-4: GSM modem (1-port) converter now attached to ttyUSB0
option 5-4:1.2: GSM modem (1-port) converter detected
usb 5-4: GSM modem (1-port) converter now attached to ttyUSB1
usbcore: registered new interface driver option
option: v0.7.2:USB Driver for GSM modems

Note the USB Device’s ttyUSB which you may need to guess the proper ones. Usually if you do not have any other USB Devices connected to it, it’ll be the ttyUSB0 which you will need as the modem entry for the /etc/wvdial.conf file.

# ls -l /dev/ttyUSB*
crw-rw----. 1 root dialout 188, 0 Feb 3 02:16 /dev/ttyUSB0
crw-rw----. 1 root dialout 188, 1 Feb 3 00:36 /dev/ttyUSB1

Next is to install the necessary RPM Packages, in this case – wvdial

# yum install wvdial

You’ll notice that it installs the dependencies –

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
wvdial x86_64 1.60-12.el6 base 92 k
Installing for dependencies:
libwvstreams x86_64 4.6-6.el6 base 603 k
lockdev x86_64 1.0.1-18.el6 base 25 k
ppp x86_64 2.4.5-5.el6 base 323 k

Below is the contents that I used in the file /etc/wvdial.conf. Take note of the Modem entry and its tty device.

# cat /etc/wvdial.conf
[Dialer Defaults]
Modem = /dev/ttyUSB0
Modem Type = Analog Modem
ISDN = 0
Baud = 460800
Dial Attempts = 1
Username = user
Password = pass
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","DiGi.internet"
Phone = *99#
Stupid Mode = 1

Connecting –

# wvdial Defaults
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","DiGi.internet"
AT+CGDCONT=1,"IP","DiGi.internet"
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sun Feb 3 01:11:03 2013
--> Pid of pppd: 29518
--> Using interface ppp0
--> local IP address xxx.xxx.xxx.xxx
--> remote IP address 10.64.64.64
--> primary DNS address xxx.xxx.xxx.xxx
--> secondary DNS address xxx.xxx.xxx.xxx

Note – remote IP is the ISP’s Gateway IP, you may need to alter your current Default Gateway to this one –

Make note of the current Default Gateway, if it is an IP Address –

# netstat -r|grep default | awk {'print $2'}

If it is a hostname –

# netstat -r|grep default | awk {'print $2'}| awk -F. '{ print $1 }'

Delete the existing –

# route del default

Add new one –

# route add -net default gw 10.64.64.64 dev ppp0

To disconnect, simply press CTRL-C

^CCaught signal 2: Attempting to exit gracefully...
--> Terminating on signal 15
--> Connect time 21.4 minutes.
--> Disconnecting at Sun Feb 3 01:32:28 2013

Once disconnected, you may want to revert back to the previous Default Gateway. Use below command to add it back –

# route add -net default your-gateway

Comments»

no comments yet - be the first?


Challenge *

π