GPRS

From University of Washington - Ubicomp Research Page
Jump to: navigation, search

Introduction

The Bluetooth capabilities of the iMote2/MSB allow it to use a cell phone to connect to the Internet via GPRS. Once connected, a GPRS connection looks like an ordinary Internet connection -- there's no need to run custom applications on either the phone or iMote2. However, setting up a GPRS connection takes a bit of work.

Prerequisites

To use GPRS on the iMote2, your kernel must be compiled with PPP support, or have the PPP modules compiled for your kernel (selected under Device Drivers -> Network device support in menuconfig). You must also have the ppp applications installed on the iMote2's filesystem. Finally, you must have Bluetooth/RFCOMM/HCI UART/H4 support compiled in or as a module (selected under Networking -> Bluetooth subsystem support), but this is usually comes standard with most iMote2 images.

Configuration files

Configuring GPRS requires setting up a Bluetooth connection with your cell phone, and configuring pppd.

Bluetooth

To set up a Bluetooth connection with your cell phone, follow these steps:

1. Search for a dial-up networking service on your phone. You can do this with sdptool search dun. The output will look something like:

Inquiring ...
Searching for dun on 00:13:D3:7D:07:75 ...

Service Name: Dial-up Networking
Service RecHandle: 0x10005
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 3
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100

Note the Bluetooth address and the channel number.

2. Edit /etc/bluetooth/rfcomm.conf:

rfcomm0 {
        bind yes;
        device 00:12:D2:65:37:BF;
        channel 2;
}

3. Edit /etc/default/bluetooth, and change RFCOMM_ENABLE to true.

4. Edit /etc/init.d/S30bluetooth, and replace lines 81-83 with: $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all

pppd

Create a symlink from /etc/ppp/resolv.conf to /etc/resolv.conf: ln -s /etc/resolv.conf /etc/ppp/resolv.conf

Different networks require different configurations. Supported networks are listed below with the proper configuration files and contents.

Cingular GPRS

The following files need to be created:

/etc/ppp/peers/gprs

/dev/rfcomm0 921600
connect '/usr/sbin/chat -v -V -s -f /etc/ppp/scripts/chat-gprs'
name WAP@CINGULARGPRS.COM
noauth

/etc/ppp/scripts/chat-gprs

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
OK              ATE1
OK              'AT+cgdcont=1,"IP","wap.cingular"'
OK              ATD*99***1#

Establishing a GPRS connection

If all goes well, you should be able to establish a GPRS connection with: pppd call gprs. After a few seconds, run ifconfig, and see if a new ppp interface shows up. By default, this will NOT update resolv.conf (which tells the iMote which nameservers to use), and won't establish a default route through the ppp interface. Add usepeerdns to the above command to reset your resolv.conf to the GPRS nameservers. Add defaultroute to the above command to add a default route through the ppp interface. Note that this option won't have any effect if a default route already exists -- use the route command to see if one exists and to remove it.