个人工具

“UbuntuHelp:BluetoothDialup”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/BluetoothDialup}} {{Languages|php5}} This page describes how to configure PPP dialup through a Bluetooth-compatible mobile phone. The emphasis is o...)
 
 
(未显示2个用户的20个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/BluetoothDialup}}
 
{{From|https://help.ubuntu.com/community/BluetoothDialup}}
{{Languages|php5}}
+
{{Languages|UbuntuHelp:BluetoothDialup}}
This page describes how to configure PPP dialup through a Bluetooth-compatible mobile phone. The emphasis is on using GPRS/EDGE services. These instruction were compiled and tested on Ubuntu 6.06 (Dapper Drake) on an IBM ThinkPad T40p with a Samsung T809 phone using T-Mobile's "Unlimited Internet VPN" plan.
+
This page describes how to configure PPP dialup through a Bluetooth-compatible mobile phone. The emphasis is on using GPRS/EDGE services. These instruction were compiled and tested on Ubuntu 6.06 (Dapper Drake) on an IBM Think''''''Pad T40p with a Samsung T809 phone using T-Mobile's "Unlimited Internet VPN" plan.
 
+
 
== Configure mobile phone data profiles ==
 
== Configure mobile phone data profiles ==
 +
=== List of web pages providing GPRS details ===
 +
* http://www.filesaveas.com/gprs.html - Most UK providers including O2, Vodafone, T-Mobile, 3 and Orange
 +
* Please add more
 
=== Getting the data access profile ===
 
=== Getting the data access profile ===
 
==== T-Mobile ====
 
==== T-Mobile ====
 
T-Mobile accounts generally require separate data profiles for WAP and general data access. (Some people have had success running a regular data connection over the WAP profile.) Getting access to general data access requires a data access plan. Currently, the "Unlimited Internet VPN" is the best deal, as it costs the same as the "Unlimited Internet" plan but gives you a real, public IP address. Incoming connections are blocked on any T-Mobile data plan. T-Mobile does not seem to offer metered data plans anymore.
 
T-Mobile accounts generally require separate data profiles for WAP and general data access. (Some people have had success running a regular data connection over the WAP profile.) Getting access to general data access requires a data access plan. Currently, the "Unlimited Internet VPN" is the best deal, as it costs the same as the "Unlimited Internet" plan but gives you a real, public IP address. Incoming connections are blocked on any T-Mobile data plan. T-Mobile does not seem to offer metered data plans anymore.
 
 
There are two ways to get the data service profile on your phone. Manual configuration is probably faster and better.
 
There are two ways to get the data service profile on your phone. Manual configuration is probably faster and better.
 
===== Automatic =====
 
===== Automatic =====
 
T-Mobile can send the data services profile directly to your phone via SMS. Only the "wireless data" customer service people can send the data services profile to your phone. The regular service people can only send the WAP data profile, which will not work for general use. You will have to be transferred once or twice to reach the wireless data division. Once there, simply request that the data service profile for your plan be sent to your phone. (Of course, you'll need to be signed up for a data plan.)
 
T-Mobile can send the data services profile directly to your phone via SMS. Only the "wireless data" customer service people can send the data services profile to your phone. The regular service people can only send the WAP data profile, which will not work for general use. You will have to be transferred once or twice to reach the wireless data division. Once there, simply request that the data service profile for your plan be sent to your phone. (Of course, you'll need to be signed up for a data plan.)
 
 
Once you receive the plan information, your phone will ask you where you want to store it. T-Mobile uses profile 1 for the WAP profile, so don't overwrite it. I recommend using profile 2, as it's usually the first empty profile.
 
Once you receive the plan information, your phone will ask you where you want to store it. T-Mobile uses profile 1 for the WAP profile, so don't overwrite it. I recommend using profile 2, as it's usually the first empty profile.
 
 
After storing the data services profile, your phone will probably set it as the default. This will probably cause your WAP (T-Zones/T-Mobile Internet) to fail for your on-phone browser. Set the WAP data profile (profile 1) to default fix this. See the configuration section below for your phone's brand. Setting the default profile is usually fairly obvious once you've reach the data services configuration screen.
 
After storing the data services profile, your phone will probably set it as the default. This will probably cause your WAP (T-Zones/T-Mobile Internet) to fail for your on-phone browser. Set the WAP data profile (profile 1) to default fix this. See the configuration section below for your phone's brand. Setting the default profile is usually fairly obvious once you've reach the data services configuration screen.
 
 
===== Manual =====
 
===== Manual =====
 
Access the data profiles configuration for your phone's brand using the instructions under the configuration section below. The order and name for settings is for a Samsung T809. These settings are modified from the SMS T-Mobile sends Unlimited Internet VPN plan users. By adding the DNS and proxy information, you can use this profile for either T-Zones or general web browsing.
 
Access the data profiles configuration for your phone's brand using the instructions under the configuration section below. The order and name for settings is for a Samsung T809. These settings are modified from the SMS T-Mobile sends Unlimited Internet VPN plan users. By adding the DNS and proxy information, you can use this profile for either T-Zones or general web browsing.
 
 
Use the following settings for the Unlimited Internet VPN plan:
 
Use the following settings for the Unlimited Internet VPN plan:
 
*Name: <code><nowiki>T-Mobile VPN</nowiki></code>
 
*Name: <code><nowiki>T-Mobile VPN</nowiki></code>
第25行: 第22行:
 
*Proxy use: <code><nowiki>Enable</nowiki></code>
 
*Proxy use: <code><nowiki>Enable</nowiki></code>
 
*GPRS settings
 
*GPRS settings
**Proxy: <code><nowiki>216.155.165.50</nowiki></code>
+
*Proxy: <code><nowiki>216.155.165.50</nowiki></code>
**Proxy Port: <code><nowiki>8080</nowiki></code>
+
*Proxy Port: <code><nowiki>8080</nowiki></code>
**DNS1: <code><nowiki>216.155.175.105</nowiki></code>
+
*DNS1: <code><nowiki>216.155.175.105</nowiki></code>
**DNS2: <code><nowiki>216.155.175.106</nowiki></code>
+
*DNS2: <code><nowiki>216.155.175.106</nowiki></code>
**APN: <code><nowiki>internet3.voicestream.com</nowiki></code>
+
*APN: <code><nowiki>internet3.voicestream.com</nowiki></code>
**Login ID: ''Empty''
+
*Login ID: ''Empty''
**Password: ''Empty''
+
*Password: ''Empty''
 
+
 
==== Other companies ====
 
==== Other companies ====
 
Call your mobile service provider and request information about data plans. Many charge by the megabyte, but unlimited plans are increasingly available. Most of the instruction for T-Mobile will probably apply.
 
Call your mobile service provider and request information about data plans. Many charge by the megabyte, but unlimited plans are increasingly available. Most of the instruction for T-Mobile will probably apply.
 
 
=== Configuration ===
 
=== Configuration ===
 
==== Sony Ericsson GSM ====
 
==== Sony Ericsson GSM ====
 
This is from my memory of using a T610, but it should apply to any Sony Ericsson phone. Choose the lower-left icon from the main menu.
 
This is from my memory of using a T610, but it should apply to any Sony Ericsson phone. Choose the lower-left icon from the main menu.
 
 
==== Samsung GSM ====
 
==== Samsung GSM ====
 
This is tested on a T809, but should apply to any Samsung GSM phone. Enter code <code><nowiki>*#87927#</nowiki></code> from the main screen. Select "Current profile" to choose the default profile. Select "Profile settings" to manage profiles.
 
This is tested on a T809, but should apply to any Samsung GSM phone. Enter code <code><nowiki>*#87927#</nowiki></code> from the main screen. Select "Current profile" to choose the default profile. Select "Profile settings" to manage profiles.
 
 
==== LG GSM ====
 
==== LG GSM ====
 
This is tested on a CU 320 and works. If you have problems authenticating from the machine, discover it from the phone.
 
This is tested on a CU 320 and works. If you have problems authenticating from the machine, discover it from the phone.
 
+
==== Nokia GSM ====
 +
This is tested on a 5300 XpressMusic with Vodafone Live The Netherlands. I didn't change any settings on the phone.
 
== Installing Bluetooth and dialup packages ==
 
== Installing Bluetooth and dialup packages ==
 
* If you have the <code><nowiki>ubuntu-desktop</nowiki></code> package installed, you can skip to the next section
 
* If you have the <code><nowiki>ubuntu-desktop</nowiki></code> package installed, you can skip to the next section
第51行: 第45行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install bluez-utils bluez-pin ppp  
 
sudo apt-get install bluez-utils bluez-pin ppp  
</nowiki></code>
+
</nowiki></pre>
 
+
 
== Listing Bluetooth devices ==
 
== Listing Bluetooth devices ==
 
* Make your phone Bluetooth discoverable.
 
* Make your phone Bluetooth discoverable.
第58行: 第51行:
 
<pre><nowiki>
 
<pre><nowiki>
 
hcitool scan
 
hcitool scan
</nowiki></code>
+
</nowiki></pre>
 
* Copy the MAC address (the text with the capital letters, numbers, and ':'s) somewhere convenient. You'll need it many times.
 
* Copy the MAC address (the text with the capital letters, numbers, and ':'s) somewhere convenient. You'll need it many times.
 
 
== Pairing ==
 
== Pairing ==
 
You can skip this section if you've already paired your phone with your computer. However, consider the final optional step, as your phone might otherwise nag you every time you use if for dialup.
 
You can skip this section if you've already paired your phone with your computer. However, consider the final optional step, as your phone might otherwise nag you every time you use if for dialup.
第66行: 第58行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo hcitool cc your-phone-mac-address
 
sudo hcitool cc your-phone-mac-address
</nowiki></code>
+
</nowiki></pre>
 
* Run the following, replacing your-phone-mac-address with the proper data
 
* Run the following, replacing your-phone-mac-address with the proper data
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo hcitool auth your-phone-mac-address
 
sudo hcitool auth your-phone-mac-address
</nowiki></code>
+
</nowiki></pre>
** If this command doesn't work, try the pairing instructions on other Bluetooth wiki pages; it seems 5.10 and older have issues with the PIN wrapper
+
* If this command doesn't work, try the pairing instructions on other Bluetooth wiki pages; it seems 5.10 and older have issues with the PIN wrapper
* Enter a numeric code into the dialog box that pops up
+
* Enter a numeric code into the dialog box that pops up. If no dialog box pops up, run the following in another window
* Accept the pairing from your phone handset
+
<pre><nowiki>
 +
sudo passkey-agent --default /usr/bin/bluez-pin
 +
</nowiki></pre>
 +
* Accept the pairing from your phone handset.
 
* Enter the same number on your phone
 
* Enter the same number on your phone
 
* Run the <code><nowiki>hcitool auth your-phone-mac-address</nowiki></code> command again if it fails
 
* Run the <code><nowiki>hcitool auth your-phone-mac-address</nowiki></code> command again if it fails
 
* You can remove your handset's Bluetooth discoverability now
 
* You can remove your handset's Bluetooth discoverability now
 
* Some phones (notably Samsungs) require further authorization for certain Bluetooth activities, including dialup; consult your phone's user manual to avoid confirming your computer's dialup action on your phone every time
 
* Some phones (notably Samsungs) require further authorization for certain Bluetooth activities, including dialup; consult your phone's user manual to avoid confirming your computer's dialup action on your phone every time
 
+
Note:  I couldn't pair using the above instructions in Edgy.  I had to install bluez-passkey-gnome, launch bt-applet (it's invisible when waiting), then initiate pairing ''from the phone''.
Note:  I couldn't pair using the above instructions in Edgy.  I had to install bluez-passkey-gnome, run bt-applet, then use the phone to search for the bluetooth adapter and pair with it.
+
Note: I couldn't pair using the above instructions in Feisty. The pairing instead took place when I dialed the connection for the first time. I could not pair from the phone since my computer was hidden.
 
+
 
== Configuring the rfcomm device ==
 
== Configuring the rfcomm device ==
* Get the channel number for your phone's dialup service by running the following, replacing your-phone-mac-address with the proper data
+
* Find the channel number for your phone's dialup service by running the following.
 +
<pre><nowiki>
 +
sdptool search DUN
 +
</nowiki></pre>
 +
* Alternatively, get information about all the services on your phone by running this, replacing your-phone-mac-address with the proper data
 
<pre><nowiki>
 
<pre><nowiki>
 
sdptool browse your-phone-mac-address
 
sdptool browse your-phone-mac-address
</nowiki></code>
+
</nowiki></pre>
* Look under "Service Name: Dial-up Networking"
+
* In either case, look under "Service Name: Dial-up Networking"
 
* Under "Protocol Descriptor List:"  and "RFCOMM", there should be a number after "Channel:"
 
* Under "Protocol Descriptor List:"  and "RFCOMM", there should be a number after "Channel:"
 
* Remember that number; you'll need it for the rfcomm configuration
 
* Remember that number; you'll need it for the rfcomm configuration
第92行: 第90行:
 
<pre><nowiki>
 
<pre><nowiki>
 
gksudo gedit /etc/bluetooth/rfcomm.conf
 
gksudo gedit /etc/bluetooth/rfcomm.conf
</nowiki></code>
+
</nowiki></pre>
 
* Paste the following into the file, replacing your-phone-mac-address and your-phone-rfcomm-channel with appropriate values
 
* Paste the following into the file, replacing your-phone-mac-address and your-phone-rfcomm-channel with appropriate values
 
<pre><nowiki>
 
<pre><nowiki>
第101行: 第99行:
 
comment "Bluetooth PPP Connection";
 
comment "Bluetooth PPP Connection";
 
}
 
}
</nowiki></code>
+
</nowiki></pre>
 
* Save and close the <code><nowiki>rfcomm.conf</nowiki></code> file
 
* Save and close the <code><nowiki>rfcomm.conf</nowiki></code> file
 
* Run the following, which will create the rfcomm0 device
 
* Run the following, which will create the rfcomm0 device
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo /etc/init.d/bluez-utils restart
 
sudo /etc/init.d/bluez-utils restart
</nowiki></code>
+
</nowiki></pre>
 
+
Note that on Edgy, Feisty and Hardy the correct command is:
 +
<pre><nowiki>
 +
sudo /etc/init.d/bluetooth restart
 +
</nowiki></pre>
 +
Note: On the Nokia N95 (and possibly other Symbian S60 phones) the RFCOMM channel number is not consistent, but seems to change from time to time.  If you have a phone that behaves like this, and you find youself unable to connect, you will need to re-run sdptool as described above to see if the channel number has changed.  Rather than edit rfcomm.conf (and hence have RFCOMM bind to the channel at startup) you may find it more convenient to bind the RFCOMM channel on the command line:
 +
<pre><nowiki>
 +
rfcomm bind 0 your-phone-mac-address your-phone-rfcomm-channel
 +
</nowiki></pre>
 +
If you get the wrong channel (or if the wrong channel was bound at startup as a result of rfcomm.conf) then you need to release it before you can bind it again:
 +
<pre><nowiki>
 +
rfcomm release 0
 +
</nowiki></pre>
 
== Configuring PPP ==
 
== Configuring PPP ==
 
* Run the following
 
* Run the following
 
<pre><nowiki>
 
<pre><nowiki>
 
gksudo gedit /etc/ppp/peers/BluetoothDialup
 
gksudo gedit /etc/ppp/peers/BluetoothDialup
</nowiki></code>
+
</nowiki></pre>
 
* Paste the following into the file (the file should start out blank)(I found that on my Motorola V360 that I had to comment out #lcp-echo-failure 0 useing T-Mobile.)
 
* Paste the following into the file (the file should start out blank)(I found that on my Motorola V360 that I had to comment out #lcp-echo-failure 0 useing T-Mobile.)
 
<pre><nowiki>
 
<pre><nowiki>
第123行: 第132行:
 
crtscts
 
crtscts
 
lcp-echo-failure 0
 
lcp-echo-failure 0
</nowiki></code>
+
</nowiki></pre>
 
* Save and close the <code><nowiki>BluetoothDialup</nowiki></code> file
 
* Save and close the <code><nowiki>BluetoothDialup</nowiki></code> file
 
* Run the following
 
* Run the following
 
<pre><nowiki>
 
<pre><nowiki>
 
gksudo gedit /etc/chatscripts/BluetoothDialup
 
gksudo gedit /etc/chatscripts/BluetoothDialup
</nowiki></code>
+
</nowiki></pre>
 
* Paste the following into the file (the file should start out blank), replacing your-apn-here with the APN from your data services profile and your-data-profile-number-here with the number you stored the profile into on the phone (probably 2).  
 
* Paste the following into the file (the file should start out blank), replacing your-apn-here with the APN from your data services profile and your-data-profile-number-here with the number you stored the profile into on the phone (probably 2).  
 
 
<pre><nowiki>
 
<pre><nowiki>
 
TIMEOUT 35
 
TIMEOUT 35
第144行: 第152行:
 
OK ATD*99***your-data-profile-number-here#
 
OK ATD*99***your-data-profile-number-here#
 
CONNECT ""
 
CONNECT ""
</nowiki></code>
+
</nowiki></pre>
 
+
* I had to use "AT+CGDCONT=1" with my Nokia 6120 Classic and O2 Germany
 
== Carrier specific configuration info ==
 
== Carrier specific configuration info ==
=== T-Mobile ===
+
* [[UbuntuHelp:BluetoothDialup/TMobile| T-Mobile]]
 
+
* [[UbuntuHelp:BluetoothDialup/KPNHi| KPN Hi]]
For the cheaper T-Zones (T-MobileWeb) data plan:
+
* [[UbuntuHelp:BluetoothDialup/Cingular| Cingular]]
<pre><nowiki>
+
* [[UbuntuHelp:BluetoothDialup/Verizon| Verizon]]
TIMEOUT 35
+
* [[UbuntuHelp:BluetoothDialup/Celtel| Celtel]] - Kenya
ECHO ON
+
* [[UbuntuHelp:BluetoothDialup/Fido| Fido]] - Canada
ABORT '\nBUSY\r'
+
* [[UbuntuHelp:BluetoothDialup/Tele2lv| Tele2]] - Latvia
ABORT '\nERROR\r'
+
* [[UbuntuHelp:BluetoothDialup/Telenor| Telenor]] - Sweden
ABORT '\nNO ANSWER\r'
+
* [[UbuntuHelp:BluetoothDialup/Vodacom| Vodacom]] - South Africa
ABORT '\nNO CARRIER\r'
+
* [[UbuntuHelp:BluetoothDialup/Vodafone| Vodafone]] - The Netherlands
ABORT '\nNO DIALTONE\r'
+
* [[UbuntuHelp:BluetoothDialup/Orange| Orange]] - Poland
ABORT '\nRINGING\r\n\r\nRINGING\r'
+
* [[UbuntuHelp:BluetoothDialup/Play| Play]] - Poland
'' \rAT
+
OK 'AT+CGDCONT=1,"IP","wap.voicestream.com"'
+
OK ATD*99#
+
CONNECT ""
+
</nowiki></code>
+
 
+
For the full service plans:
+
<pre><nowiki>
+
TIMEOUT 35
+
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
+
OK 'AT+CGDCONT=1,"IP","internet3.voicestream.com"'
+
OK ATD*99#
+
CONNECT ""
+
</nowiki></code>
+
 
+
Note: T-Mobile seems to have made changes to their connection settings during the end of 2006. If for some reason the above isn't working in your area, you can try replacing AT+CGDCONT=1 with AT+CGDCONT=2 above. Also, the data-profile-number might be 2.
+
 
+
=== KPN Hi ===
+
 
+
For a KPN Hi connection use:
+
<pre><nowiki>
+
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      ATZ
+
OK      'AT+CGDCONT=1,"IP","internet",,0,0'
+
OK      ATD*99***1#
+
</nowiki></code>
+
 
+
== Cingular ==
+
 
+
<pre><nowiki>
+
TIMEOUT 35
+
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
+
OK      'AT+CGDCONT=1,"IP","WAP.CINGULAR"'
+
OK      ATD*99***1#
+
CONNECT ""
+
</nowiki></code>
+
 
+
The file might make a connection which doesn't allow ping. Modify your "default" configuration made via <code><nowiki>pppconfig</nowiki></code> to connect using the USB cable.  Adjust the username and passwords as needed for your plan.
+
 
+
<pre><nowiki>
+
# This optionfile was generated by pppconfig 2.3.10.
+
#
+
#
+
hide-password
+
noauth
+
connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
+
debug
+
/dev/rfcomm0 115200
+
defaultroute
+
noipdefault
+
user "WAP@CINGULARGRPS.COM"
+
remotename provider
+
ipparam provider
+
 
+
usepeerdns
+
</nowiki></code>
+
 
+
<code><nowiki>/etc/chatscript/BluetoothDialup</nowiki></code> looks like this:
+
 
+
<pre><nowiki>
+
# This chatfile was generated by pppconfig 2.3.10.
+
# Please do not delete any of the comments.  Pppconfig needs them.
+
#
+
# ispauth PAP
+
# abortstring
+
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
+
# modeminit
+
'' ATZ
+
# ispnumber
+
OK-AT-OK "ATDT*99***1#"
+
# ispconnect
+
CONNECT \d\c
+
# prelogin
+
 
+
# ispname
+
# isppassword
+
# postlogin
+
 
+
</nowiki></code>
+
 
+
Finally, add this to the <code><nowiki>/etc/ppp/pap-secrets</nowiki></code> file:
+
 
+
<pre><nowiki>
+
"WAP@CINGULARGPRS.COM" BluetoothDialup "CINGULAR1"
+
</nowiki></code>
+
 
+
=== Verizon ===
+
 
+
This works for me on the EVDO network (but not on the 1xRTT net)
+
 
+
This file is /etc/chatscripts/verizon
+
<pre><nowiki>
+
# abortstring
+
ABORT 'NO CARRIER' ABORT 'ERROR' ABORT 'NO DIALTONE' ABORT 'BUSY' ABORT 'NO ANSWER'
+
# modeminit
+
'' ATZ
+
# ispnumber
+
OK-AT-OKL3 ATDT#777
+
# ispconnect
+
CONNECT \d\c
+
</nowiki></code>
+
 
+
My /etc/ppp/peers/verizon file looks like this (replace the XXX with your phone #):
+
<pre><nowiki>
+
hide-password
+
/dev/rfcomm0
+
connect "/usr/sbin/chat -v -f /etc/chatscripts/verizon"
+
noauth
+
defaultroute
+
usepeerdns
+
connect-delay 10000
+
user "XXX-XXX-XXXX@vzw3g.com"
+
lock
+
lcp-echo-failure 4
+
lcp-echo-interval 65535
+
 
+
115200
+
</nowiki></code>
+
 
+
This configuration work on the 1xRTT but not EVDO.
+
 
+
This file is /etc/ppp/peers/1x
+
<pre><nowiki>
+
hide-password
+
/dev/rfcomm0
+
connect "/usr/sbin/chat -v -f /etc/chatscripts/1x"
+
noauth
+
defaultroute
+
usepeerdns
+
connect-delay 10000
+
user "qnc"
+
password "qnc"
+
lcp-echo-failure 4
+
lcp-echo-interval 65535s
+
115200
+
</nowiki></code>
+
This file is /etc/chatscripts/1x
+
<pre><nowiki>
+
# abortstring
+
ABORT 'NO CARRIER' ABORT 'ERROR' ABORT 'NO DIALTONE' ABORT 'BUSY' ABORT 'NO ANSWER'
+
# modeminit
+
'' AT$QCMDR=2
+
# ispnumber
+
OK-AT-OKL3 ATDT#777
+
# ispconnect
+
CONNECT \d\c
+
</nowiki></code>
+
Save and close the <code><nowiki>BluetoothDialup</nowiki></code> file
+
 
+
 
== Phone specific configuration details ==
 
== Phone specific configuration details ==
 
 
=== Samsung SGH-X820 ===
 
=== Samsung SGH-X820 ===
 
 
This phone seems to have problems with various PPP options. Adding the following options to the relevant file in /etc/ppp/peers seemed to make it work.
 
This phone seems to have problems with various PPP options. Adding the following options to the relevant file in /etc/ppp/peers seemed to make it work.
 
 
<pre><nowiki>
 
<pre><nowiki>
 
nopcomp
 
nopcomp
第345行: 第178行:
 
novj
 
novj
 
novjccomp
 
novjccomp
</nowiki></code>
+
</nowiki></pre>
 
+
 
== Authorizing dialout ==
 
== Authorizing dialout ==
 
* Run the following at a shell prompt, replacing your-username-here with your username:
 
* Run the following at a shell prompt, replacing your-username-here with your username:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo adduser your-username-here dialout
 
sudo adduser your-username-here dialout
</nowiki></code>
+
</nowiki></pre>
 
* This concludes the one-time setup
 
* This concludes the one-time setup
 
 
== Connecting ==
 
== Connecting ==
 
Begin here on subsequent connections.
 
Begin here on subsequent connections.
* If you have NetworkManager installed, right-click the applet and uncheck "Enable Wireless"; this will keep it from hopping onto wireless networks and botching your dialup DNS and default route settings
+
* If you have [[UbuntuHelp:NetworkManager|NetworkManager]] installed, right-click the applet and uncheck "Enable Wireless"; this will keep it from hopping onto wireless networks and botching your dialup DNS and default route settings
 
+
N.b.  I do have [[UbuntuHelp:NetworkManager|NetworkManager]] installed and have found a work-around so that it doesn't mess with my connection over Bluetooth.  I have not tried this in an environment where there are multiple WiFi connections _and_ yet I'm still trying to use the phone as a modem.  The work-around is to edit the file /etc/network/interfaces and to add a line at the end of the file that reads:
N.b.  I do have NetworkManager installed and have found a work-around so that it doesn't mess with my connection over Bluetooth.  I have not tried this in an environment where there are multiple WiFi connections _and_ yet I'm still trying to use the phone as a modem.  The work-around is to edit the file /etc/network/interfaces and to add a line at the end of the file that reads:
+
 
<pre><nowiki>
 
<pre><nowiki>
 
iface hci0 inet static
 
iface hci0 inet static
</nowiki></code>
+
</nowiki></pre>
 
+
 
* Run the following
 
* Run the following
 
<pre><nowiki>
 
<pre><nowiki>
 
pon BluetoothDialup
 
pon BluetoothDialup
</nowiki></code>
+
</nowiki></pre>
 
* Wait about 30-60 seconds
 
* Wait about 30-60 seconds
 
* You should now be able to ping <code><nowiki>ubuntu.com</nowiki></code>; expect latencies of around one second for most GPRS services
 
* You should now be able to ping <code><nowiki>ubuntu.com</nowiki></code>; expect latencies of around one second for most GPRS services
 
* If pinging fails, see the troubleshooting section below
 
* If pinging fails, see the troubleshooting section below
 
* See the disconnect section below when you're finished using the connection
 
* See the disconnect section below when you're finished using the connection
 
 
== PPP and TCP/IP troubleshooting ==
 
== PPP and TCP/IP troubleshooting ==
 
Try these troubleshooting sections in order.
 
Try these troubleshooting sections in order.
 
 
=== Using the correct data plan ===
 
=== Using the correct data plan ===
 
* Check that you're indeed using a real data profile, as WAP-only profiles generally disallow pinging, instant messaging, file sharing, and some web browsing
 
* Check that you're indeed using a real data profile, as WAP-only profiles generally disallow pinging, instant messaging, file sharing, and some web browsing
 
* Try setting the unrestricted data profile as your default data profile on your phone
 
* Try setting the unrestricted data profile as your default data profile on your phone
** This will only work if the profile has proper DNS settings
+
* This will only work if the profile has proper DNS settings
*** If you use the T-Mobile automatic profile setup listed above, it will '''not''' have proper on-phone DNS settings
+
* If you use the T-Mobile automatic profile setup listed above, it will '''not''' have proper on-phone DNS settings
*** The manual method '''will''' work for T-Zones
+
* The manual method '''will''' work for T-Zones
** Use the built-in WAP browser to test the profile
+
* Use the built-in WAP browser to test the profile
*** If it works, it's probably not your data plan (though it could be); continue troubleshooting below
+
* If it works, it's probably not your data plan (though it could be); continue troubleshooting below
 
+
 
=== PPP connection ===
 
=== PPP connection ===
 
* Monitor <code><nowiki>/var/log/syslog</nowiki></code> for dialup status information
 
* Monitor <code><nowiki>/var/log/syslog</nowiki></code> for dialup status information
** The following indicates PPP success, where <code><nowiki>xxx</nowiki></code>s can be anything
+
* The following indicates PPP success, where <code><nowiki>xxx</nowiki></code>s can be anything
 
<pre><nowiki>
 
<pre><nowiki>
 
xxx localhost pppd[xxx]: Script /etc/ppp/ip-up finished (pid xxx), status = 0x0
 
xxx localhost pppd[xxx]: Script /etc/ppp/ip-up finished (pid xxx), status = 0x0
</nowiki></code>
+
</nowiki></pre>
 
==== Solution if problem ====
 
==== Solution if problem ====
 
* Make sure there's not a PPP connection with <code><nowiki>rfcomm0</nowiki></code> already in session; run <code><nowiki>poff BluetoothDialup</nowiki></code> to disconnect one in session
 
* Make sure there's not a PPP connection with <code><nowiki>rfcomm0</nowiki></code> already in session; run <code><nowiki>poff BluetoothDialup</nowiki></code> to disconnect one in session
 
* Find where the error is in either the chatscripts or peers file
 
* Find where the error is in either the chatscripts or peers file
** Consult other help sources and update this page
+
* Consult other help sources and update this page
 
+
 
=== IP address configuration ===
 
=== IP address configuration ===
 
* Run <code><nowiki>ifconfig</nowiki></code> to check your PPP connection
 
* Run <code><nowiki>ifconfig</nowiki></code> to check your PPP connection
** The <code><nowiki>ppp0</nowiki></code> section should be as below, where <code><nowiki>xxx</nowiki></code> is anything
+
* The <code><nowiki>ppp0</nowiki></code> section should be as below, where <code><nowiki>xxx</nowiki></code> is anything
 
<pre><nowiki>
 
<pre><nowiki>
 
ppp0 Link encap:Point-to-Point Protocol
 
ppp0 Link encap:Point-to-Point Protocol
第406行: 第231行:
 
           collisions:0 txqueuelen:xxx
 
           collisions:0 txqueuelen:xxx
 
           RX bytes:xxx (xxx b) TX bytes:xxx (xxx b)
 
           RX bytes:xxx (xxx b) TX bytes:xxx (xxx b)
</nowiki></code>
+
</nowiki></pre>
** <code><nowiki>P-t-P:xxx.xxx.xxx.xxx</nowiki></code> should match the address on the <code><nowiki>/var/log/syslog</nowiki></code> line <code><nowiki>xxx localhost pppd[xxx]: remote IP address xxx.xxx.xxx.xxx</nowiki></code>
+
* <code><nowiki>P-t-P:xxx.xxx.xxx.xxx</nowiki></code> should match the address on the <code><nowiki>/var/log/syslog</nowiki></code> line <code><nowiki>xxx localhost pppd[xxx]: remote IP address xxx.xxx.xxx.xxx</nowiki></code>
** <code><nowiki>inet addr:xxx.xxx.xxx.xxx</nowiki></code> should match the address on the <code><nowiki>/var/log/syslog</nowiki></code> line <code><nowiki>xxx localhost pppd[xxx]: local IP address xxx.xxx.xxx.xxx</nowiki></code>
+
* <code><nowiki>inet addr:xxx.xxx.xxx.xxx</nowiki></code> should match the address on the <code><nowiki>/var/log/syslog</nowiki></code> line <code><nowiki>xxx localhost pppd[xxx]: local IP address xxx.xxx.xxx.xxx</nowiki></code>
 
* If the addresses match, then your IP address configuration is probably fine
 
* If the addresses match, then your IP address configuration is probably fine
 
==== Solution if problem ====
 
==== Solution if problem ====
 
* If a <code><nowiki>/var/log/syslog</nowiki></code> line seems absent, try reconnecting via <code><nowiki>poff BluetoothDialup</nowiki></code> and <code><nowiki>pon BluetoothDialup</nowiki></code>
 
* If a <code><nowiki>/var/log/syslog</nowiki></code> line seems absent, try reconnecting via <code><nowiki>poff BluetoothDialup</nowiki></code> and <code><nowiki>pon BluetoothDialup</nowiki></code>
 
* Make sure you're using the right data profile on your phone
 
* Make sure you're using the right data profile on your phone
 
 
=== Default route configuration ===
 
=== Default route configuration ===
 
* Ping a valid public hostname on a connected computer, then (if it worked) try pinging the actual IP address from your PPP-connected computer
 
* Ping a valid public hostname on a connected computer, then (if it worked) try pinging the actual IP address from your PPP-connected computer
** If it didn't work, try pinging a different hostname; some block pings
+
* If it didn't work, try pinging a different hostname; some block pings
** If this works, then your routing table is probably fine
+
* If this works, then your routing table is probably fine
 
* Check the routing table by running <code><nowiki>route -n</nowiki></code>
 
* Check the routing table by running <code><nowiki>route -n</nowiki></code>
** Your routing table should look like the following, where <code><nowiki>xxx</nowiki></code> is anything
+
* Your routing table should look like the following, where <code><nowiki>xxx</nowiki></code> is anything
 
<pre><nowiki>
 
<pre><nowiki>
 
Kernel IP routing table
 
Kernel IP routing table
第425行: 第249行:
 
xxx.xxx.xxx.xxx * 255.255.255.255 UH 0 0 0 ppp0
 
xxx.xxx.xxx.xxx * 255.255.255.255 UH 0 0 0 ppp0
 
default * 0.0.0.0 U 0 0 0 ppp0
 
default * 0.0.0.0 U 0 0 0 ppp0
</nowiki></code>
+
</nowiki></pre>
** The <code><nowiki>xxx.xxx.xxx.xxx</nowiki></code> should match the <code><nowiki>P-t-P:xxx.xxx.xxx.xxx</nowiki></code> in the <code><nowiki>ifconfig</nowiki></code> command's <code><nowiki>ppp0</nowiki></code> block above
+
* The <code><nowiki>xxx.xxx.xxx.xxx</nowiki></code> should match the <code><nowiki>P-t-P:xxx.xxx.xxx.xxx</nowiki></code> in the <code><nowiki>ifconfig</nowiki></code> command's <code><nowiki>ppp0</nowiki></code> block above
 
* If the routing table checks out, routing is probably not the problem
 
* If the routing table checks out, routing is probably not the problem
 
==== Solutions if problem ====
 
==== Solutions if problem ====
 
 
===== Preferred method: Manually fix routing table =====
 
===== Preferred method: Manually fix routing table =====
 
This needs instructions, as it should be the preferred method
 
This needs instructions, as it should be the preferred method
 
 
===== Alternate method: Remove other interfaces =====
 
===== Alternate method: Remove other interfaces =====
 
* Run the following
 
* Run the following
 
<pre><nowiki>
 
<pre><nowiki>
 
poff BluetoothDialup
 
poff BluetoothDialup
</nowiki></code>
+
</nowiki></pre>
 
* Remove any non-loopback and <code><nowiki>ppp0</nowiki></code> connections by running the following, replacing your-extra-interface with the appropriate names
 
* Remove any non-loopback and <code><nowiki>ppp0</nowiki></code> connections by running the following, replacing your-extra-interface with the appropriate names
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo ifconfig your-extra-interface down
 
sudo ifconfig your-extra-interface down
</nowiki></code>
+
</nowiki></pre>
 
* Run the following
 
* Run the following
 
<pre><nowiki>
 
<pre><nowiki>
 
pon BluetoothDialup
 
pon BluetoothDialup
</nowiki></code>
+
</nowiki></pre>
 
+
 
=== DNS configuration ===
 
=== DNS configuration ===
 
* Try pinging the DNS servers
 
* Try pinging the DNS servers
 
* Try running <code><nowiki>dig hostname-here</nowiki></code>, where <code><nowiki>hostname-here</nowiki></code> is a valid hostname
 
* Try running <code><nowiki>dig hostname-here</nowiki></code>, where <code><nowiki>hostname-here</nowiki></code> is a valid hostname
** If it resolves, DNS is probably not the problem
+
* If it resolves, DNS is probably not the problem
 
* Check <code><nowiki>/etc/resolv.conf</nowiki></code> to check your DNS configuration
 
* Check <code><nowiki>/etc/resolv.conf</nowiki></code> to check your DNS configuration
** Your routing table should look like the following, where <code><nowiki>xxx</nowiki></code> is anything
+
* Your routing table should look like the following, where <code><nowiki>xxx</nowiki></code> is anything
 
<pre><nowiki>
 
<pre><nowiki>
 
nameserver xxx.xxx.xxx.xxx
 
nameserver xxx.xxx.xxx.xxx
 
nameserver xxx.xxx.xxx.xxx
 
nameserver xxx.xxx.xxx.xxx
</nowiki></code>
+
</nowiki></pre>
** The lines above should match the <code><nowiki>/var/log/syslog</nowiki></code> lines like the following
+
* The lines above should match the <code><nowiki>/var/log/syslog</nowiki></code> lines like the following
 
<pre><nowiki>
 
<pre><nowiki>
 
xxx localhost pppd[xxx]: primary DNS address xxx.xxx.xxx.xxx
 
xxx localhost pppd[xxx]: primary DNS address xxx.xxx.xxx.xxx
 
xxx localhost pppd[xxx]: secondary DNS address xxx.xxx.xxx.xxx
 
xxx localhost pppd[xxx]: secondary DNS address xxx.xxx.xxx.xxx
</nowiki></code>
+
</nowiki></pre>
 
==== Solution if problem ====
 
==== Solution if problem ====
 
* If a <code><nowiki>/var/log/syslog</nowiki></code> line seems absent, try reconnecting via <code><nowiki>poff BluetoothDialup</nowiki></code> and <code><nowiki>pon BluetoothDialup</nowiki></code>
 
* If a <code><nowiki>/var/log/syslog</nowiki></code> line seems absent, try reconnecting via <code><nowiki>poff BluetoothDialup</nowiki></code> and <code><nowiki>pon BluetoothDialup</nowiki></code>
 
* Manually configure <code><nowiki>/etc/resolv.conf</nowiki></code> to point to your provider's DNS servers (or a public DNS server)
 
* Manually configure <code><nowiki>/etc/resolv.conf</nowiki></code> to point to your provider's DNS servers (or a public DNS server)
** Try pinging the manually-configured DNS servers; if it fails only on the Bluetooth dialup machine, double-check the routing configuration
+
* Try pinging the manually-configured DNS servers; if it fails only on the Bluetooth dialup machine, double-check the routing configuration
 
+
=== "pon BluetoothDialup" - Does not connect to phone ===
 +
* If after following the above steps, if running "pon BluetoothDialup" does not connect to the bluetooth on your phone, then run the following command:
 +
<pre><nowiki>
 +
sudo gedit /etc/ppp/peers/provider
 +
</nowiki></pre>
 +
Check under
 +
<pre><nowiki>
 +
# Serial device to which the modem is connected.
 +
</nowiki></pre>
 +
If it is
 +
<pre><nowiki>
 +
/dev/modem
 +
</nowiki></pre>
 +
change to
 +
<pre><nowiki>
 +
/dev/rfcomm0
 +
</nowiki></pre>
 +
Then Relase and bind again
 +
<pre><nowiki>
 +
rfcomm release 0
 +
rfcomm bind 0 your-phone-mac-address your-phone-rfcomm-channel
 +
</nowiki></pre>
 
== Disconnecting ==
 
== Disconnecting ==
 
* Run the following
 
* Run the following
 
<pre><nowiki>
 
<pre><nowiki>
 
poff BluetoothDialup
 
poff BluetoothDialup
</nowiki></code>
+
</nowiki></pre>
* Re-enable NetworkManager's connections, if you use NetworkManager
+
* Re-enable [[UbuntuHelp:NetworkManager|NetworkManager]]'s connections, if you use [[UbuntuHelp:NetworkManager|NetworkManager]]
 
* Re-enable any other connections, as needed
 
* Re-enable any other connections, as needed
 
 
== Other useful guides ==
 
== Other useful guides ==
 
* [http://wiki.clug.org.za/wiki/GPRS_Internet_over_Bluetooth CLUG Wiki Guide to GPRS Internet over Bluetooth]
 
* [http://wiki.clug.org.za/wiki/GPRS_Internet_over_Bluetooth CLUG Wiki Guide to GPRS Internet over Bluetooth]
 
* [http://www.summet.com/x31/v330.html Motorola v330 Mobile Internet over Bluetooth with T-Mobile]
 
* [http://www.summet.com/x31/v330.html Motorola v330 Mobile Internet over Bluetooth with T-Mobile]
 
* [http://gehennom.net/~tool/tiki-view_blog_post.php?blogId=3&postId=22 Bluetooth dialup guide for Debian]
 
* [http://gehennom.net/~tool/tiki-view_blog_post.php?blogId=3&postId=22 Bluetooth dialup guide for Debian]
* [http://www.mip.sdu.dk/~pfavr/T610_Debian_GPRS_Howto.html T610 Debian GPRS]
+
* [http://www.how.dk/~pfavr/T610_Debian_GPRS_Howto.html T610 Debian GPRS]
* [http://www.resultspk.net/hackwireless/0596005598_wirelesshks-chp-2-sect-6.html Bluetooth to GPRS]
+
* [http://web.archive.org/web/20060517075607/http://www.resultspk.net/hackwireless/0596005598_wirelesshks-chp-2-sect-6.html Bluetooth to GPRS]
 
* [http://www.twoguys.org/~gregh/nokia-6310i.html Nokia 6310i and Bluetooth with Linux using T-Mobile]
 
* [http://www.twoguys.org/~gregh/nokia-6310i.html Nokia 6310i and Bluetooth with Linux using T-Mobile]
 
+
* [http://przemkalicki.pl/pGPRS/ pGPRS] - pyGTK GUI for easy configuration of a GPRS connection, in polish only
 
----
 
----
CategoryHardware CategoryDocumentation CategoryNetworking CategoryBluetooth
+
[[category:CategoryHardware]] [[category:CategoryBluetooth]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 21:44的最新版本


This page describes how to configure PPP dialup through a Bluetooth-compatible mobile phone. The emphasis is on using GPRS/EDGE services. These instruction were compiled and tested on Ubuntu 6.06 (Dapper Drake) on an IBM Think'Pad T40p with a Samsung T809 phone using T-Mobile's "Unlimited Internet VPN" plan.

Configure mobile phone data profiles

List of web pages providing GPRS details

Getting the data access profile

T-Mobile

T-Mobile accounts generally require separate data profiles for WAP and general data access. (Some people have had success running a regular data connection over the WAP profile.) Getting access to general data access requires a data access plan. Currently, the "Unlimited Internet VPN" is the best deal, as it costs the same as the "Unlimited Internet" plan but gives you a real, public IP address. Incoming connections are blocked on any T-Mobile data plan. T-Mobile does not seem to offer metered data plans anymore. There are two ways to get the data service profile on your phone. Manual configuration is probably faster and better.

Automatic

T-Mobile can send the data services profile directly to your phone via SMS. Only the "wireless data" customer service people can send the data services profile to your phone. The regular service people can only send the WAP data profile, which will not work for general use. You will have to be transferred once or twice to reach the wireless data division. Once there, simply request that the data service profile for your plan be sent to your phone. (Of course, you'll need to be signed up for a data plan.) Once you receive the plan information, your phone will ask you where you want to store it. T-Mobile uses profile 1 for the WAP profile, so don't overwrite it. I recommend using profile 2, as it's usually the first empty profile. After storing the data services profile, your phone will probably set it as the default. This will probably cause your WAP (T-Zones/T-Mobile Internet) to fail for your on-phone browser. Set the WAP data profile (profile 1) to default fix this. See the configuration section below for your phone's brand. Setting the default profile is usually fairly obvious once you've reach the data services configuration screen.

Manual

Access the data profiles configuration for your phone's brand using the instructions under the configuration section below. The order and name for settings is for a Samsung T809. These settings are modified from the SMS T-Mobile sends Unlimited Internet VPN plan users. By adding the DNS and proxy information, you can use this profile for either T-Zones or general web browsing. Use the following settings for the Unlimited Internet VPN plan:

  • Name: T-Mobile VPN
  • Home URL: http://www.t-mobile.com
  • Bearer: GPRS only
  • Proxy use: Enable
  • GPRS settings
  • Proxy: 216.155.165.50
  • Proxy Port: 8080
  • DNS1: 216.155.175.105
  • DNS2: 216.155.175.106
  • APN: internet3.voicestream.com
  • Login ID: Empty
  • Password: Empty

Other companies

Call your mobile service provider and request information about data plans. Many charge by the megabyte, but unlimited plans are increasingly available. Most of the instruction for T-Mobile will probably apply.

Configuration

Sony Ericsson GSM

This is from my memory of using a T610, but it should apply to any Sony Ericsson phone. Choose the lower-left icon from the main menu.

Samsung GSM

This is tested on a T809, but should apply to any Samsung GSM phone. Enter code *#87927# from the main screen. Select "Current profile" to choose the default profile. Select "Profile settings" to manage profiles.

LG GSM

This is tested on a CU 320 and works. If you have problems authenticating from the machine, discover it from the phone.

Nokia GSM

This is tested on a 5300 XpressMusic with Vodafone Live The Netherlands. I didn't change any settings on the phone.

Installing Bluetooth and dialup packages

  • If you have the ubuntu-desktop package installed, you can skip to the next section
  • Otherwise, run the following at a shell prompt; this should install the basic Bluetooth and PPP packages
sudo apt-get install bluez-utils bluez-pin ppp 

Listing Bluetooth devices

  • Make your phone Bluetooth discoverable.
  • Run the following at a shell prompt:
hcitool scan
  • Copy the MAC address (the text with the capital letters, numbers, and ':'s) somewhere convenient. You'll need it many times.

Pairing

You can skip this section if you've already paired your phone with your computer. However, consider the final optional step, as your phone might otherwise nag you every time you use if for dialup.

  • Run the following, replacing your-phone-mac-address with the proper data
sudo hcitool cc your-phone-mac-address
  • Run the following, replacing your-phone-mac-address with the proper data
sudo hcitool auth your-phone-mac-address
  • If this command doesn't work, try the pairing instructions on other Bluetooth wiki pages; it seems 5.10 and older have issues with the PIN wrapper
  • Enter a numeric code into the dialog box that pops up. If no dialog box pops up, run the following in another window
sudo passkey-agent --default /usr/bin/bluez-pin
  • Accept the pairing from your phone handset.
  • Enter the same number on your phone
  • Run the hcitool auth your-phone-mac-address command again if it fails
  • You can remove your handset's Bluetooth discoverability now
  • Some phones (notably Samsungs) require further authorization for certain Bluetooth activities, including dialup; consult your phone's user manual to avoid confirming your computer's dialup action on your phone every time

Note: I couldn't pair using the above instructions in Edgy. I had to install bluez-passkey-gnome, launch bt-applet (it's invisible when waiting), then initiate pairing from the phone. Note: I couldn't pair using the above instructions in Feisty. The pairing instead took place when I dialed the connection for the first time. I could not pair from the phone since my computer was hidden.

Configuring the rfcomm device

  • Find the channel number for your phone's dialup service by running the following.
sdptool search DUN
  • Alternatively, get information about all the services on your phone by running this, replacing your-phone-mac-address with the proper data
sdptool browse your-phone-mac-address
  • In either case, look under "Service Name: Dial-up Networking"
  • Under "Protocol Descriptor List:" and "RFCOMM", there should be a number after "Channel:"
  • Remember that number; you'll need it for the rfcomm configuration
  • Run
gksudo gedit /etc/bluetooth/rfcomm.conf
  • Paste the following into the file, replacing your-phone-mac-address and your-phone-rfcomm-channel with appropriate values
rfcomm0 {
	bind yes;
	device your-phone-mac-address;
	channel your-phone-rfcomm-channel;
	comment "Bluetooth PPP Connection";
}
  • Save and close the rfcomm.conf file
  • Run the following, which will create the rfcomm0 device
sudo /etc/init.d/bluez-utils restart

Note that on Edgy, Feisty and Hardy the correct command is:

sudo /etc/init.d/bluetooth restart

Note: On the Nokia N95 (and possibly other Symbian S60 phones) the RFCOMM channel number is not consistent, but seems to change from time to time. If you have a phone that behaves like this, and you find youself unable to connect, you will need to re-run sdptool as described above to see if the channel number has changed. Rather than edit rfcomm.conf (and hence have RFCOMM bind to the channel at startup) you may find it more convenient to bind the RFCOMM channel on the command line:

rfcomm bind 0 your-phone-mac-address your-phone-rfcomm-channel

If you get the wrong channel (or if the wrong channel was bound at startup as a result of rfcomm.conf) then you need to release it before you can bind it again:

rfcomm release 0

Configuring PPP

  • Run the following
gksudo gedit /etc/ppp/peers/BluetoothDialup
  • Paste the following into the file (the file should start out blank)(I found that on my Motorola V360 that I had to comment out #lcp-echo-failure 0 useing T-Mobile.)
debug
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/BluetoothDialup"
usepeerdns
/dev/rfcomm0 115200
defaultroute
crtscts
lcp-echo-failure 0
  • Save and close the BluetoothDialup file
  • Run the following
gksudo gedit /etc/chatscripts/BluetoothDialup
  • Paste the following into the file (the file should start out blank), replacing your-apn-here with the APN from your data services profile and your-data-profile-number-here with the number you stored the profile into on the phone (probably 2).
TIMEOUT	35
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
OK	'AT+CGDCONT=2,"IP","your-apn-here"'
OK	ATD*99***your-data-profile-number-here#
CONNECT ""
  • I had to use "AT+CGDCONT=1" with my Nokia 6120 Classic and O2 Germany

Carrier specific configuration info

Phone specific configuration details

Samsung SGH-X820

This phone seems to have problems with various PPP options. Adding the following options to the relevant file in /etc/ppp/peers seemed to make it work.

nopcomp
noaccomp
nomagic
receive-all
noccp
novj
novjccomp

Authorizing dialout

  • Run the following at a shell prompt, replacing your-username-here with your username:
sudo adduser your-username-here dialout
  • This concludes the one-time setup

Connecting

Begin here on subsequent connections.

  • If you have NetworkManager installed, right-click the applet and uncheck "Enable Wireless"; this will keep it from hopping onto wireless networks and botching your dialup DNS and default route settings

N.b. I do have NetworkManager installed and have found a work-around so that it doesn't mess with my connection over Bluetooth. I have not tried this in an environment where there are multiple WiFi connections _and_ yet I'm still trying to use the phone as a modem. The work-around is to edit the file /etc/network/interfaces and to add a line at the end of the file that reads:

iface hci0 inet static
  • Run the following
pon BluetoothDialup
  • Wait about 30-60 seconds
  • You should now be able to ping ubuntu.com; expect latencies of around one second for most GPRS services
  • If pinging fails, see the troubleshooting section below
  • See the disconnect section below when you're finished using the connection

PPP and TCP/IP troubleshooting

Try these troubleshooting sections in order.

Using the correct data plan

  • Check that you're indeed using a real data profile, as WAP-only profiles generally disallow pinging, instant messaging, file sharing, and some web browsing
  • Try setting the unrestricted data profile as your default data profile on your phone
  • This will only work if the profile has proper DNS settings
  • If you use the T-Mobile automatic profile setup listed above, it will not have proper on-phone DNS settings
  • The manual method will work for T-Zones
  • Use the built-in WAP browser to test the profile
  • If it works, it's probably not your data plan (though it could be); continue troubleshooting below

PPP connection

  • Monitor /var/log/syslog for dialup status information
  • The following indicates PPP success, where xxxs can be anything
xxx localhost pppd[xxx]: Script /etc/ppp/ip-up finished (pid xxx), status = 0x0

Solution if problem

  • Make sure there's not a PPP connection with rfcomm0 already in session; run poff BluetoothDialup to disconnect one in session
  • Find where the error is in either the chatscripts or peers file
  • Consult other help sources and update this page

IP address configuration

  • Run ifconfig to check your PPP connection
  • The ppp0 section should be as below, where xxx is anything
ppp0 Link encap:Point-to-Point Protocol
          inet addr:xxx.xxx.xxx.xxx P-t-P:xxx.xxx.xxx.xxx Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
          RX packets:xxx errors:0 dropped:0 overruns:0 frame:0
          TX packets:xxx errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:xxx
          RX bytes:xxx (xxx b) TX bytes:xxx (xxx b)
  • P-t-P:xxx.xxx.xxx.xxx should match the address on the /var/log/syslog line xxx localhost pppd[xxx]: remote IP address xxx.xxx.xxx.xxx
  • inet addr:xxx.xxx.xxx.xxx should match the address on the /var/log/syslog line xxx localhost pppd[xxx]: local IP address xxx.xxx.xxx.xxx
  • If the addresses match, then your IP address configuration is probably fine

Solution if problem

  • If a /var/log/syslog line seems absent, try reconnecting via poff BluetoothDialup and pon BluetoothDialup
  • Make sure you're using the right data profile on your phone

Default route configuration

  • Ping a valid public hostname on a connected computer, then (if it worked) try pinging the actual IP address from your PPP-connected computer
  • If it didn't work, try pinging a different hostname; some block pings
  • If this works, then your routing table is probably fine
  • Check the routing table by running route -n
  • Your routing table should look like the following, where xxx is anything
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xxx.xxx.xxx * 255.255.255.255 UH 0 0 0 ppp0
default * 0.0.0.0 U 0 0 0 ppp0
  • The xxx.xxx.xxx.xxx should match the P-t-P:xxx.xxx.xxx.xxx in the ifconfig command's ppp0 block above
  • If the routing table checks out, routing is probably not the problem

Solutions if problem

Preferred method: Manually fix routing table

This needs instructions, as it should be the preferred method

Alternate method: Remove other interfaces
  • Run the following
poff BluetoothDialup
  • Remove any non-loopback and ppp0 connections by running the following, replacing your-extra-interface with the appropriate names
sudo ifconfig your-extra-interface down
  • Run the following
pon BluetoothDialup

DNS configuration

  • Try pinging the DNS servers
  • Try running dig hostname-here, where hostname-here is a valid hostname
  • If it resolves, DNS is probably not the problem
  • Check /etc/resolv.conf to check your DNS configuration
  • Your routing table should look like the following, where xxx is anything
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
  • The lines above should match the /var/log/syslog lines like the following
xxx localhost pppd[xxx]: primary DNS address xxx.xxx.xxx.xxx
xxx localhost pppd[xxx]: secondary DNS address xxx.xxx.xxx.xxx

Solution if problem

  • If a /var/log/syslog line seems absent, try reconnecting via poff BluetoothDialup and pon BluetoothDialup
  • Manually configure /etc/resolv.conf to point to your provider's DNS servers (or a public DNS server)
  • Try pinging the manually-configured DNS servers; if it fails only on the Bluetooth dialup machine, double-check the routing configuration

"pon BluetoothDialup" - Does not connect to phone

  • If after following the above steps, if running "pon BluetoothDialup" does not connect to the bluetooth on your phone, then run the following command:
sudo gedit /etc/ppp/peers/provider

Check under

# Serial device to which the modem is connected.

If it is

/dev/modem

change to

/dev/rfcomm0

Then Relase and bind again

rfcomm release 0
rfcomm bind 0 your-phone-mac-address your-phone-rfcomm-channel

Disconnecting

  • Run the following
poff BluetoothDialup

Other useful guides