GSM tethering with Linux

From HowardForums Wiki

Jump to: navigation, search

This tutorial will serve as a reference for tethering your phone via USB or Bluetooth (though USB is the main focus) using a *nix box of some kind (should apply generally to Unix-like systems, BSD, Solaris, etc.)

Note: As of March 2007, it's been confirmed these instructions do NOT work with any Blackberry devices. Only charging and syncing are known to work in Linux, by using the Barry project utilities. Blackberry intentionally limits the exposure of the modem services in both USB and Bluetooth modes. There is a petition for Blackberry Linux USB drivers.

Note: Consider the bbtether software as a more recent, working alternative (2009) for USB tethering. Link to BBTether

Source(s): GSM tethering with Linux


Contents

Bluetooth

Pairing your phone with Linux is a whole 'nother tutorial in and of itself. Check the MAN pages on your box, or check the reference pages for whichever BT manager you are using. There is some information on creating a bluetooth connection under Fedora which is likely to be similar on other distributions.

USB

The first thing to do is check and make sure that your *nix box is recognizing your phone via USB. To start off, with the phone unplugged from the box, open up a terminal and run:

dmesg

You should get something about USB being disconnected, or alternatively no message about USB at all (check the end of the output). Now, connect your phone to a USB port, and run dmesg again. You should see an output at the end that says something about 'high speed USB device' or something similar. You should also see where the device is located... for example, mine is located at /dev/ttyACM0. Remember that.

The Setup

Ok, so once you have that output above, and you know that your phone is being recognized, you need to setup the PPP configuration. Depending upon what dialer you decide to use (KPPP, wvdial, gnome-ppp, etc), your actual tabs and whatnot may vary, but the settings are the same. I'm going to be specific to wvdial, because I've found that I like it the best, and it's really easy to use from the command line.

First off, once the phone is plugged in, and you've made sure it's recognized using dmesg, then you want to type

wvdialconf

