[Home]    [Pictures]    [Fixes]    [Links]

Linux GPRS HOWTO

Background:

So you've got a spiffy new mobile phone and data plan. You've tried surfing the web from your mobile, but hey that sucks. Want to use your PC to access the Internet via your mobile? Want to do it under Linux? You've come to the right place.

This article describes my setup. I'm using a Nokia 6820 with T-Mobile service in the USA, including GPRS data plan. To connect my Linux laptop to the phone, I'm using a D-Link DBT-120 bluetooth dongle. Got something similar? Read on...

Linux Configuration

We must ensure that your computer and phone can communicate via bluetooth. The first step is to make certain Linux sees the USB bluetooth dongle. Plug it into a free USB port. In /var/log/messages you should see something similar to:

Mar  8 16:22:20 moschino usb 2-2: new full speed USB device using uhci_hcd and address 2
Mar  8 16:22:21 moschino usb 2-2: configuration #1 chosen from 1 choice
Mar  8 16:22:21 moschino usbcore: registered new interface driver hiddev
Mar  8 16:22:21 moschino input: HID 0a12:1000 as /class/input/input8
Mar  8 16:22:21 moschino input: USB HID v1.11 Keyboard [HID 0a12:1000] on usb-0000:00:1d.0-2
Mar  8 16:22:21 moschino input: HID 0a12:1000 as /class/input/input9
Mar  8 16:22:21 moschino input: USB HID v1.11 Mouse [HID 0a12:1000] on usb-0000:00:1d.0-2
Mar  8 16:22:21 moschino usbcore: registered new interface driver usbhid
Mar  8 16:22:21 moschino drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
If so, good. If not, does your kernel support USB (Device Drivers, USB support)? Does it support HID devices (Device Drivers, HID Devices)? Does it support bluetooth (Networking, Bluetooth subsystem support)? At a minimum you likely need:
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
CONFIG_USB_HID=m
CONFIG_USB_HIDDEV=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_UHCI_HCD=y
CONFIG_BT_HCIUSB=m
CONFIG_BT_HCIUSB_SCO=y
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m

Bluetooth:

We'll be using BlueZ, the Linux bluetooth stack, libraries and utilities. Install. On my Gentoo system this means:

 # emerge bluez-libs bluez-utils
Run lsusb. You should see something similar to:
Bus 002 Device 002: ID 0a12:1000 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HID proxy mode)
Set it to HCI mode by running hid2hci. Run lsusb again:
Bus 002 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Good. Now activate bluetooth on your phone. This is phone specific; read your mobile's manual. Scan for the bluetooth address with hcitool scan:
Scanning ...
        00:02:EE:E1:85:D1       Bob Nokia 6820
Great! There it is. Now we'll bind to that address. Run:
rfcomm bind 0 00:02:EE:E1:85:D1 1

Connecting:

We will now connect via PPP. I created the following script in /etc/ppp/peers:

/dev/rfcomm0 115200
noauth
usepeerdns
defaultroute
connect '/usr/sbin/chat -v -f /etc/ppp/chat-gprs'
debug
where /etc/ppp/chat-gprs is:
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         20
OK              ATE1
OK              'AT+cgdcont=1,"IP","wap.voicestream.com","",0,0'
OK              ATD*99#
Note: these are specific to T-Mobile USA. The last two lines will be different for different providers.

Now try to connect with pppd call gprs. Look in /var/log/messages for any errors! If all looks good, try pinging an address. On the net? Cool!

Surfing:

In many cases (mine too), you cannot connect directly to the web. Instead, you have to go through your provider's proxy. In Firefox I simply set the proxy by going to "Edit, Preferences" clicking on the "Advanced" button and then the "Network" tab. Click on "Connection Settings." Change to "Manual proxy." For T-Mobile USA, I set the proxy to: 216.155.165.50 port 8080. Works beautifully and way, way faster than using my phone's browser! Enjoy!


This page a work in progress. Last Updated: Sat, 08 Mar 2008 16:48:07 -0500