There Ain’t No Strings on Me

I just bought a Dell 355 Bluetooth chip for my D420 since I make the rookie mistake of not ordering it installed originally.

About four hours later, I’ve successfully connected my Ubuntu 7.10 machine to the interwebs via GPRS/EDGE on my Sony Ericsson W810i issued to me by US AT&T. But, I bought the phone back when they were Cingular, so my settings remain from the good ol’ orange days.

First things first : $ sudo aptitude install bluez-utils blues-pin ppp

There are lots of instructions available to pair your phone with the PC. Make sure to put the phone in discoverable mode, then try to discover it and connect:

$ hcitool scan
Scanning ...
        00:11:22:33:44:55       icarus (W810i)
$ sudo hidd --connect 00:11:22:33:44:55

Now that we’ve got the initial pairing done, we’re going to write some connection settings.

We need to find the dial-out device channel.

$ sdptool browse 00:11:22:33:44:55 | grep "Dial-up" -A10
Service Name: Dial-up Networking
Service RecHandle: 0x10002
Service Class ID List:
  "Dialup Networking" (0x1103)
  "Generic Networking" (0x1201)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 2
Profile Descriptor List:
  "Dialup Networking" (0x1103)

Now, we set this number in the bluetooth radio-frequency config.

$ cat /etc/bluetooth/rfcomm.conf
# bluetooth config for phone
rfcomm0 {
    bind yes;
    # Bluetooth address of the device
    device 00:11:22:33:44:55;
    # RFCOMM channel for the dialup connection
        channel 2;
    # Description of the connection
    comment "w810i -- icarus";
}

In order to make this change “stick,” reinit the rfcomm0 connection.

$ sudo rfcomm release 0; sudo rfcomm bind 0;

Also, lets go ahead and configure the PIN settings for bluetooth:

$ cat /etc/bluetooth/pin
1234

$ cat /etc/bluetooth/pin_helper
#!/bin/sh
echo "PIN:"`cat /etc/bluetooth/pin`

Now that we have the configuration for the connection set, we configure the p-p-p-peer at /etc/ppp/peers/<nameofpeer>. This defines a ppp (modem) connection via rfcomm0. I called my peer gprs. You can name it whatever you want. You will use this filename as the alias for the call command we’ll issue at the end.

$ cat /etc/ppp/peers/gprs
/dev/rfcomm0
115200        # speed
defaultroute  # use the cellular network for the default route
usepeerdns    # use the DNS servers from the remote network
nodetach      # keep pppd in the foreground
crtscts       # hardware flow control
lock          # lock the serial port
noauth        # don't expect the modem to authenticate itself
local         # don't use Carrier Detect or Data Terminal Ready
debug         # show debugging information in plog
noccp         # compression
noipdefault
asyncmap 0xa0000 #make server happy
0.0.0.0:0.0.0.0  #default nopid

user "WAP@CINGULARGPRS.COM"  #Cingular Orange
remotename cingular
ipparam cingular

# Use the next two lines if you receive the dreaded messages:
#
#    No response to n echo-requests
#    Serial link appears to be disconnected.
#    Connection terminated.
#
lcp-echo-failure 10000
lcp-echo-interval 1000

connect '/usr/sbin/chat -s -v -f /etc/chatscripts/gprs'
#no disconnect script necessary

Additionally, the CHAP authentication scheme that Cingular wants with the username is configured in /etc/ppp/chap-secrets.

$ sudo cat /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
"WAP@CINGULARGPRS.COM" * "cingular1"

When we use the dialer to make the above link to the phone’s modem via bluetooth, the modem has to know what conversation (chat) to have with the server. (Note the file location on the second-to-last line above.)

$ cat /etc/chatscripts/gprs
#
TIMEOUT 10
ABORT   'BUSY'
ABORT   'NO ANSWER'
ABORT   'ERROR'
SAY     'Starting GPRS connect script\n'

# Get the modem's attention and reset it.
SAY	'ATTN Modem\n'
""      ATZ

# MAGIC Sony Ericsson Init Codes
#SAY	'Sending SONY Codes\n'
OK 	'ATV1E1S0=0&D2&C1'
OK 	'AT+CMEE=1'

# Cingular Orange (if you signed up before the merger)
OK      AT+CGDCONT=1,"IP","wap.cingular"

#SAY     'Dialing...\n'
OK      ATD*99#
CONNECT ""

Now, we have all the pieces in place to attempt to call. Fire it up. Remember to call the filename you used in /etc/ppp/peers/ if you changed it.

$ pppd call gprs

Now you should see lots of pretty text flying by and your phone should light up saying that it’s connected. If not, I’m sorry and your settings are either slightly different than mine or there’s some mundane detail that you need to complete in order to make your dialer behave like mine.

If your connection stays open without any errors, before you can use the connection with Firefox, you may need to add a default route. Use netstat to figure out what connection you currently have, and then use route to add that connection to the default route configuration.

$ netstat -nr
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.10.1.0       0.0.0.0         255.255.255.0   U         0 0          0 ppp0
$ sudo route add default ppp0

Bueno.

0 Response to “There Ain’t No Strings on Me”


  • No Comments

Leave a Reply

You must login to post a comment.