jueves, 14 de abril de 2011

Internet connection through (GSM) USB Modem with wvdial


Just tonight I'm having problems to start my internet connection with the NetworkManager on kubuntu maverick. The connection has been working like a charm these days so I'd think it's some kind of hiccups.

I had taken the time to install wvdial on my box hoping I wasn't going to need it... normally console based applications are much more verbose on the kind of problems they are facing to do things so they are a very good fallback method when you have problems and so given the current situation, I'll give wvdial a shot.

So, here's the recipe for it. First, set up a simple text file with the configuration you will be using.. it depends on the carrier you are using. I have COMCEL (in colombia) and so this is the content of the file:

[Dialer Defaults]
        Modem = /dev/ttyUSB0
        Phone = *99#
        Username = COMCELWEB
        Password = COMCELWEB

Phone, username and password depend on your carrier but it's fairly simple, right? Say the file is called comcel.txt, then call wvdial supplying this file name as the config file:

$ wvdial -C comcel.txt
A while later, you will be connected.... this is the output for me:

--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
--> Carrier detected.  Waiting for prompt.
--> Don't know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Thu Apr 14 21:46:29 2011
--> Pid of pppd: 2594
--> Using interface ppp0
--> local  IP address x.x.x.x
--> remote IP address y.y.y.y
--> primary   DNS address z.z.z.z
--> secondary DNS address w.w.w.w

And that's how I made this post. Perhaps I could set up a little DB with the configuration in different carriers. Do you use wvdial to set up internet connection through a usb modem (through GSM)? Want to give it up? I'll update this post.

4 comentarios:

  1. you can modify the wvdial.conf found in /etc to reflect different provider or different setting (2G or 3G) and call the desire setting by its name.


    I am in Brazil, I can use TIM and VIVO, the /etc/wvdial.conf is like this :

    [Dialer vivo]
    Init4 = AT+CGDCONT=1,"IP","zap.vivo.com.br"
    Password = vivo
    Phone = *99#
    Modem = /dev/ttyUSB0
    Username = vivo

    [Dialer tim]
    Init4 = AT+CGDCONT=1,"IP","tim.br"
    Password = tim
    Check Def Route = on
    Phone = *99#
    Username = tim

    I can call each by using :
    wvdial vivo
    wvdial tim

  2. Oh, I know, Pierre, but then when there is a wvdial update (at least in debian/ubuntu), the file will get renamed/replaced.... I'd rather do it in my own files.... certainly both configurations can be kept in a single file.

    Can you try to make the configurations as short as possible so that I could add them to the post as configs for your providers in Brazil?

    Obrigado in advance. :-)

  3. I use Gentoo so I do not encounter the problem of config files been overwritten as gentoo let you review the files and changes. the modification are only proposed

    you could use chattr to protect the config files from been upgraded but that might break the upgrade process

    # chattr +i /etc/wvdial.conf

    will render the file write protected

    your solution to use external files is more elegant and certainly more adapted to debian like variants of linux


  4. Hi,

    I have been looking for wvdial for my android honeycomb tablet for using my Sony
    Ericsson Hazel (j20i) mobile (non-andoird) as modem.

    ie, I have non-android mobile with GPRS enabled.
    I like to connect this to my honeycomb tablet then use my mobile as modem.

    But sadly, honeycomb does not have wvdial.

    Any thoughts ?