个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/BluetoothSetup}}
 
{{From|https://help.ubuntu.com/community/BluetoothSetup}}
 
{{Languages|UbuntuHelp:BluetoothSetup}}
 
{{Languages|UbuntuHelp:BluetoothSetup}}
=== Introduction ===
+
== Introduction ==
[http://en.wikipedia.org/wiki/Bluetooth Bluetooth] is finally emerging as a robust and widely supported local area communications technology for short-distance wireless data transfer. Bluetooth is being used for communications with cellphones, cameras, headsets and microphones, keyboards, mice, PDA's and storage devices.
+
[[http://en.wikipedia.org/wiki/Bluetooth|Bluetooth]] is finally emerging as a robust and widely supported local area communications technology for short-distance wireless data transfer. Bluetooth is being used for communications with cellphones, cameras, headsets and microphones, keyboards, mice, PDA's and storage devices.
 
See also [[UbuntuHelp:BluetoothRemoteControl|BluetoothRemoteControl]] and [[UbuntuHelp:BluetoothAudio|BluetoothAudio]] on Ubuntu.
 
See also [[UbuntuHelp:BluetoothRemoteControl|BluetoothRemoteControl]] and [[UbuntuHelp:BluetoothAudio|BluetoothAudio]] on Ubuntu.
 
=== Devices ===
 
=== Devices ===
 
A lot of newer laptops come with Bluetooth support built right in. If you are using a desktop or do not have Bluetooth support built in, you can use a USB Bluetooth dongle to get Bluetooth support.
 
A lot of newer laptops come with Bluetooth support built right in. If you are using a desktop or do not have Bluetooth support built in, you can use a USB Bluetooth dongle to get Bluetooth support.
A list of Bluetooth devices supported under Linux is listed [http://www.holtmann.org/linux/bluetooth/features.html here]. If your device has an HCI version listed, it should work under Linux.
 
 
On some Dell laptops it appears to be necessary to install newest drivers from Dell's support pages in '''Windows''' to get the bluetooth module working under Linux. (At least D430 for with Gutsy / Hardy and D830 and D630 (http://ubuntuforums.org/showthread.php?t=572335 and https://wiki.ubuntu.com/LaptopTestingTeam/DellLatitudeD430#bluetooth)
 
On some Dell laptops it appears to be necessary to install newest drivers from Dell's support pages in '''Windows''' to get the bluetooth module working under Linux. (At least D430 for with Gutsy / Hardy and D830 and D630 (http://ubuntuforums.org/showthread.php?t=572335 and https://wiki.ubuntu.com/LaptopTestingTeam/DellLatitudeD430#bluetooth)
=== Installation and Configuration ===
+
On some Dell laptops which have Dell Wireless 355 Bluetooth card if you turn off the card you have to enable it before you can install it again, this affects both Windows and Linux. You have to use [[http://support.euro.dell.com/support/topics/global.aspx/support/dsn/en/document?docid=2D785CBB1BBFF5F1E040A68F5B282502|an utility]] in Windows to turn it on before you can install its driver again. If you turn the card off in Windows you have to enable it again or Ubuntu won't recognize it.
'''For Gutsy Gibbon (7.10)''' most of the instuctions below are obsolete. For 7.10, just plug in your supported adapter and an icon appears in the top right. Right click to setup your preferences. Devices will auto connect to your PC and you can setup security as you connect each device, eg your phone.
+
== Installation and Configuration ==
To send files to your phone, in synaptic, install gnome-bluetooth. It will be in the accessories menu, click it to run it. Now sending a file is as easy as right clicking the file and select Send-to. To make this run every time you re-boot, select System-->Preferences--Sessions. Add a Startup program. Call it, lets say, "Bluetooth File Transfer" and in the Command box, enter "gnome-obex-server". Click on OK.
+
'''For Gutsy Gibbon (7.10) and above''' most of the instructions below are obsolete. For 7.10, just plug in your supported adapter and an icon appears in the top right. Right click to setup your preferences. Devices will auto connect to your PC and you can setup security as you connect each device, e.g. your phone.
'''Follow the text below for Version 7.04 or earlier''' or for facilities that this small section does not add.
+
To send files to your phone, install the <code><nowiki>gnome-bluetooth</nowiki></code> package. It will then be found in the accessories menu. Now sending a file is as easy as right clicking the file and select Send-to. To make this run every time you re-boot, select System --> Preferences --> Sessions. Add a Startup program. Call it, lets say, "Bluetooth File Transfer" and in the Command box, enter "gnome-obex-server". Click on OK.
 +
=== Bluetooth support for Ubuntu 7.04 and earlier ===
 
Open up a terminal window, and install the requisite packages and their dependencies:
 
Open up a terminal window, and install the requisite packages and their dependencies:
 
<pre><nowiki>
 
<pre><nowiki>
第26行: 第26行:
 
   </nowiki></pre>
 
   </nowiki></pre>
 
Also, view the output of the command '''hcitool dev''' which will give you a listing of Bluetooth devices on your computer.
 
Also, view the output of the command '''hcitool dev''' which will give you a listing of Bluetooth devices on your computer.
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconExample48.png
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconExample48.png%7D%7D
 
'''hcitool dev''' output:
 
'''hcitool dev''' output:
 
<pre><nowiki>
 
<pre><nowiki>
第34行: 第34行:
 
{i} ''Your Bluetooth device will have a different id.''
 
{i} ''Your Bluetooth device will have a different id.''
 
If you get all zeros, then try restarting the bluez-utils service and try again.
 
If you get all zeros, then try restarting the bluez-utils service and try again.
=== Setup Devices ===
+
== Setup Devices ==
==== Find Device Addresses ====
+
=== Find Device Addresses ===
 
To connect to a Bluetooth device, you will need to find the address of the device. Make the device discoverable (look for a "Connect" button on many keyboards and mice or look in the device's manual) and then search for the device with this command:
 
To connect to a Bluetooth device, you will need to find the address of the device. Make the device discoverable (look for a "Connect" button on many keyboards and mice or look in the device's manual) and then search for the device with this command:
 
<pre><nowiki>
 
<pre><nowiki>
第49行: 第49行:
 
   sudo hciconfig hci0 inqmode 0
 
   sudo hciconfig hci0 inqmode 0
 
   </nowiki></pre>
 
   </nowiki></pre>
See bug [https://launchpad.net/ubuntu/+source/gnome-bluetooth/+bug/70718 #70718]. If this helps, you may add the hciconfig command (without "sudo") to your /etc/rc.local file for a permanent workaround.  
+
See bug [[https://launchpad.net/ubuntu/+source/gnome-bluetooth/+bug/70718|#70718]]. If this helps, you may add the hciconfig command (without "sudo") to your /etc/rc.local file for a permanent workaround.  
==== Connect Devices for Current Session Only ====
+
=== Connect Devices for Current Session Only ===
 
To temporarily connect to a device, use this command where 'aa:bb:cc:dd:ee:ff' is the address of the device you want to connect to:
 
To temporarily connect to a device, use this command where 'aa:bb:cc:dd:ee:ff' is the address of the device you want to connect to:
 
<pre><nowiki>
 
<pre><nowiki>
第57行: 第57行:
 
Your device should now be connected for the current session.  
 
Your device should now be connected for the current session.  
 
<!> If you get a <code><nowiki>"Can't create HID control channel: Connection refused"</nowiki></code> error message, most likely the discovery period for the device timed out. Make the device discoverable and enter the above command again, but more quickly.
 
<!> If you get a <code><nowiki>"Can't create HID control channel: Connection refused"</nowiki></code> error message, most likely the discovery period for the device timed out. Make the device discoverable and enter the above command again, but more quickly.
==== Connect Devices at Startup ====
+
=== Connect Devices at Startup ===
 
To connect the device at startup every time, use the following commands to edit the configuration file:
 
To connect the device at startup every time, use the following commands to edit the configuration file:
 
<pre><nowiki>
 
<pre><nowiki>
第86行: 第86行:
 
   </nowiki></pre>
 
   </nowiki></pre>
 
Your Bluetooth devices should now be connected at startup.
 
Your Bluetooth devices should now be connected at startup.
==== Using devices as modems ====
+
=== Using devices as modems ===
 
Refer to page [[UbuntuHelp:BluetoothDialup|BluetoothDialup]]
 
Refer to page [[UbuntuHelp:BluetoothDialup|BluetoothDialup]]
==== Using audio devices ====
+
=== Using audio devices ===
Refer to page [[UbuntuHelp:BluetoothAudio|BluetoothAudio]]
+
* Refer to page [[UbuntuHelp:BluetoothAudio|BluetoothAudio]]
=== Troubleshooting ===
+
* For Bluetooth Headsets specically refer to [[BluetoothHeadset]]
==== "obex://[xx:xx:xx:xx:xx:xx]" is not a valid location. ====
+
== Troubleshooting ==
 +
=== "obex://[xx:xx:xx:xx:xx:xx]" is not a valid location. ===
 
If you get this error on gutsy it seems to be fixed with this command:
 
If you get this error on gutsy it seems to be fixed with this command:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install gnome-vfs-obexftp
 
sudo apt-get install gnome-vfs-obexftp
 
</nowiki></pre>
 
</nowiki></pre>
Although this gives "Couldn't display "obex://[xx:xx:xx:xx:xx:xx]"." for some. See [http://ubuntuforums.org/showthread.php?t=580347 this forum thread] for info. It seems to only be a problem on some phones.
+
Although this gives "Couldn't display "obex://[xx:xx:xx:xx:xx:xx]"." for some. See [[http://ubuntuforums.org/showthread.php?t=580347|this forum thread]] for info. It seems to only be a problem on some phones.
=== Comments ===
+
==== hcitool scan/dev/inq '''Connection timed out''' Error ===
No mention of bluez-gnome??  
+
This can often be fixed by reseting the adapter with the following command:
Also, you may need to reboot your system after installing bluez packages even if your dongle is recognized right after package installation.
+
<pre><nowiki>
 +
sudo hciconfig hci0 reset
 +
  </nowiki></pre>
 +
This should allow the hcitool options to then connect. Many times it still needs to be done even when there is an automatic connection setup in the configuration file.
 +
== Comments ==
 +
No mention of bluez-gnome?  
 +
You may need to reboot your system after installing bluez packages even if your dongle is recognized right after package installation.
 
----
 
----
[[category:CategoryDocumentation]] [[category:CategoryNetworking]] [[category:CategoryBluetooth]]
+
[[category:CategoryBluetooth]] [[category:CategoryNetworking]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年10月19日 (日) 04:25的版本

Introduction

[[1]] is finally emerging as a robust and widely supported local area communications technology for short-distance wireless data transfer. Bluetooth is being used for communications with cellphones, cameras, headsets and microphones, keyboards, mice, PDA's and storage devices. See also BluetoothRemoteControl and BluetoothAudio on Ubuntu.

Devices

A lot of newer laptops come with Bluetooth support built right in. If you are using a desktop or do not have Bluetooth support built in, you can use a USB Bluetooth dongle to get Bluetooth support. On some Dell laptops it appears to be necessary to install newest drivers from Dell's support pages in Windows to get the bluetooth module working under Linux. (At least D430 for with Gutsy / Hardy and D830 and D630 (http://ubuntuforums.org/showthread.php?t=572335 and https://wiki.ubuntu.com/LaptopTestingTeam/DellLatitudeD430#bluetooth) On some Dell laptops which have Dell Wireless 355 Bluetooth card if you turn off the card you have to enable it before you can install it again, this affects both Windows and Linux. You have to use [utility] in Windows to turn it on before you can install its driver again. If you turn the card off in Windows you have to enable it again or Ubuntu won't recognize it.

Installation and Configuration

For Gutsy Gibbon (7.10) and above most of the instructions below are obsolete. For 7.10, just plug in your supported adapter and an icon appears in the top right. Right click to setup your preferences. Devices will auto connect to your PC and you can setup security as you connect each device, e.g. your phone. To send files to your phone, install the gnome-bluetooth package. It will then be found in the accessories menu. Now sending a file is as easy as right clicking the file and select Send-to. To make this run every time you re-boot, select System --> Preferences --> Sessions. Add a Startup program. Call it, lets say, "Bluetooth File Transfer" and in the Command box, enter "gnome-obex-server". Click on OK.

Bluetooth support for Ubuntu 7.04 and earlier

Open up a terminal window, and install the requisite packages and their dependencies:

  sudo apt-get install bluez-utils
  

Then, connect your Bluetooth device if you are using one. Restart the Bluetooth services by doing:

  sudo /etc/init.d/bluez-utils restart (On some machines - 7.04 feisty at least - it may be sudo /etc/init.d/bluetooth restart)
  

Verify that your Bluetooth device has been detected, and the appropriate modules loaded by viewing the lsusb (in case of usb device) output. lsusb output:

  Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
  

Also, view the output of the command hcitool dev which will give you a listing of Bluetooth devices on your computer. {{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconExample48.png%7D%7D hcitool dev output:

  Devices:
	hci0	00:11:95:00:1A:CF
  

{i} Your Bluetooth device will have a different id. If you get all zeros, then try restarting the bluez-utils service and try again.

Setup Devices

Find Device Addresses

To connect to a Bluetooth device, you will need to find the address of the device. Make the device discoverable (look for a "Connect" button on many keyboards and mice or look in the device's manual) and then search for the device with this command:

  sudo hidd --search

(If that command doesn't work, try this one:) 

  hcitool scan
  

Each device should have its own address in a aa:bb:cc:dd:ee:ff format. Hint: If no devices are being shown and you are using Edgy Eft (6.10), you may try

  sudo hciconfig hci0 inqmode 0
  

See bug [[2]]. If this helps, you may add the hciconfig command (without "sudo") to your /etc/rc.local file for a permanent workaround.

Connect Devices for Current Session Only

To temporarily connect to a device, use this command where 'aa:bb:cc:dd:ee:ff' is the address of the device you want to connect to:

  sudo hidd --connect aa:bb:cc:dd:ee:ff
  

Your device should now be connected for the current session. <!> If you get a "Can't create HID control channel: Connection refused" error message, most likely the discovery period for the device timed out. Make the device discoverable and enter the above command again, but more quickly.

Connect Devices at Startup

To connect the device at startup every time, use the following commands to edit the configuration file:

  sudo cp /etc/default/bluetooth /etc/default/bluetooth_backup
  sudo nano /etc/default/bluetooth
  

Look for the following line:

  HIDD_ENABLED=0
  

Change it to:

  HIDD_ENABLED=1
  

Next, look in the same file for a line similar to:

  HIDD_OPTIONS="--master --server"
  

{i} You can leave the "--master" command or remove it, depending on the device. If you have problems with "--master", try removing it or vice versa. Add additional "--connect" arguments for each device that you want connected at startup so that it looks like this:

  HIDD_OPTIONS="--connect aa:bb:cc:dd:ee:ff --connect aa:bb:cc:dd:ee:ff --connect aa:bb:cc:dd:ee:ff --server"
  

Save the file. Finally, add HIDP to /etc/modules:

  echo hidp | sudo tee -a /etc/modules
  

Your Bluetooth devices should now be connected at startup.

Using devices as modems

Refer to page BluetoothDialup

Using audio devices

Troubleshooting

"obex://[xx:xx:xx:xx:xx:xx]" is not a valid location.

If you get this error on gutsy it seems to be fixed with this command:

sudo apt-get install gnome-vfs-obexftp

Although this gives "Couldn't display "obex://[xx:xx:xx:xx:xx:xx]"." for some. See [forum thread] for info. It seems to only be a problem on some phones.

= hcitool scan/dev/inq Connection timed out Error

This can often be fixed by reseting the adapter with the following command:

sudo hciconfig hci0 reset
  

This should allow the hcitool options to then connect. Many times it still needs to be done even when there is an automatic connection setup in the configuration file.

Comments

No mention of bluez-gnome? You may need to reboot your system after installing bluez packages even if your dongle is recognized right after package installation.