Using internet via GPRS

To meet the Ubuntu-IN wiki's quality standards, this article or section may require cleanup. Please discuss this issue on the talk page and/or our IRC channel, mailing list. Editing help is available. This page is created to provide instructions for using internet on Ubuntu via GPRS enabled mobiles/data cards. Please note not all GPRS enabled phones can be used as modems.

Currently this page provides instructions only for using Airtel GPRS by over bluetooth or USB or Tata Indicom GPRS over USB.

Prerequisite

 * In case of Airtel a GPRS enabled phone which can be used as modem. This phone should have data profile set properly as per instructions provided by the service provider. OR
 * In case of Tata Indicom, the USB GPRS kit which has a SIM card using which one can connect to internet.

Configuring device node (rfcomm, bluetooth only)
If you are going to connect phone via USB cable, please skip this section.

Listing Bluetooth devices

 * Make your phone Bluetooth discoverable.
 * Run the following at a shell prompt: $ hcitool scan
 * Copy the MAC address (the text with the capital letters, numbers, and ':'s) somewhere convenient. You'll need it many times.

Pairing
You can skip this section if you've already paired your phone with your computer. However, consider the final optional step, as your phone might otherwise nag you every time you use if for dialup.
 * Run the following, replacing your-phone-mac-address with the proper data $ sudo hcitool cc your-phone-mac-address
 * Run the following, replacing your-phone-mac-address with the proper data $ sudo hcitool auth your-phone-mac-address
 * If this command doesn't work, try the pairing instructions on other Bluetooth wiki pages on Ubuntu wiki; it seems 5.10 and older have issues with the PIN wrapper
 * Enter a numeric code into the dialog box that pops up
 * Accept the pairing from your phone handset
 * Enter the same number on your phone
 * Run the 'hcitool auth your-phone-mac-address' command again if it fails
 * You can remove your handset's Bluetooth discoverability now
 * Some phones (notably Samsung) require further authorization for certain Bluetooth activities, including dialup; consult your phone's user manual to avoid confirming your computer's dialup action on your phone every time

Configuring the rfcomm device
rfcomm0 { bind yes; device your-phone-mac-address; channel your-phone-rfcomm-channel; comment "Bluetooth PPP Connection"; }
 * Get the channel number for your phone's dialup service by running the following, replacing your-phone-mac-address with the proper data $ sdptool browse your-phone-mac-address
 * Look under "Service Name: Dial-up Networking"
 * Under "Protocol Descriptor List:" and "RFCOMM", there should be a number after "Channel:"
 * Remember that number; you'll need it for the rfcomm configuration
 * Edit file /etc/bluetooth/rfcomm.conf $ sudo vi /etc/bluetooth/rfcomm.conf
 * Paste the following into the file, replacing your-phone-mac-address and your-phone-rfcomm-channel with appropriate values
 * Save and close the rfcomm.conf file
 * You can create more than one rfcomm nodes as rfcomm1, rfcomm2 etc. for use with different phones.
 * Restart bluetooth services. This will create the rfcomm0 device (and rfcomm1, rfcomm2 if configured) $ sudo /etc/init.d/bluez-utils restart

Peers file
debug noauth connect "/usr/sbin/chat -v -f /etc/chatscripts/BluetoothDialup" usepeerdns /dev/rfcomm0 115200 defaultroute crtscts lcp-echo-failure 0
 * Create a peers file for the connection $ sudo vi /etc/ppp/peers/BluetoothDialup
 * Paste the following into the file (the file should start out blank)
 * NOTE - If you are connecting phone via usb connection then replace /dev/rfcomm0 with something like /dev/ttyACM0. You can find the exact device node from menu System->Preferences->Device/Hardware Information. I have tested USB connection with Sony Ericsson phones and there should not be much difference for other phones.
 * Save and close the BluetoothDialup file

Chatscript
TIMEOUT 35 ECHO ON ABORT '\nBUSY\r' ABORT '\nERROR\r' ABORT '\nNO ANSWER\r' ABORT '\nNO CARRIER\r' ABORT '\nNO DIALTONE\r' ABORT '\nRINGING\r\n\r\nRINGING\r' \rATOK 'AT+CGDCONT=1,"IP","your-apn-here","",0,0' OK ATD*99***your-data-profile-number-here# CONNECT ""
 * Create a chatscript for the connection $ sudo vi /etc/chatscripts/BluetoothDialup
 * Paste the following into the file (the file should start out blank). Replace your-apn-here with the APN from your data services profile ("airtelgprs.com" for Airtel). Replace your-data-profile-number-here with the number you stored the profile into on the phone. In my case I replaced*99***your-data-profile-number-here# with *99#
 * Save and close the BluetoothDialup file

