Posts Tagged ‘Linux 3G USB dongle’

Recently, I switchover my choice of Linux destroy from Ubuntu to Open Suse 11.2 and tried connecting to the internet using USB dongle. Kmanager is a default connection maker for using the USB dongle. It works at some stage but its really dodgy and pain!! Sometime it will connect but most of the time it will not. Everytime you connect a USB dongle to the laptop, the SUSE desktop assigns a new USB port id e.g. /dev/ttyUSB0, /dev/ttyUSB3 etc. The Knetmanager takes a while to re-locate the port id.

To over come with above knetmanager issue, I came up with my own scripts which works with wvdial.conf. And it works really great. Make sure when you give at least 1 minute between success connection attempt. If you connect, then disconnect and then reconnect withing 1 minutes, you will see the error:

/var/log/messages

er
Jan  4 16:26:49 linux-kz77 modem-manager: Got failure code 3: No carrier
Jan  4 16:30:28 linux-kz77 modem-manager: Got failure code 3: No carrier
Jan  4 16:31:12 linux-kz77 modem-manager: Got failure code 3: No carrier

and your wvdialer will show like this:
linux-kz77:/etc # wvdial optus1
–> Ignoring malformed input line: “connect “/usr/sbin/chat -V -f /etc/ppp/optus3g””
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
–> Sending: ATQ0
ATQ0
OK
–> Re-Sending: ATZ
ATZ
OK
–> Modem initialized.
–> Idle Seconds = 300, disabling automatic reconnect.
–> Sending: ATDT*99#
–> Waiting for carrier.

The “waiting for carrier” means, the USB dongle is waiting for a Carrier signal from 3G base station (UMTS or whatever they have).

Here are the steps:

Step1:
Make sure your PPP and wvdialer daemon RPM is installed.

linux-kz77:/etc/ppp # rpm -qa | grep ppp
ppp-2.4.5.git-3.1.i586
linux-kz77:/etc/ppp # rpm -qa | grep wvdial
wvdial-1.60-64.1.i586

Step 2

backup your wvdial.conf and add a connectoin using terminal/cmd prompt.

cp /etc/wvdial.conf /etc/wvdial.conf.bak

touch > /etc/wvdial.conf

vi /etc/wvdial.conf    (and paste below lines to wvdial and save it)

Note: Usernme and passwords are dummy. The phone number is *99# for all 3g providers in Australia. Make sure you check your port ttyUSBn.

To find out which USB port is being used by USB dongle first use ‘tail -f /var/log/message’ and then plug in the USB dongle into your laptop.

tail -f /var/log/message
Jan  4 17:21:33 linux-kz77 modem-manager: (ttyUSB3) opening serial device…
Jan  4 17:21:33 linux-kz77 modem-manager: (ttyUSB3): probe requested by plugin ‘Huawei’

Also note, for simple communication, USB dongle uses 3 ttyUSBx ports. One for data one for command and other for carieer.

linux-kz77:/etc #
linux-kz77:/etc # more wvdial.conf

[Dialer Defaults]
Modem = /dev/ttyUSB3
Baud = 412000
#Init1 = connect “/usr/sbin/chat -V -f /etc/ppp/optus3g”
#Init3 =
#Area Code =
Phone = *99#
Username =test
Password =test
Ask Password = 0
Dial Command = ATDT
Stupid Mode = 0
Compuserve = 0
Force Address =
Idle Seconds = 300
DialMessage1 =
DialMessage2 =
ISDN = 0
Auto DNS = 1

[Dialer optus1]
Modem = /dev/ttyUSB3
Stupid Mode = 1
Baud = 460800
Init10 = lock
Init11 = crtscts
Init12 = modem
Init13 = noauth
Init14 = defaultroute
Username  = guest
Password  = guest
connect “/usr/sbin/chat -V -f /etc/ppp/optus3g”
Init30 = noipdefault
Init31 = usepeerdns
Init32 = nobsdcomp
Init33 = novj

linux-kz77:/etc #