in a terminal window. (this is assuming that you have wvdial installed, if not install it first... if you don't know how to install it, then either stop using linux, or learn how quick).

This will basically setup a blank .conf file for you to get in and edit, located at /etc/wvdial.conf.

Using your favorite editor, get into the .conf file for editing (I prefer vim, but nano or whatever is fine). Make sure you do it as root, so it's not read only, i.e.:

sudo vim /etc/wvdial.conf

or

su -c "vim /etc/wvdial.conf"

or whatever depending on your distro's methodology of superuser access.

You will get a screen that is asking for the parameters to be entered. Enter your parameters, until it looks just like this:

[Dialer Defaults]
Init1 = AT+CGDCONT=1,"IP","YOUR APN"
Modem Type = USB Modem
Phone = *99***1#
Password = <Your Password>
Username=%2526lt%253BYour Login Name>
Modem = /dev/ttyACM0
Baud = 460800

This may involve deleting the second init string (init2) and leaving password and login blank (since T-Mo doesn't use them). Fill in the modem if it's not already correct, with the info from that dmesg way back when that I told you to remember. Once you are done, save the .conf file and exit the editor. Remember that you may need to replace the wap.voicestream.com APN with something else (internet2, internet3) if you are on a different data plan (I'm using blackberry add-on, which uses the wap.voicestream.com backbone, but with all ports open). T-zones users will have to enter the proxy settings into Konqueror, Firefox, Opera, whatever you are using to access. If you are using a bluetooth connection, change the /dev/ttyACM0 section to whatever is appropriate for your connection (/dev/rfcomm0 or whatever).


Source(s): GSM tethering with Linux


Connecting

To connect you just need to enter this in a terminal window:

wvdial

Keep in mind that this terminal will remain open while browsing. If you close it, you will be disconnected (though of course you can minimize it).

To disconnect, type Ctrl-C in the terminal, and it will disconnect cleanly.

Automating the Process

Now, go to your desktop, and create a new Link to Application (in KDE, right click on the desktop, and go to New->Link to Application, I'm not sure in Gnome because I never use it anymore). For the command, put in:

wvdial

When double clicked, the icon starts your connection for you without having to go into a terminal every time.

The process for KPPP and other dialers is similar, just fill in the same values in whatever the corresponding fields are. You may prefer wvdial because it is rock solid, whereas KPPP just locks up on me constantly.

When you are connected, you can see the details of the connection by doing an

ifconfig ppp0

If you do not have a T-Mobile "internet" plan, you will likely need to set up your web browser to use T-Mobile's web proxy server

Confirmed working setups

  • Nokia 6681 on EDGE (speed of around 145kbps) on Kubuntu Dapper 6.06, KDE 3.5.1
  • Nokia 5300 on EDGE using Fedora 7 (using Network Configuration dialog)

Related Information

Source(s): GSM tethering with Linux

Additional information for Sprint

I have a Sprint Samsung MM-920 which I use as phone as modem. The following were additions I needed to make to get my phone to work:

My Wvdial.conf looks like this:

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Phone = #777
ISDN = 0
Username=NONE
Init1 = ATZ
Password = NONE
Modem = /dev/ttyACM0
Baud = 460800
Auto DNS = 1
Stupid Mode = 1

Stupid Mode did not stop the disconnects which happened every two minutes. I was able to fix this by putting the following 2 lines in the wvdial file in /etc/ppp/peers.

lcp-echo-failure 0
lcp-echo-interval 0

-- Additional information for Gnome desktop link --

Go to your desktop, and create a new Launcher (right click and Create new Launcher). For the command, put in:

wvdial

You can name your launcher icon whatever you want. After saving by clicking OK, you need to edit properties (right click and select properties) to allow read, write, and execute access for owner.

When double clicked, the icon starts your connection for you without having to go into a terminal. You will need to use System Monitor under System/Administration to terminate the wvdial process since Gnome will not have an open terminal for you to use Ctrl-C to end the process. You could also open a terminate and use a kill command, but opening System Monitor is easy.


Additional information for Nextel Chile

Using a T-Mobile TAP (Huawei phone) the connection string to make it work with Fedora are as follows. Note that although I was able to connect to the GPRS network, I can't yet browse the internet:

Wvdial.conf looks like this:

[Dialer Defaults]
Init1 = AT+CGDCONT=1,"IP","datacard.nextelmovil.cl"
Modem Type = USB Modem
Phone = *99***1#
Username=NONE
Password = NONE
Modem = /dev/ttyUSB0
Baud = 460800

The response from the prompt looks as follows:

[root@fedora ~]# wvdial
--> WvDial: Internet dialer version 1.61
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT+CGDCONT=1,"IP","datacard.nextelmovil.cl"
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
CONNECT 3600000
--> Carrier detected.  Waiting for prompt.
--> Don't know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Sat Jun 11 15:37:46 2011
--> Pid of pppd: 3733
--> Using interface ppp0
--> pppd: [10](� 
--> pppd: [10](� 
--> pppd: [10](� 
--> pppd: [10](� 
--> pppd: [10](� 
--> pppd: [10](� 
--> local  IP address 10.121.6.93
--> pppd: [10](� 
--> remote IP address 10.64.64.64
--> pppd: [10](� 
--> primary   DNS address 190.107.224.4
--> pppd: [10](� 
--> secondary DNS address 190.107.224.5
--> pppd: [10](� 

Jasa SEO Jasa SEO Murah Jasa SEO Murah Jasa SEO Jasa Google Adwords Jasa Adwords Google Adwords Sepatu Online Toko Sepatu Online Sepatu Sepatu Murah Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Berita Terkini Internet Marketer Muda Internet Marketer Indonesia Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Kursus SEO Kursus SEO Murah Jam Tangan Casio Jam Tangan Casio Jam Tangan Murah Jam Tangan Grosir Baju Terbaru Grosir Baju Baju Terbaru Grosir Baju Murah Bisnis Online Belajar SEO Kerupuk Kerupuk kulit Social Bookmark Dofollow Social Bookmark Kumpulan Puisi Kirim Puisi Penumbuh Rambut Penumbuh Rambut timbangan WBC Wonogiri Jasa SEO Murah Jasa SEO Jam Tangan Murah Jam Tangan Murah

Cupu Berita Terbaru Android Store Upinson Berita Terkini Edo Ziedo Aplikasi Symbian Sepatu Safety Upin Upin Tablet Android Sepatu Murah Upinson Blogger Radio Streaming SEO Star Upinson Cinta EDU Jasa SEO Sepatu Murah Sepatu Murah Sepatu Murah Penumbuh Rambut Penumbuh Rambut Penumbuh Rambut Penumbuh Rambut Penumbuh Rambut Penumbuh Rambut Penumbuh Rambut

Personal tools