/[gentoo]/xml/htdocs/doc/en/bluetooth-guide.xml
Gentoo

Diff of /xml/htdocs/doc/en/bluetooth-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.10
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2 2
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/bluetooth-guide.xml,v 1.2 2005/08/27 09:19:30 swift Exp $ --> 4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/bluetooth-guide.xml,v 1.10 2007/01/14 12:36:10 nightmorph Exp $ -->
5 5
6<guide link="/doc/en/bluetooth-guide.xml"> 6<guide link="/doc/en/bluetooth-guide.xml">
7<title>Gentoo Linux Bluetooth Guide</title> 7<title>Gentoo Linux Bluetooth Guide</title>
8 8
9<author title="Author"> 9<author title="Author">
13 <mail link="puggy@gentoo.org">Douglas Russell</mail> 13 <mail link="puggy@gentoo.org">Douglas Russell</mail>
14</author> 14</author>
15<author title="Contributor"> 15<author title="Contributor">
16 <mail link="marcel@holtmann.org">Marcel Holtmann</mail> 16 <mail link="marcel@holtmann.org">Marcel Holtmann</mail>
17</author> 17</author>
18<author title="Author/Editor"> 18<author title="Author">
19 <mail link="fox2mike@gentoo.org">Shyam Mani</mail> 19 <mail link="fox2mike@gentoo.org">Shyam Mani</mail>
20</author> 20</author>
21<author title="Editor"> 21<author title="Editor">
22 <mail link="rane@gentoo.org">Łukasz Damentko</mail> 22 <mail link="rane@gentoo.org">Łukasz Damentko</mail>
23</author> 23</author>
24 24
25<abstract> 25<abstract>
26This guide will explain how to successfully install a host Bluetooth device, 26This guide will explain how to successfully install a host Bluetooth device,
27configure the kernel properly, explain all the possibilities that the Bluetooth 27configure the kernel properly, explain all the possibilities that the Bluetooth
28interconnection offers and how to have some fun with Bluetooth. 28interconnection offers and how to have some fun with Bluetooth.
29</abstract> 29</abstract>
30 30
31<!-- The content of this document is licensed under the CC-BY-SA license --> 31<!-- The content of this document is licensed under the CC-BY-SA license -->
32<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 32<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
33<license/> 33<license/>
34 34
35<version>1.0</version> 35<version>1.7</version>
36<date>2005-08-25</date> 36<date>2007-01-14</date>
37 37
38<chapter id="introduction"> 38<chapter id="introduction">
39<title>Introduction</title> 39<title>Introduction</title>
40<section> 40<section>
41<title>What is Bluetooth?</title> 41<title>What is Bluetooth?</title>
112want to use modules instead of compiling support built into the kernel. Please, 112want to use modules instead of compiling support built into the kernel. Please,
113refer to the <uri link="/doc/en/usb-guide.xml"> Gentoo Linux USB Guide</uri>. 113refer to the <uri link="/doc/en/usb-guide.xml"> Gentoo Linux USB Guide</uri>.
114</p> 114</p>
115 115
116<pre caption="Configuration for 2.6 kernels"> 116<pre caption="Configuration for 2.6 kernels">
117Device Drivers ---&gt;
118 Networking Support ---&gt; 117Networking ---&gt;
119 118
120&lt;*&gt; Bluetooth subsystem support ---&gt; 119&lt;*&gt; Bluetooth subsystem support ---&gt;
121 120
122--- Bluetooth subsystem support 121--- Bluetooth subsystem support
123&lt;M&gt; L2CAP protocol support 122&lt;M&gt; L2CAP protocol support
142<comment>(The four drivers below are for PCMCIA Bluetooth devices and will only 141<comment>(The four drivers below are for PCMCIA Bluetooth devices and will only
143show up if you have also selected PCMCIA support in your kernel.)</comment> 142show up if you have also selected PCMCIA support in your kernel.)</comment>
144&lt;M&gt; HCI DTL1 (PC Card) driver 143&lt;M&gt; HCI DTL1 (PC Card) driver
145&lt;M&gt; HCI BT3C (PC Card) driver 144&lt;M&gt; HCI BT3C (PC Card) driver
146&lt;M&gt; HCI BlueCard (PC Card) driver 145&lt;M&gt; HCI BlueCard (PC Card) driver
147&lt;M&gt; HCI UART (PC Card) device driver 146&lt;M&gt; HCI UART (PC Card) device driver
148<comment>(The driver below is intended for HCI Emulation software.)</comment> 147<comment>(The driver below is intended for HCI Emulation software.)</comment>
149&lt;M&gt; HCI VHCI (Virtual HCI device) driver 148&lt;M&gt; HCI VHCI (Virtual HCI device) driver
150 149
151<comment>(Move back three levels to Device Drives and then check if USB is 150<comment>(Move back three levels to Device Drives and then check if USB is
152enabled. This is required if you use a Bluetooth dongle, which are mostly USB 151enabled. This is required if you use a Bluetooth dongle, which are mostly USB
178<comment>(One way to check for the device)</comment> 177<comment>(One way to check for the device)</comment>
179# <i>cat /proc/bus/usb/devices | grep -e^[TPD] | grep -e Cls=e0 -B1 -A1</i> 178# <i>cat /proc/bus/usb/devices | grep -e^[TPD] | grep -e Cls=e0 -B1 -A1</i>
180<comment>(The Cls=e0(unk. ) identifies the Bluetooth adapter.)</comment> 179<comment>(The Cls=e0(unk. ) identifies the Bluetooth adapter.)</comment>
181T: Bus=02 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0 180T: Bus=02 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0
182D: Ver= 1.10 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 181D: Ver= 1.10 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
183P: Vendor=0a12 ProdID=0001 Rev= 5.25 182P: Vendor=0a12 ProdID=0001 Rev= 5.25
184<comment>(Some might show up on lsusb from sys-apps/usbutils)</comment> 183<comment>(Some might show up on lsusb from sys-apps/usbutils)</comment>
185# <i>lsusb</i> 184# <i>lsusb</i>
186Bus 003 Device 002: ID 046d:c00e Logitech, Inc. Optical Mouse 185Bus 003 Device 002: ID 046d:c00e Logitech, Inc. Optical Mouse
187Bus 003 Device 001: ID 0000:0000 186Bus 003 Device 001: ID 0000:0000
188Bus 002 Device 002: ID 0db0:1967 Micro Star International Bluetooth Dongle 187Bus 002 Device 002: ID 0db0:1967 Micro Star International Bluetooth Dongle
209<pre caption="Installing bluez-libs and bluez-utils"> 208<pre caption="Installing bluez-libs and bluez-utils">
210# <i>emerge net-wireless/bluez-libs net-wireless/bluez-utils</i> 209# <i>emerge net-wireless/bluez-libs net-wireless/bluez-utils</i>
211</pre> 210</pre>
212 211
213<warn> 212<warn>
214Do not emerge <c>bluez-kernel</c> or <c>bluez-sdp</c> as they will break 213Do not emerge <c>bluez-sdp</c> as it will break <c>bluez-utils</c>!
215<c>bluez-utils</c>!
216</warn> 214</warn>
217 215
218<p> 216<p>
219Additionally, as we have compiled the Bluetooth subsystem as modules, we will 217Additionally, as we have compiled the Bluetooth subsystem as modules, we will
220need hotplug and coldplug, which are explained in the <uri 218need hotplug and coldplug, which are explained in the <uri
224 222
225<pre caption="Emerging hotplug and coldplug"> 223<pre caption="Emerging hotplug and coldplug">
226# <i>emerge hotplug coldplug</i> 224# <i>emerge hotplug coldplug</i>
227# <i>rc-update add coldplug boot</i> 225# <i>rc-update add coldplug boot</i>
228</pre> 226</pre>
227
228<note>
229You no longer need to emerge <c>coldplug</c> if you're using <c>udev</c> version
230103 and higher, as udev itself will handle module loading. If you are upgrading
231to version 103, you must unmerge coldplug (<c>emerge -aC coldplug</c>) before
232upgrading udev. Be sure to remove the coldplug init script from all runlevels
233(<c>rc-update del coldplug</c>), and then delete it from
234<path>/etc/init.d/</path> afterward.
235</note>
229 236
230</body> 237</body>
231</section> 238</section>
232<section> 239<section>
233<title>BlueZ configuration and PIN pairing</title> 240<title>BlueZ configuration and PIN pairing</title>
249# <i>hciconfig</i> 256# <i>hciconfig</i>
250hci0: Type: USB 257hci0: Type: USB
251 BD Address: 00:01:02:03:04:05 ACL MTU: 192:8 SCO MTU: 64:8 258 BD Address: 00:01:02:03:04:05 ACL MTU: 192:8 SCO MTU: 64:8
252 DOWN 259 DOWN
253 RX bytes:131 acl:0 sco:0 events:18 errors:0 260 RX bytes:131 acl:0 sco:0 events:18 errors:0
254 TX bytes:565 acl:0 sco:0 commands:17 errors:0 261 TX bytes:565 acl:0 sco:0 commands:17 errors:0
255</pre> 262</pre>
256 263
257<p> 264<p>
258This shows that the Bluetooth device has been recognised. As you might have 265This shows that the Bluetooth device has been recognised. As you might have
259noticed the device is <e>DOWN</e>. Let's configure it so that we can bring it 266noticed the device is <e>DOWN</e>. Let's configure it so that we can bring it
262please refer to <c>man hcid.conf</c>. 269please refer to <c>man hcid.conf</c>.
263</p> 270</p>
264 271
265<pre caption="Editing /etc/bluetooth/hcid.conf"> 272<pre caption="Editing /etc/bluetooth/hcid.conf">
266<comment>(Recommended changes to be made to the file are shown)</comment> 273<comment>(Recommended changes to be made to the file are shown)</comment>
274
275# HCId options
276options {
277 # Automatically initialize new devices
278 autoinit yes;
267 279
268<comment>(Change security to "auto")</comment> 280<comment>(Change security to "auto")</comment>
269 # Security Manager mode 281 # Security Manager mode
270 # none - Security manager disabled 282 # none - Security manager disabled
271 # auto - Use local PIN for incoming connections 283 # auto - Use local PIN for incoming connections
272 # user - Always ask user for a PIN 284 # user - Always ask user for a PIN
273 # 285 #
274 security auto; 286 security auto;
275 287
288 # Pairing mode
289 pairing multi;
290
276<comment>(Change pin_helper to use /etc/bluetooth/pin-helper)</comment> 291<comment>(Change pin_helper to use /etc/bluetooth/pin-helper)</comment>
277 # PIN helper 292 # PIN helper
278 pin_helper /etc/bluetooth/pin-helper; 293 pin_helper /etc/bluetooth/pin-helper;
294}
279 295
296# Default settings for HCI devices
297device {
280<comment>(Set your device name here, you can call it anything you want)</comment> 298<comment>(Set your device name here, you can call it anything you want)</comment>
281 # Local device name 299 # Local device name
282 # %d - device id 300 # %d - device id
283 # %h - host name 301 # %h - host name
284 name "BlueZ at %h (%d)"; 302 name "BlueZ at %h (%d)";
303
304 # Local device class
305 class 0x3e0100;
306
307 # Inquiry and Page scan
308 iscan enable; pscan enable;
309
310 # Default link mode
311 lm accept;
312
313 # Default link policy
314 lp rswitch,hold,sniff,park;
285 315
286<comment>(Leave as is, if you don't know what exactly these do)</comment> 316<comment>(Leave as is, if you don't know what exactly these do)</comment>
287 # Authentication and Encryption (Security Mode 3) 317 # Authentication and Encryption (Security Mode 3)
288 #auth enable; 318 #auth enable;
289 #encrypt enable; 319 #encrypt enable;
334</pre> 364</pre>
335 365
336<p> 366<p>
337Let's be sure that the Bluetooth daemons started correctly. If we can see that 367Let's be sure that the Bluetooth daemons started correctly. If we can see that
338both <c>hcid</c> and <c>sdpd</c> are running, then we configured Bluetooth the 368both <c>hcid</c> and <c>sdpd</c> are running, then we configured Bluetooth the
339right way. After that, we can see if the decices are now up and running with 369right way. After that, we can see if the devices are now up and running with
340the configured options. 370the configured options.
341</p> 371</p>
342 372
343<pre caption="Checking whether Bluetooth daemons started correctly"> 373<pre caption="Checking whether Bluetooth daemons started correctly">
344<comment>(Check to see if the services are running)</comment> 374<comment>(Check to see if the services are running)</comment>
34826054 ? 00:00:00 sdpd 37826054 ? 00:00:00 sdpd
349 379
350# <i>hciconfig -a</i> 380# <i>hciconfig -a</i>
351hci0: Type: USB 381hci0: Type: USB
352 BD Address: 00:0A:0B:0C:0D:0E ACL MTU: 192:8 SCO MTU: 64:8 382 BD Address: 00:0A:0B:0C:0D:0E ACL MTU: 192:8 SCO MTU: 64:8
353 UP RUNNING PSCAN ISCAN AUTH ENCRYPT 383 UP RUNNING PSCAN ISCAN
354 RX bytes:125 acl:0 sco:0 events:17 errors:0 384 RX bytes:125 acl:0 sco:0 events:17 errors:0
355 TX bytes:565 acl:0 sco:0 commands:17 errors:0 385 TX bytes:565 acl:0 sco:0 commands:17 errors:0
356 Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00 386 Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
357 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 387 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
358 Link policy: RSWITCH HOLD SNIFF PARK 388 Link policy: RSWITCH HOLD SNIFF PARK
389</pre> 419</pre>
390 420
391<pre caption="Scanning for remote devices"> 421<pre caption="Scanning for remote devices">
392# <i>hcitool scan</i> 422# <i>hcitool scan</i>
393Scanning ... 423Scanning ...
394 00:0A:0B:0C:0D:0E Grayhat 424 00:0A:0B:0C:0D:0E Grayhat
395</pre> 425</pre>
396 426
397<pre caption="Inquiring remote devices"> 427<pre caption="Inquiring remote devices">
398# <i>hcitool inq</i> 428# <i>hcitool inq</i>
399Inquiring ... 429Inquiring ...
400 00:0A:0B:0C:0D:0E clock offset: 0x5579 class: 0x72010c 430 00:0A:0B:0C:0D:0E clock offset: 0x5579 class: 0x72010c
401</pre> 431</pre>
402 432
403<p> 433<p>
404Now that we now the MAC address of the remote Bluetooth devices, we can check 434Now that we know the MAC address of the remote Bluetooth devices, we can check
405if we paired them correctly. 435if we paired them correctly.
406</p> 436</p>
407 437
408<pre caption="Running l2ping"> 438<pre caption="Running l2ping">
409# <i>l2ping 00:0A:0B:0C:0D:0E</i> 439# <i>l2ping 00:0A:0B:0C:0D:0E</i>
410Ping: 00:0A:0B:0C:0D:0E from 00:01:02:03:04:05 (data size 20) ... 440Ping: 00:0A:0B:0C:0D:0E from 00:01:02:03:04:05 (data size 20) ...
41120 bytes from 00:0A:0B:0C:0D:0E id 200 time 69.85ms 44120 bytes from 00:0A:0B:0C:0D:0E id 200 time 69.85ms
41220 bytes from 00:0A:0B:0C:0D:0E id 201 time 9.97ms 44220 bytes from 00:0A:0B:0C:0D:0E id 201 time 9.97ms
41320 bytes from 00:0A:0B:0C:0D:0E id 202 time 56.86ms 44320 bytes from 00:0A:0B:0C:0D:0E id 202 time 56.86ms
41420 bytes from 00:0A:0B:0C:0D:0E id 203 time 39.92ms 44420 bytes from 00:0A:0B:0C:0D:0E id 203 time 39.92ms
4154 sent, 4 received, 0% loss 4454 sent, 4 received, 0% loss
416</pre> 446</pre>
417 447
418</body> 448</body>
419</section> 449</section>
420<section> 450<section>
448 478
449 # Bluetooth address of the device 479 # Bluetooth address of the device
450 <comment>(Enter the address of the device you want to connect to)</comment> 480 <comment>(Enter the address of the device you want to connect to)</comment>
451 device 00:0A:0B:0C:0D:0E; 481 device 00:0A:0B:0C:0D:0E;
452 482
453} 483}
454</pre> 484</pre>
455 485
456<p> 486<p>
457After configuring RFCOMM, we can connect to any device. Since we've made the 487After configuring RFCOMM, we can connect to any device. Since we've made the
458required settings to the <path>/etc/bluetooth/rfcomm.conf</path> file, we just 488required settings to the <path>/etc/bluetooth/rfcomm.conf</path> file, we just
482CTRL+C. 512CTRL+C.
483</p> 513</p>
484 514
485<pre caption="Listening for incoming RFCOMM connections"> 515<pre caption="Listening for incoming RFCOMM connections">
486# <i>rfcomm listen 0 1</i> 516# <i>rfcomm listen 0 1</i>
487Waiting for connection on channel 1 517Waiting for connection on channel 1
488</pre> 518</pre>
489 519
490<p> 520<p>
491In a similar way to the connect command, the listen command can receive two 521In a similar way to the connect command, the listen command can receive two
492parameters. The first one explicits the RFCOMM TTY device node (usually 0) that 522parameters. The first one explicits the RFCOMM TTY device node (usually 0) that
493will be used to accept a connection, while the second is the channel that will 523will be used to accept a connection, while the second is the channel that will
494be used. 524be used.
495</p> 525</p>
496 526
497<p> 527<p>
498Each time you call the <c>rfcomm</c> command, you can also specify the physical 528Each time you call the <c>rfcomm</c> command, you can also specify the physical
499device you want to use. Below you can see a small example specifiying the 529device you want to use. Below you can see a small example specifiying the
557<pre caption="bnep IP address configuration"> 587<pre caption="bnep IP address configuration">
558host0 #<i> ifconfig bnep0 192.168.2.1</i> 588host0 #<i> ifconfig bnep0 192.168.2.1</i>
559host1 #<i> ifconfig bnep0 192.168.2.2</i> 589host1 #<i> ifconfig bnep0 192.168.2.2</i>
560 590
561host0 #<i> ifconfig bnep0</i> 591host0 #<i> ifconfig bnep0</i>
562bnep0 Link encap:Ethernet HWaddr 00:0A:0B:0C:0D:0E 592bnep0 Link encap:Ethernet HWaddr 00:0A:0B:0C:0D:0E
563 inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0 593 inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
564 inet6 addr: fe80::210:60ff:fea3:cb41/64 Scope:Link 594 inet6 addr: fe80::210:60ff:fea3:cb41/64 Scope:Link
565 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 595 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
566 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 596 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
567 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 597 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
568 collisions:0 txqueuelen:1000 598 collisions:0 txqueuelen:1000
569 RX bytes:208 (208.0 b) TX bytes:188 (188.0 b) 599 RX bytes:208 (208.0 b) TX bytes:188 (188.0 b)
570 600
571host1 #<i> ifconfig bnep0</i> 601host1 #<i> ifconfig bnep0</i>
572bnep0 Link encap:Ethernet HWaddr 00:01:02:03:04:05 602bnep0 Link encap:Ethernet HWaddr 00:01:02:03:04:05
573 inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0 603 inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
574 inet6 addr: fe80::210:60ff:fea2:dd2a/64 Scope:Link 604 inet6 addr: fe80::210:60ff:fea2:dd2a/64 Scope:Link
575 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 605 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
576 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 606 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
577 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 607 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
58964 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=34.0 ms 61964 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=34.0 ms
59064 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=37.3 ms 62064 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=37.3 ms
591 621
592--- 192.168.2.1 ping statistics --- 622--- 192.168.2.1 ping statistics ---
5932 packets transmitted, 2 received, 0% packet loss, time 1000ms 6232 packets transmitted, 2 received, 0% packet loss, time 1000ms
594rtt min/avg/max/mdev = 34.045/35.690/37.336/1.656 ms 624rtt min/avg/max/mdev = 34.045/35.690/37.336/1.656 ms
595</pre> 625</pre>
596 626
597</body> 627</body>
598</section> 628</section>
599</chapter> 629</chapter>
635This adds menu entries under Applications &gt; System Tools from where you can 665This adds menu entries under Applications &gt; System Tools from where you can
636easily start up the manager or File sharing to transfer files between devices. 666easily start up the manager or File sharing to transfer files between devices.
637</p> 667</p>
638 668
639<p> 669<p>
640To transfer files (the easy way): 670To transfer files (the easy way):
641</p> 671</p>
642 672
643<ul> 673<ul>
644 <li> 674 <li>
645 From the Phone to the Computer - Send the file from the phone via Bluetooth 675 From the Phone to the Computer - Send the file from the phone via Bluetooth
721 backing up this information and restoring it later, and syncing with the 751 backing up this information and restoring it later, and syncing with the
722 Evolution e-mail client. You will need the <c>irmc</c> USE flag set to 752 Evolution e-mail client. You will need the <c>irmc</c> USE flag set to
723 ensure that <c>multisync</c> has Bluetooth support. 753 ensure that <c>multisync</c> has Bluetooth support.
724 </li> 754 </li>
725 <li> 755 <li>
726 <c>media-plugins/xmms-btexmms</c>: Btexmms is an XMMS plugin that allows 756 <c>net-wireless/opd</c> and <c>net-wireless/ussp-push</c> are command line
727 you to use your Bluetooth-enabled (Sony) Ericsson mobile phone as a remote 757 tools (server and client) that can be used to send files to your mobile
728 control for XMMS. 758 phone.
729 </li> 759 </li>
730</ul> 760</ul>
731 761
732</body> 762</body>
733</section> 763</section>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20