Use your Android phone as a USB modem
This article describes how to connect your Android phone as a USB modem on Debian-based Linux machines. Before you proceed, it is recommended to check out this Tekno Magnus how-to for Samsung Galaxy phones, which details the process for out-of-the-box USB tethering. Unfortunately, Samsung Galaxy S with 2.3.3 (Gingerbread) has a bug that USB tethering no longer works. This article uses a workaround for that bug.
Prerequisites
- Debian (6.0 or later) / Ubuntu (10.04 or later). Root access needed.
- Android 2.3.x or later. Tested with Galaxy S I9000.
- Mobile data connection from your operator. .
Setting up wvdial
Instead of USB tethering, we set up a PPP connection using wvdial.
Turn on the data connection on your phone.
Select Samsung Kies mode from Settings → Wireless and network → USB settings. Do not activate USB tethering from the menus !
Install wvdial on Debian/Ubuntu:
sudo apt-get install wvdial
Connect your phone via USB to your computer. It will be auto-detected as modem (/dev/ttyACM0)
Run
sudo wvdialconf
This will create a stub /etc/wvdial.conf file.Edit /etc/wvdial.conf file to match the settings of your operator. The following works for DNA. For Saunalahti or Elisa, check the articles in links. Basically, you need to change the Init3 line and may be username/password for operators other than DNA.
[Dialer Defaults] Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Modem Type = USB Modem Phone = *99# ISDN = 0 Init1 = ATZ Modem = /dev/ttyACM0 Baud = 460800 Username = '' Password = '' Modem Type = USB Modem Stupid Mode = 1 New PPPD = yes Init3 = AT+CGDCONT=1,"IP","internet"
Whenever you want to connect to the internet, just run:
sudo wvdial
If the connection is successful, you’ll see the local/remote IP addresses and primary/secondary DNS addresses.Now you are ready to browse the Web ! You may need to restart your browser for the changes to take effect. You can always
ping google.com
to see if it works.When you are finished browsing, press CTRL+C to stop wvdial. Remove the USB between your phone and the computer. If you want to reconnect, just connect the USB and run
sudo wvdial
again. No need to edit /etc/wvdial.conf.