#!/bin/sh # # start-bt-modem: Start "dial-up networking" via Bluetooth with a Treo 700p. # Paul Walmsley 20071219 # # For this script to work, you must already have paired your computer and # the phone, and the computer should appear in the "trusted devices list" # on your Treo. # # You'll need to change the PHONE_BT_ADDR variable to match your phone's # Bluetooth address. To find this, set your Treo's Bluetooth visibility # to "Temporary" and run 'hcitool scan' on your Linux box. # PHONE_BT_ADDR=aa:bb:cc:dd:ee:ff # ############################# # # Items you are unlikely to need to change # # Bluetooth interface device name - run 'hciconfig' to find this BT_IF=hci0 # # Set this to 'nolog' if you want pppd to be quiet on startup. PPPD_QUIET='debug' # # Change this line if your RFCOMM devices show up in some nonstandard # directory. RFCOMM_DEVPATH=/dev # # Change this line if you are already using rfcomm7 RFCOMM_DEV=rfcomm7 # ############################## # hciconfig $BT_IF auth encrypt secure # # Find what channel the DUN service is hiding on today. This hops around # for some reason on the Treo. # CHANNEL=`sdptool search --bdaddr $PHONE_BT_ADDR DUN | egrep Channel | cut -d: -f2` if [ -z $CHANNEL ]; then echo Could not find dial-up networking service on $PHONE_BT_ADDR. exit 254 fi # # Bind a local RFCOMM device to that channel - releasing the existing # binding if it's already present. # if [ -c $RFCOMM_DEVPATH/$RFCOMM_DEV ]; then rfcomm -i $BT_IF release $RFCOMM_DEV fi rfcomm -i $BT_IF bind $RFCOMM_DEV $PHONE_BT_ADDR $CHANNEL # # Start the PPP connection. # pppd $RFCOMM_DEVPATH/$RFCOMM_DEV 921600 connect '/usr/sbin/chat -s -v "" "AT&F0E0V1S0=0" OK ATD#777 CONNECT' $PPPD_QUIET updetach crtscts noipdefault novj lcp-echo-failure 0 nobsdcomp novjccomp nopcomp noaccomp noauth user USERNAME modem usepeerdns defaultroute connect-delay 5000