Troubles establishing connection with wvdial

6,584

First you need to see if your hardware is listed:

lsusb

Then you can install and configure usb_modeswitch, because Linux recognizes your hardware as a USB drive not as a modem (I assume that you are using Arch Linux):

pacman -S usb_modeswitch

Finally, you just got to check if your APN settings are correct:

wvdialconf

vim /etc/wvdial.conf

A simple script to make it automatic:

usb_modeswitch
sleep 2
modprobe usbserial vendor=0xVVVV product=0xMMMM maxSize=4096
sleep 2
wvdial 'your profile
Share:
6,584

Related videos on Youtube

stdcerr
Author by

stdcerr

Coding mostly on embedded systems (24/7/365 uptime) to make a living at daytime, coding on a variety of systems (x86, arm) for fun at nighttime, preferences: Linux, C & C++. Always interested in learning other ways/better ways to solve problems!

Updated on September 18, 2022

Comments

  • stdcerr
    stdcerr almost 2 years

    I have a Huawei cell modem EM680 with which I can establish a connection on my Ubuntu 13.10 box just fine. I plug it in and I can establish a connection using the Connections Manager.

    I have a box without X server and I want to establish a connection with that same modem on that box. I can get a serial link at /dev/ttyUSB1 and if I connect to it using screen /dev/ttyUSB1 460800 and send AT, it responds with OK just fine — so the modem works! After that I tried to establish a connection using wvdial with my /etc/wvdial.conf configured like this:

    [Dialer Defaults]
    Init1 = ATZ
    Init2 = AT+CFUN=1
    Init3 = AT+CGDCONT=1,"IP","m2mstatic.apn"
    Modem = /dev/ttyUSB1
    Phone = *99***1#
    Modem Type = USB Modem 
    Username = "blank"
    Password = "blank"
    Stupid Mode = yes
    New PPPD = yes
    Baud = 460800
    ISDN = 0
    

    I tried to launch wvdial without any options or with

    wvdial eap-interval 1 require-chap
    

    because in my Connection Manager window, under the tab PPP the following checkboxes are checked:

    • EAP
    • MSCHAP
    • PAP
    • MSCHAPv2
    • CHAP
    • Use BSD data compression
    • Use Deflate data compression
    • Use TCP header compression

    But upon launch I just get

    # wvdial eap-interval 1 require-chap
    --> WvDial: Internet dialer version 1.61
    --> Warning: section [Dialer eap-interval] does not exist in wvdial.conf.
    --> Warning: section [Dialer 1] does not exist in wvdial.conf.
    --> Warning: section [Dialer require-chap] does not exist in wvdial.conf.
    --> Cannot get information for serial port.
    --> Initializing modem.
    --> Sending: ATZ
    ATZ
    OK
    --> Sending: AT+CFUN=1
    AT+CFUN=1
    OK
    
    --> Sending: AT+CGDCONT=1,"IP","m2mstatic.apn"
    AT+CGDCONT=1,"IP","m2mstatic.apn"
    OK
    --> Modem initialized.
    --> Sending: ATDT*99***1#
    --> Waiting for carrier.
    ATDT*99***1#
    CONNECT 14000000
    --> Carrier detected.  Starting PPP immediately.
    --> Starting pppd at Mon Jan 22 03:26:56 2007
    --> Pid of pppd: 4295
    

    Here it waits for about a minute and then:

    --> pppd: H�[02]
    --> pppd: H�[02]
    --> Disconnecting at Mon Jan 22 03:27:57 2007
    --> The PPP daemon has died: Connect script failed (exit code = 8)
    --> man pppd explains pppd error codes in more detail.
    --> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
    --> Auto Reconnect will be attempted in 5 seconds
    --> Cannot get information for serial port.
    --> Initializing modem.
    --> Sending: ATZ
    --> Sending: ATQ0
    --> Re-Sending: ATZ
    --> Modem not responding.
    --> Cannot get information for serial port.
    --> Initializing modem.
    --> Sending: ATZ
    --> Sending: ATQ0
    --> Re-Sending: ATZ
    --> Modem not responding.
    --> Disconnecting at Mon Jan 22 03:28:19 2007
    #
    

    But I can never actually reach the Internet. Exit code 8 in the pppd man page says:

    The serial port could not be opened.
    

    Which is ridiculous as I just opened (and closed(!) it with screen). Any ideas where I'm going wrong or what I'm missing?

    Edit

    I just found the connection manager's config file and it looks like this:

    [connection]
    id=Rogers
    uuid=5c4ed6f8-9ece-4888-a129-65ed5c741502
    type=gsm
    permissions=user:ron:;
    
    [gsm]
    number=*99#
    password-flags=1
    apn=m2mstatic.apn
    pin-flags=1
    
    [ipv4]
    method=auto
    
    • terdon
      terdon over 10 years
      Are you sure about that exit code? On my system, code 8 is The connect script failed (returned a non-zero exit status).
    • terdon
      terdon over 10 years
      Check your system's manual page (man pppd), you probably have the same as I do (on Debian) and that is a different error code.
    • stdcerr
      stdcerr over 10 years
      @terdon ok, on my actual box, error 8 is The connect script failed (returned a non-zero exit status).
    • totti
      totti over 10 years
      First of all fix your system clock. Some providers refuse connection if date is wrong. Is your apn correct ?
    • stdcerr
      stdcerr over 10 years
      @totti Good catch, fixed it by setting it to UTC, but still no go! :(
    • totti
      totti over 10 years
      Answer my 2nd Q, what is your access point
    • stdcerr
      stdcerr over 10 years
      @totti yes. my apn is correct, it is set to m2mstatic.apn - other modems with this SIM type connect just fine and even this modem with this sim & apn can connect fine if connected to my ubuntu box - why would IST work if UTC doesn't make a difference? I'm located in the PST time zone but that doesn't change things either.
    • totti
      totti over 10 years
      Sorry for the IST. Using UTC-8 may sometimes help ( PST=UTC-8. ) even it seems to be another problem.
    • X Tian
      X Tian over 10 years
      If you go one step further with your screen test and actually dial the number you will be able to observe how the remote system responds, it is pppd which is failing and I'm supposing that pppd has problems getting past a username/password prompt before seeing the remote pppd connection. hence the error message from pppd "connect script failed". btw the default section in wvdial.conf is being used, and here username/password are set as blank !
    • totti
      totti over 10 years
      I doubt Username = "blank" Password = "blank". Try remove blank. ie Username = ""
    • totti
      totti over 10 years
  • Caio de Paula Silva
    Caio de Paula Silva over 5 years
    Oh, gosh! I don't understand your awnser. This is what i need, but i don't understand. :(