LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Huawei e169 mobile dongle wvdial.conf for ISP 'three' (.co.uk)? (http://www.linuxquestions.org/questions/linux-hardware-18/huawei-e169-mobile-dongle-wvdial-conf-for-isp-three-co-uk-722221/)

fremath 04-28-2009 06:57 AM

Huawei e169 mobile dongle wvdial.conf for ISP 'three' (.co.uk)?
 
Does anybody have a working wvdial.conf for the mobile broadband dongle Huawei e169, for the ISP (this is in the UK) 'three'?

About the closest I have got thus far, after several hours of trial and error, and ultimately fruitless scavenging around on the internet is:

Code:

[root@bun:/etc/init.d]# wvdial
--> WvDial: Internet dialer version 1.56
--> 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
--> Modem initialized.
--> Sending: *99#
--> Waiting for carrier.
--> Timed out while dialing.  Trying again.
--> Sending: *99#
--> Waiting for carrier.
--> Timed out while dialing.  Trying again.
--> Sending: *99#
--> Waiting for carrier.
--> Timed out while dialing.  Trying again.
Caught signal 2:  Attempting to exit gracefully...
--> Disconnecting at Tue Apr 28 12:14:09 2009
[root@bun:/etc/init.d]#

Just to be clear, wvdial _does_ detect the modem:

Code:

Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
Modem Port Scan<*1>: S1  S2  S3
WvModem<*1>: Cannot get information for serial port.
ttyUSB0<*1>: ATQ0 V1 E1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB0<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB0<*1>: Speed 4800: AT -- OK
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Speed 19200: AT -- OK
ttyUSB0<*1>: Speed 38400: AT -- OK
ttyUSB0<*1>: Speed 57600: AT -- OK
ttyUSB0<*1>: Speed 115200: AT -- OK
ttyUSB0<*1>: Speed 230400: AT -- OK
ttyUSB0<*1>: Speed 460800: AT -- OK
ttyUSB0<*1>: Max speed is 460800; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
WvModem<*1>: Cannot get information for serial port.
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
WvModem<*1>: Cannot get information for serial port.
ttyUSB2<*1>: ATQ0 V1 E1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB2<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB2<*1>: Speed 4800: AT -- OK
ttyUSB2<*1>: Speed 9600: AT -- OK
ttyUSB2<*1>: Speed 19200: AT -- OK
ttyUSB2<*1>: Speed 38400: AT -- OK
ttyUSB2<*1>: Speed 57600: AT -- OK
ttyUSB2<*1>: Speed 115200: AT -- OK
ttyUSB2<*1>: Speed 230400: AT -- OK
ttyUSB2<*1>: Speed 460800: AT -- OK
ttyUSB2<*1>: Max speed is 460800; that should be safe.
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
ttyUSB2<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"


I really don't want to have to set up a dedicated windows machine, simply to serve up an internet connection. Your help would be greatly appreciated.

I'm running a 2.6.21 kernel in Debian, and I have usb_modeswitch installed, and am using it to detect the modem.

Jonathan

tredegar 04-29-2009 02:14 PM

I had one of these once. It worked, but the 3's coverage (in London) was rubbish, so I gave it away.

These are the config files I can find on my PC:

Code:

tred@vaio:~$ cat /etc/udev/rules.d/99-sc-huawei-e169g.rules
SUBSYSTEM=="usb" SYSFS{idProduct}=="1001", SYSFS{idVendor}=="12d1", RUN+="/usr/sbin/e169g-switch"

tred@vaio:~$ cat /usr/sbin/e169g-switch
#!/bin/bash
# Switch off the CD rom, start modem-mode
/sbin/usb_modeswitch -v 12d1 -p 1001 -d 1
/sbin/usb_modeswitch -v 12d1 -p 1001 -H 1
echo Huawei-E169G switched to Modem Mode >> /var/log/messages
exit 0
tred@vaio:~$

Note: your path to usb_modeswitch may be different. I just put it in /usr/sbin Adjust it if you need to.

Then I ran a script called salutis-connect :
Code:

tred@vaio:~$ cat /usr/bin/salutis-connect-V4
#!/bin/bash -e

ITEMS=( \
  1 "Huawei E220 & E169G Modem" "sc-huawei-e220.wvdial" \
  2 "Generic ACM USB Phone" "sc-nokia-acm.wvdial" )

CONFIG="/etc/salutis-connect.conf"
ICON="/usr/share/icons/salutis/scalable/`basename $0`.svg"
TITLE="Salutis Connect"
ADDRESS="www.google.com"
LOG="/var/log/salutis-connect.log"
VERSION=`zcat /usr/share/doc/salutis-connect/changelog.gz | \
  awk '$1=="salutis-connect" {print $2}' | head -1 | tr -d '(' | tr -d ')' | \
  cut -d '-' -f 1`

function start_network_manager {

  for SERVICE in \
    "25NetworkManager" \
    "26NetworkManagerDispatcher"
  do
    TERM=vt100 \
      /etc/dbus-1/event.d/"$SERVICE" start 2>&1 >> "$LOG"
  done

}

if [ `id -u` -eq 0 ]
then

    exec 2> "$LOG"
    set -x

    if [ -e "$CONFIG" ]
    then
      PREVIOUS="$(cat $CONFIG)"
    else
      touch "$CONFIG"
    fi

  # check for existing connection

  for CHECK in $(seq 1 2 $((${#ITEMS[@]})))
  do

    # check if connection exist

    if ps -ef | awk '{print $8,$9,$10}' | grep -v grep | \
      grep -q "^wvdial -C /etc/${ITEMS[$CHECK]}$"
    then

        # already connected

        zenity \
          --question \
          --window-icon="$ICON" \
          --title="$TITLE" \
          --text="You're already connected via '${ITEMS[$((CHECK-1))]}'. Press 'OK' to disconnect."

        if [ $? -eq 0 ]
        then

          # look for process identification number

          PROCESS=`ps -ef | awk '$10=="'/etc/"${ITEMS[$CHECK]}"'" {print $2}'`

          # kill the process

          kill $PROCESS

          # wait for termination

          for PROGRESS in `seq 95 -5 5`
          do
            echo $PROGRESS
            if ps -ef | awk '{print $2}' | grep -q $PROCESS
            then

              # wait two seconds

              sleep 2

            else

              # start network manager

              start_network_manager

              # fill the rest of progres-bar

              for FINISH in `seq $PROGRESS -5 5`
              do
                echo $FINISH
                sleep 0.05
              done

              # print success message

              zenity \
                --info \
                --window-icon="$ICON" \
                --title="$TITLE" \
                --text="Connection via '${ITEMS[$((CHECK-1))]}' closed."

              # kamikadze

              kill $$

            fi
          done | \
            zenity \
              --progress \
              --text="Disconnecting, please wait..." \
              --window-icon="$ICON" \
              --title="$TITLE" \
              --auto-close \
              --width=400

          # can't disconnect

          zenity \
            --error \
            --window-icon="$ICON" \
            --text="Can't disconnect '${ITEMS[$((CHECK-1))]}'."

          # start network manager

          start_network_manager

          # exit with failure

          exit 1

        else
          exit 0
        fi
      fi
  done

  # ak konfigurak neexistuje jeden si vytvorime

  if [ ! -e "$CONFIG" ]
  then
    echo "${ITEMS[0]}" > "$CONFIG"
  fi

  # ak je konfigurak poskodeny, opravime ho

  if [ `wc -c "$CONFIG" | awk '{print $1}'` -ne 2 ]
  then
    echo "${ITEMS[0]}" > "$CONFIG"
  fi

  # zostavi menu a z konfiguraku zvoli

  COUNTER=0
  for CHECK in $(seq 1 3 ${#ITEMS[@]})
  do

    # check if it's default item

    if [ "${ITEMS[$((CHECK-1))]}" == "$(cat $CONFIG)" ]
    then
      MENU[$COUNTER]="True"
    else
      MENU[$COUNTER]="False"
    fi

    # store menu item

    MENU[$((COUNTER+1))]="${ITEMS[$CHECK]}"

    let COUNTER+=3

  done

  while :
  do

    # show menu with devices

    SELECTION=`zenity \
      --title "$TITLE" \
      --text "Salutis Connect $VERSION\nRudolf Adamkovič - Salutis\nsalutis@salutis.sk, www.salutis.sk\n\nPlease select your device:\nNote that PIN code must be disabled." \
      --list \
      --radiolist \
      --column "Selection" \
      --column "Device" \
      --window-icon="$ICON" \
      --width=400 \
      --height=300 \
        "${MENU[@]}"`

    [ $? -ne 0 ] && exit 0

    # use selected device and continue

    if [ -n "$SELECTION" ]
    then
      for CHECK in $(seq 1 3 ${#ITEMS[@]})
      do
        if [ "$SELECTION" == "${ITEMS[$CHECK]}" ]
        then
          echo "${ITEMS[$((CHECK-1))]}" > "$CONFIG"
          DIAL="${ITEMS[$((CHECK+1))]}"
          break
        fi
      done
      break
    else
      zenity \
        --error \
        --title "$TITLE" \
        --text "Please select device."
    fi

  done

  # connect

  for PROGRESS in `seq 5 5 95`
  do

    echo $PROGRESS
    case $PROGRESS in

        5)

          # stop network manager - part one

          TERM=vt100 \
            /etc/dbus-1/event.d/26NetworkManagerDispatcher stop \
              2>&1 >> "$LOG"

          ;;

        10)

          # stop network manager - part two

          TERM=vt100 \
            /etc/dbus-1/event.d/25NetworkManager stop \
              2>&1 >> "$LOG"

          ;;

        15)

          # start dialing sub-process

          ( wvdial -C /etc/"$DIAL" 2>> "$LOG" >> "$LOG" & )

          ;;

        *)

          # check connection

          if wget -4 -O - "$ADDRESS" > /dev/null 2>> "$LOG"
          then

            # connected

            for FINISH in `seq $PROGRESS 5 100`
            do
              echo $FINISH
              sleep 0.05
            done

            # show success message

            zenity \
              --info \
              --window-icon="$ICON" \
              --text="Wohoo! You're connected, go ahead :)"

            # exit

            exit 0

          else

            # not connected

            if [ $PROGRESS -eq 95 ]
            then

              # start network manager

              start_network_manager

              # show error message

              zenity \
                --error \
                --title="$TITLE" \
                --window-icon="$ICON" \
                --text="Oops, error occured! Press 'OK' for details."

              zenity \
                --text-info \
                --filename="$LOG" \
                --window-icon="$ICON" \
                --title="$TITLE"

              # exit

              exit 1

            else

              # waiting for connection

              sleep 2

            fi
          fi
        ;;
      esac
  done | zenity \
      --progress \
      --text="Connecting, please wait..." \
      --window-icon="$ICON" \
      --title="$TITLE" \
      --auto-close \
      --width=400

  [ $? -ne 0 ] && start_network_manager

else

  gksu "$0"

fi

tred@vaio:~$ cat /etc/salutis-connect.conf
1
tred@vaio:~$

Here's another conf file for you:
Code:

tred@vaio:~$ cat /etc/wvdial.conf

[Dialer Defaults]
Modem = /dev/ttyUSB2
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = Analog Modem
Phone = *99#
Dial Command = ATDT
ISDN = 0
Username = three
IniInit1 = ATZ
Password = three
Baud = 9600

[Dialer three]
Init2 = ATZ
Init3 = ATE0 V1 &D2 &C1 S0=0 +IFC=2,2
Init5 = AT+CGDCONT=1,”IP”,”3internet”
Modem Type = Analog Modem
ISDN = 0
Phone = *99#
Modem = /dev/ttyUSB0
Username = three
Dial Command = ATDT
Stupid Mode = 1
Password = three
Baud = 460800
tred@vaio:~$

The passwords and usernames don't matter in the above as all this is handled by the SIM card in your dongle.

You'll need the zenity package installed for salutis-connect to work (It makes a window dialog for a bash script, but there are other alternatives)

Hope this helps. The "salutis-connect" site seems to be no longer supported :(

But here's an (old) link for you: http://samiux.wordpress.com/2008/04/...on-ubuntu-804/

But I thought modern linux kernels just managed these things OK eg eeebuntu on my eee701, just detected the Huawei 169 and connected.

Please note that I no longer have this hardware to play with. It was junk (because the network wasn't there).


All times are GMT -5. The time now is 02:21 AM.