BluetoothSetup
|
Size: 3309
Comment: add category doc
|
Size: 5052
Comment: Corrected page name for Bluetooth Remote functionality
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| = Bluetooth on Ubuntu = | ||<tablestyle="float:right; font-size: 0.9em; width:40%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;">'''Contents'''[[BR]][[TableOfContents(2)]]|| |
| Line 5: | Line 8: |
| 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 BluetoothRemoteControl on Ubuntu. |
| Line 9: | Line 14: |
| Most of the 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. | Most of the 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. |
| Line 11: | Line 16: |
| 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. | 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. |
| Line 15: | Line 20: |
| 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: |
| Line 17: | Line 22: |
| {{{ sudo apt-get install bluez-utils }}} |
{{{ sudo apt-get install bluez-utils }}} |
| Line 21: | Line 26: |
| Then, connect your Bluetooth device if you are using one. Then restart the Bluetooth services by doing | Then, connect your Bluetooth device if you are using one. Restart the Bluetooth services by doing: |
| Line 23: | Line 28: |
| {{{ sudo /etc/init.d/bluez-utils restart }}} |
{{{ sudo /etc/init.d/bluez-utils restart }}} |
| Line 27: | Line 32: |
| Verify that your bluetooth device has been detected, and the appropriate modules loaded by viewing the lsusb (in case of usb device) output. | Verify that your bluetooth device has been detected, and the appropriate modules loaded by viewing the lsusb (in case of usb device) output. |
| Line 29: | Line 34: |
| lsusb output: {{{ Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) }}} |
lsusb output: {{{ Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) }}} |
| Line 34: | Line 39: |
| 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. |
| Line 36: | Line 41: |
| hcitool output: {{{ Devices: |
attachment:IconsPage/IconExample48.png hcitool output: {{{ Devices: |
| Line 40: | Line 46: |
| }}} | }}} |
| Line 42: | Line 48: |
| Your bluetooth device will have a different id. If you get all zeros, then try restarting the bluez-utils service and try again. | {i} ''Your bluetooth device will have a different id.'' If you get all zeros, then try restarting the bluez-utils service and try again. |
| Line 48: | Line 56: |
| 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: |
| Line 50: | Line 58: |
| {{{ sudo hidd --search }}} |
{{{ sudo hidd --search }}} |
| Line 54: | Line 62: |
| Each device should have its own address in a aa:bb:cc:dd:ee:ff format. | Each device should have its own address in a aa:bb:cc:dd:ee:ff format. |
| Line 58: | Line 66: |
| 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: |
| Line 60: | Line 68: |
| {{{ sudo hidd --connect aa:bb:cc:dd:ee:ff }}} |
{{{ sudo hidd --connect aa:bb:cc:dd:ee:ff }}} |
| Line 64: | Line 72: |
| Your device should now be connected for the current session. | 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. |
| Line 68: | Line 78: |
| 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: |
| Line 70: | Line 80: |
| {{{ sudo cp /etc/default/bluez-utils /etc/default/bluez-utils_backup sudo nano /etc/default/bluez-utils }}} |
{{{ sudo cp /etc/default/bluez-utils /etc/default/bluez-utils_backup sudo nano /etc/default/bluez-utils }}} |
| Line 75: | Line 85: |
| Look for the following line: | Look for the following line: |
| Line 77: | Line 87: |
| {{{ HIDD_ENABLED=0 }}} |
{{{ HIDD_ENABLED=0 }}} |
| Line 81: | Line 91: |
| Change it to: | Change it to: |
| Line 83: | Line 93: |
| {{{ HIDD_ENABLED=1 }}} |
{{{ HIDD_ENABLED=1 }}} |
| Line 87: | Line 97: |
| Next, look in the same file for a line similar to: | Next, look in the same file for a line similar to: |
| Line 89: | Line 99: |
| {{{ HIDD_OPTIONS="--connect AA:BB:CC:DD:EE:FF --server" }}} |
{{{ HIDD_OPTIONS="--master --server" }}} |
| Line 93: | Line 103: |
| Add additional "connect" arguments for each device that you want connected at startup so that it looks like this: | {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. |
| Line 95: | Line 105: |
| {{{ HIDD_OPTIONS="--connect AA:BB:CC:DD:EE:FF --connect AA:BB:CC:DD:EE:FF --connect AA:BB:CC:DD:EE:FF --server" }}} |
Add additional "--connect" arguments for each device that you want connected at startup so that it looks like this: |
| Line 99: | Line 107: |
| Save the file. | {{{ HIDD_OPTIONS="--connect aa:bb:cc:dd:ee:ff --connect aa:bb:cc:dd:ee:ff --connect aa:bb:cc:dd:ee:ff --server" }}} |
| Line 101: | Line 111: |
| Finally, add HIDP to /etc/modules: | Save the file. |
| Line 103: | Line 113: |
| {{{ echo hidp | sudo tee -a /etc/modules }}} |
Finally, add HIDP to /etc/modules: |
| Line 107: | Line 115: |
| Your Bluetooth devices should now be connected at startup. | {{{ echo hidp | sudo tee -a /etc/modules }}} Your Bluetooth devices should now be connected at startup. === Connect devices automatically OR initiate connection from device when in range === '''Note:''' This is related to using your bluetooth enabled phones as modems. This interferes with gnome-phone-manager and BluetoothRemoteControl functionality. [[BR]][[BR]] Setup rfcomm:- There is a good HOWTO at http://www.geocities.com/saravkrish/progs/bluemote/bluetooth.html [[BR]][[BR]] Edit bluez-utils script {{{ sudo vi /etc/init.d/bluez-utils }}} At the end of 'start' block add 'rfcomm bind all' {{{ case "$1" in start) .. .. .. log_end_msg 0 rfcomm bind all #Added for auto connect ;; }}} At the end of 'stop' block add 'rfcomm release all' {{{ stop) .. .. .. log_end_msg 0 rfcomm release all #Added for auto connect ;; }}} Save the file and restart bluetooth services. {{{ sudo /etc/init.d/bluez-utils restart }}} |
| Line 110: | Line 161: |
| CategoryDocumentation CategoryCleanup | CategoryDocumentation CategoryNetworking |
ContentsBRTableOfContents(2) |
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.
See also BluetoothRemoteControl on Ubuntu.
Devices
- Most of the 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.
Installation and Configuration
- 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
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.
attachment:IconsPage/IconExample48.png
- hcitool output:
Devices: hci0 00:11:95:00:1A:CF
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
Each device should have its own address in a aa:bb:cc:dd:ee:ff format.
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/bluez-utils /etc/default/bluez-utils_backup sudo nano /etc/default/bluez-utils
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"
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.
Connect devices automatically OR initiate connection from device when in range
Note: This is related to using your bluetooth enabled phones as modems. This interferes with gnome-phone-manager and BluetoothRemoteControl functionality. BRBR Setup rfcomm:-
There is a good HOWTO at http://www.geocities.com/saravkrish/progs/bluemote/bluetooth.html BRBR Edit bluez-utils script
sudo vi /etc/init.d/bluez-utils
At the end of 'start' block add 'rfcomm bind all'case "$1" in start) .. .. .. log_end_msg 0 rfcomm bind all #Added for auto connect ;;At the end of 'stop' block add 'rfcomm release all'stop) .. .. .. log_end_msg 0 rfcomm release all #Added for auto connect ;;Save the file and restart bluetooth services.sudo /etc/init.d/bluez-utils restart
BluetoothSetup (last edited 2008-08-06 16:14:28 by localhost)