Juanito
Group: Members
Posts: 1601
Joined: Sep. 2005 |
|
Posted: Feb. 09 2007,06:47 |
|
This is part 4 of the DSL Bluetooth how-to. In order to proceed from here, you will need to have Bluetooth up and running on your DSL machine and be able to "pair" with a Bluetooth mobile phone as described in part 1 - "How to start Bluetooth & Pair with a remote device". You will also need to know how to discover which sdp channel your phone uses for dialup networking and bind this to a Bluetooth com port as described in part 2 - "How to dialup using a mobile phone via Bluetooth".
This might seem obvious, but you need to have GPRS enabled by your telecomms provider for your mobile phone and you will need to know if any special parameters are required to establish the connection. I believe most providers rely on your phone's SIM card for identification, so no addtional login or password is typically required.
I have not been able to make wvdial work with GPRS - it looks like it's working, data comes and goes from the phone but does not make it back to DSL. The problem might be that "apt-get install wvdial" over-writes the symlink from /etc/ppp to /opt/ppp in DSL, but anyway, after much Googling I found a different solution (mostly from http://home.comcast.net/~spearcd/gprsdun.html). Note I have little idea what several of these settings do - if anybody would like to suggest corrections, please feel free.
First we need to create 3 files, as root, in /opt/ppp/peers:
# File name: gprs-connect-chat # '' AT # Replace "mnet" with the name of your GPRS service OK AT+CGDCONT=1,"IP","mnet" # This tells the phone to use the GPRS entry created above OK ATD*99***1# # If you have only one entry *99# will probably work. CONNECT '' # EOF
# File gprs-disconnect-chat # # This is called at <ctrl-c>, I have little idea what it does exec /usr/sbin/chat -V -s -S \ ABORT "BUSY" \ ABORT "ERROR" \ ABORT "NO DIALTONE" \ SAY "n\Sending break to the modem\n" \ "" "\K" \ "" "\K" \ "" "\K" \ "" "+++ATH" \ "" "+++ATH" \ "" "+++ATH" \ SAY "\nPDP context detached\n" # EOF
# Filename: gprs # # Most GPRS-enabled wireless devices don't reply to LCP echo's lcp-echo-failure 0 lcp-echo-interval 0 nodetach # Connect script: connect "/usr/sbin/chat -v -t3 -f /etc/ppp/peers/gprs-connect-chat" # Disconnect script: disconnect /etc/ppp/peers/gprs-disconnect-chat # Connection method used to wireless device: /dev/rfcomm0 115200 # Fast enough for GPRS and EDGE handsets. # Hardware flow control: crtscts # Ignore carrier detect signal from the modem: local # IP addresses, etc: :10.0.0.1 noipdefault ipcp-accept-local defaultroute usepeerdns # specifically addressed to the serial connection, not the GPRS connection) novj nobsdcomp novjccomp nopcomp noaccomp # This disables authentication user "username" persist maxfail 99 # EOF
Once these files are saved (and added to .filetool.lst), we can get started:
# hcitool scan Scanning ... 00:0A:D9:E8:4A:65 .P900 # hcitool cc 00:0A:D9:E8:4A:65 # hcitool auth 00:0A:D9:E8:4A:65 # rfcomm bind 0 00:0A:D9:E8:4A:65 7 # mknod -m 666 /dev/rfcomm0 c 216 0 # sdpd # sdptool add --channel=7 DUN Dial-Up Networking service registered
Then all that remains is to dial. Although there are several error messages, it works:
# /usr/sbin/pppd call gprs Serial connection established. Using interface ppp0 Connect: ppp0 <--> /dev/rfcomm0 Cannot determine ethernet address for proxy ARP local IP address 217.164.89.221 remote IP address 10.0.0.1 primary DNS address 195.229.241.222 secondary DNS address 213.42.20.20
The first terminal window will remain blocked whilst the connection is made so open a second terminal window to test the connection:
# ping damnsmalllinux.org PING damnsmalllinux.org (65.254.46.177): 56 data bytes 64 bytes from 65.254.46.177: icmp_seq=0 ttl=49 time=1128.3 ms 64 bytes from 65.254.46.177: icmp_seq=1 ttl=49 time=1042.2 ms 64 bytes from 65.254.46.177: icmp_seq=2 ttl=49 time=902.9 ms <ctrl-c> --- damnsmalllinux.org ping statistics --- 4 packets transmitted, 3 packets received, 25% packet loss round-trip min/avg/max = 902.9/1024.4/1128.3 ms
Return to the first terminal window to close the connection:
<ctrl-c> Terminating on signal 2. Connection terminated. Connect time 7.3 minutes. Sent 21380 bytes, received 248664 bytes. sh: line 1: /etc/ppp/peers/gprs-disconnect-chat: Permission denied disconnect script failed
I tried http://promos.mcafee.com/speedometer/test_0150.asp with Firefox which rated the connection at 45Kbit/s - this would certainly depend on the strength of the telecomms network signal but it also depends on how far the phone is from your DSL machine. Mine will still connect when the phone is 6-7 metres away but it is much slower.
When I first started with DSL, I would never have believed Bluetooth would work, let alone a GPRS connection, which shows the power of this software - I didn't see my phone bill yet though
|