Idea
The chatscript and peers file for Idea is similar to Airtel. The only difference is that 'your-apn-here' for Idea is 'internet'.

Tata Indicom Plug2Surf
Technically Plug2surf (http://www.tataindicom.com/personal-internet-plug2surf.aspx) is not GPRS. It is CDMA2000-1x connection. Thanks Hobbes for correction. :-) (NOTE: Connection settings are based on the information provided in document available in Windows dialer installation.)

Peers file
noauth connect "/usr/sbin/chat -v -f /etc/chatscripts/tatagprs" debug /dev/ttyACM0 460800 defaultroute noipdefault user "internet" password "internet" remotename tata ipparam tata
 * Create a peers file for the connection $ sudo vi /etc/ppp/peers/tatagprs
 * Paste the following into the file (the file should start out blank)

usepeerdns
 * Save and close the file.

Chatscript
ABORT 'BUSY' ABORT 'NO CARRIER' ABORT 'ERROR' ATZ OK ATDT#777 CONNECT
 * Create a chatscript for the connection $ sudo vi /etc/chatscripts/tatagprs
 * Paste the following into the file (the file should start out blank).
 * Save and close the file.

Dialing permission
$ sudo adduser your-username-here dialout  You can also do this from GUI, System->Administration->Users & Groups. Check for user permissions and make sure thatAllow to use modem checkbox is checked.
 * Add the user who wants dialing permission to the 'dialout' group

Using the connection
$ pon BluetoothDialup $ poff BluetoothDialup
 * Start the connection using pon command (replace BluetoothDialup with appropriate connection name).
 * End the connection using poff command
 * After pon you can verify if the connection has started using plog -f command

Additional/Alternate Instructions for Configuring Internet Using GPRS via Bluetooth
This is an alternate set of instructions/information for configuring internet using GPRS. You can use this information incase you have tried the instructions above, but are still unable to connect to the Internet.

If you have configured bluetooth succesfully and are looking for the Airtel GPRS connection string, then you can find it below.

These instructions have been tested on a Ubuntu Dapper Drake release with a Dell Latitude D610, connected to a Nokia Series 60 phone over Airtel GPRS via bluetooth.

Preparing Your Phone and Laptop for Bluetooth Connection
A very comprehensive set of instructions for this can be found at this page. Please see note below.

This contains information right from checking your bluetooth driver installation to creating the chat scripts for bluetooth dialup using pppd.

The only additional information you need here is the GPRS connection string for your service provider. The connection string for Airtel GPRS is:

OK             'AT+CGDCONT=1,"IP","airtelgprs.com","",0,0'\ OK             ATD*99#                      \

So, if you are following the instructions given in the link above, then replace the  gprs-chat  script given there, with the one below.

exec chat \       TIMEOUT         5                               \ ECHO           ON                              \ ABORT          '\nBUSY\r'                      \ ABORT          '\nERROR\r'                     \ ABORT          '\nNO ANSWER\r'                 \ ABORT          '\nNO CARRIER\r'                \ ABORT          '\nNO DIALTONE\r'               \ ABORT          '\nRINGING\r\n\r\nRINGING\r'    \              \rAT                            \ TIMEOUT        12                              \ SAY            "Press CTRL-C to close the connection at any stage!" \       SAY             "\ndefining PDP context...\n"   \ OK             ATH                             \ OK             ATE1                            \ OK             'AT+CGDCONT=1,"IP","airtelgprs.com","",0,0'\ OK             ATD*99#                      \ TIMEOUT        22                              \ SAY            "\nwaiting for connect...\n"    \ CONNECT        ""                              \ SAY            "\nConnected." \       SAY             "\nIf the following ppp negotiations fail,\n"   \ SAY            "try restarting the phone.\n"
 * 1) !/bin/sh
 * 2) this is the matrix setting #

For any other service provider, simply call the customer care and ask them specifically about the GPRS connection string and other GPRS specific settings (if any).

Thats it. This should get you started on the internet using GPRS. Happy Surfing...:)
 *  Note  - I havent copied or uploaded the document that this URL links to, since I am not sure of its copyright status.If you are unable to access this URL, please feel free to email me for the detailed instructions.