To make a connection:
linux-kz77:/etc #
linux-kz77:/etc # wvdial optus1
–> Ignoring malformed input line: “connect “/usr/sbin/chat -V -f /etc/ppp/optus3g””
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
–> Sending: ATQ0
ATQ0
OK
–> Re-Sending: ATZ
ATZ
OK
–> Modem initialized.
–> Idle Seconds = 300, disabling automatic reconnect.
–> Sending: ATDT*99#
–> Waiting for carrier.
CONNECT
–> Carrier detected.  Starting PPP immediately.
–> Starting pppd at Mon Jan  4 16:31:51 2010
–> Pid of pppd: 12229
–> Using interface ppp0
–> local  IP address 122.110.83.192
–> remote IP address 10.64.64.64
–> primary   DNS address 61.88.88.88
–> secondary DNS address 211.29.132.12
–> Script /etc/ppp/ip-up run successful
–> Default route Ok.
–> Nameserver (DNS) Ok.
–> Connected… Press Ctrl-C to disconnect <— to disconnect

Some troubleshooting:

Sometime when you make frequent changes in wvdial.conf , all other scripts in /etc/ppp/ needs to be re-initialized. It takes some time. To quickly overcome from this issue, copy wvdial.conf.bak (fresh unedited wvdial.conf file) to /etc/wvdial.conf and then run wvdial <enter>. Then launch the wvdial <connection name>

#
linux-kz77:/etc #
linux-kz77:/etc # wvdial optus1
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
–> Sending: ATQ0
–> Re-Sending: ATZ
–> Modem not responding.
linux-kz77:/etc # wvdial optus1
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
–> Sending: ATQ0
–> Re-Sending: ATZ
–> Modem not responding.

linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc # wvdial optus1
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Modem initialized.
–> Sending: ATDT*99#
–> Waiting for carrier.
^CCaught signal 2:  Attempting to exit gracefully…
–> Disconnecting at Mon Jan  4 16:53:08 2010

^X

^C
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc # wvdial optus1
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
–> Sending: ATQ0
^CCaught signal 2:  Attempting to exit gracefully…
ATQ0
OK
–> Re-Sending: ATZ
ATZ
OK
–> Modem initialized.
–> Disconnecting at Mon Jan  4 16:53:20 2010
^C
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc # cp wvdial.conf_working1 wvdial.conf
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc # wvdial optus1
–> Ignoring malformed input line: “connect “/usr/sbin/chat -V -f /etc/ppp/optus3g””
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
–> Sending: ATQ0
ATQ0
OK
–> Re-Sending: ATZ
–> Modem not responding.
linux-kz77:/etc #
linux-kz77:/etc # cp wvdial.conf
wvdial.conf           wvdial.conf.bak       wvdial.conf_working   wvdial.conf_working1
linux-kz77:/etc # cp wvdial.conf.bak wvdial.conf
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc # wvdial
–> WvDial: Internet dialer version 1.60
–> Cannot open /dev/modem: No such file or directory
–> Cannot open /dev/modem: No such file or directory
–> Cannot open /dev/modem: No such file or directory
linux-kz77:/etc #
linux-kz77:/etc #
linux-kz77:/etc # cp wvdial.conf_working1 wvdial.conf
linux-kz77:/etc # wvdial optus1
–> Ignoring malformed input line: “connect “/usr/sbin/chat -V -f /etc/ppp/optus3g””
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
–> Sending: ATQ0
ATQ0
OK
–> Re-Sending: ATZ
ATZ
OK
–> Modem initialized.
–> Idle Seconds = 300, disabling automatic reconnect.
–> Sending: ATDT*99#
–> Waiting for carrier.
CONNECT
–> Carrier detected.  Starting PPP immediately.
–> Starting pppd at Mon Jan  4 16:54:33 2010
–> Pid of pppd: 13188
–> Using interface ppp0
–> local  IP address 122.110.41.160
–> remote IP address 10.64.64.64
–> primary   DNS address 61.88.88.88
–> secondary DNS address 211.29.132.12
–> Script /etc/ppp/ip-up run successful
–> Default route Ok.
–> Nameserver (DNS) Ok.
–> Connected… Press Ctrl-C to disconnect

 

linux-kz77:/etc #
linux-kz77:/etc # dmesg | grep sierra
[   11.602567] sierra 6-1:1.0: Sierra USB modem converter detected
[   11.604800] usbcore: registered new interface driver sierra
[   11.604802] sierra: v.1.3.7:USB Driver for Sierra Wireless USB modems
linux-kz77:/etc #
linux-kz77:/etc #

 

-Push Bhatkoti

Advertisements