| 1 | <?xml version='1.0' encoding="UTF-8"?> |
1 | <?xml version='1.0' encoding="UTF-8"?> |
| 2 | |
|
|
| 3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
2 | <!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 $ --> |
3 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/bluetooth-guide.xml,v 1.16 2009/07/16 23:02:01 nightmorph Exp $ --> |
| 5 | |
4 | |
| 6 | <guide link="/doc/en/bluetooth-guide.xml"> |
5 | <guide link="/doc/en/bluetooth-guide.xml"> |
| 7 | <title>Gentoo Linux Bluetooth Guide</title> |
6 | <title>Gentoo Linux Bluetooth Guide</title> |
| 8 | |
7 | |
| 9 | <author title="Author"> |
8 | <author title="Author"> |
| … | |
… | |
| 13 | <mail link="puggy@gentoo.org">Douglas Russell</mail> |
12 | <mail link="puggy@gentoo.org">Douglas Russell</mail> |
| 14 | </author> |
13 | </author> |
| 15 | <author title="Contributor"> |
14 | <author title="Contributor"> |
| 16 | <mail link="marcel@holtmann.org">Marcel Holtmann</mail> |
15 | <mail link="marcel@holtmann.org">Marcel Holtmann</mail> |
| 17 | </author> |
16 | </author> |
| 18 | <author title="Author/Editor"> |
17 | <author title="Author"> |
| 19 | <mail link="fox2mike@gentoo.org">Shyam Mani</mail> |
18 | <mail link="fox2mike@gentoo.org">Shyam Mani</mail> |
| 20 | </author> |
19 | </author> |
| 21 | <author title="Editor"> |
20 | <author title="Editor"> |
| 22 | <mail link="rane@gentoo.org">Łukasz Damentko</mail> |
21 | <mail link="rane@gentoo.org">Łukasz Damentko</mail> |
| 23 | </author> |
22 | </author> |
|
|
23 | <author title="Editor"> |
|
|
24 | <mail link="nightmorph"/> |
|
|
25 | </author> |
| 24 | |
26 | |
| 25 | <abstract> |
27 | <abstract> |
| 26 | This guide will explain how to successfully install a host Bluetooth device, |
28 | This guide will explain how to successfully install a host Bluetooth device, |
| 27 | configure the kernel properly, explain all the possibilities that the Bluetooth |
29 | configure the kernel properly, explain all the possibilities that the Bluetooth |
| 28 | interconnection offers and how to have some fun with Bluetooth. |
30 | interconnection offers and how to have some fun with Bluetooth. |
| 29 | </abstract> |
31 | </abstract> |
| 30 | |
32 | |
| 31 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
33 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
| 32 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
34 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
| 33 | <license/> |
35 | <license/> |
| 34 | |
36 | |
| 35 | <version>1.0</version> |
37 | <version>1.11</version> |
| 36 | <date>2005-08-25</date> |
38 | <date>2009-07-16</date> |
| 37 | |
39 | |
| 38 | <chapter id="introduction"> |
40 | <chapter id="introduction"> |
| 39 | <title>Introduction</title> |
41 | <title>Introduction</title> |
| 40 | <section> |
42 | <section> |
| 41 | <title>What is Bluetooth?</title> |
43 | <title>What is Bluetooth?</title> |
| … | |
… | |
| 54 | <section> |
56 | <section> |
| 55 | <title>About the content of this guide</title> |
57 | <title>About the content of this guide</title> |
| 56 | <body> |
58 | <body> |
| 57 | |
59 | |
| 58 | <p> |
60 | <p> |
| 59 | The first part of this guide is to identify qualified and non-qualified devices |
61 | The first part of this guide explains how to configure the system kernel, |
| 60 | that support the Bluetooth technology. This way, users can purchase Bluetooth |
|
|
| 61 | devices that are known to work. After that, the guide explains how to configure |
|
|
| 62 | the system kernel, identify the Bluetooth devices installed on the system and |
62 | identify the Bluetooth devices installed on the system and detected by the |
| 63 | detected by the kernel and install the necessary basic Bluetooth tools. |
63 | kernel and install the necessary basic Bluetooth tools. |
| 64 | </p> |
64 | </p> |
| 65 | |
65 | |
| 66 | <p> |
66 | <p> |
| 67 | The second part covers how to detect remote devices and how to establish a |
67 | The second part covers how to detect remote devices and how to establish a |
| 68 | connection from or to them by either setting up radio frequency communication |
68 | connection from or to them by either setting up radio frequency communication |
| 69 | (RFCOMM) or by setting up a personal area network (PAN). |
69 | (RFCOMM)<!-- or by setting up a personal area network (PAN)-->. |
| 70 | </p> |
70 | </p> |
| 71 | |
71 | |
| 72 | <p> |
72 | <p> |
| 73 | The last part of the guide lists in detail applications that can take |
73 | The last part of the guide lists in detail applications that can take |
| 74 | advantage of all the possibilities offered by the Bluetooth technology. |
74 | advantage of all the possibilities offered by the Bluetooth technology. |
| … | |
… | |
| 76 | |
76 | |
| 77 | </body> |
77 | </body> |
| 78 | </section> |
78 | </section> |
| 79 | </chapter> |
79 | </chapter> |
| 80 | |
80 | |
| 81 | <chapter id="devices"> |
|
|
| 82 | <title>Supported Devices</title> |
|
|
| 83 | <section> |
|
|
| 84 | <title>Qualified and non-qualified devices that support Bluetooth</title> |
|
|
| 85 | <body> |
|
|
| 86 | |
|
|
| 87 | <impo> |
|
|
| 88 | These products might work even though some are not qualified Bluetooth |
|
|
| 89 | products. Gentoo does not support them in any way, they might just work. |
|
|
| 90 | </impo> |
|
|
| 91 | |
|
|
| 92 | <p> |
|
|
| 93 | A list of the currently supported devices can be found at: <uri |
|
|
| 94 | link="http://www.holtmann.org/linux/bluetooth/features.html">Bluetooth device |
|
|
| 95 | features and revision information by Marcel Holtmann</uri>. |
|
|
| 96 | </p> |
|
|
| 97 | |
|
|
| 98 | </body> |
|
|
| 99 | </section> |
|
|
| 100 | </chapter> |
|
|
| 101 | |
|
|
| 102 | <chapter id="kernel"> |
81 | <chapter id="kernel"> |
| 103 | <title>Configuring the system</title> |
82 | <title>Configuring the system</title> |
| 104 | <section> |
83 | <section> |
| 105 | <title>Kernel Configuration</title> |
84 | <title>Kernel Configuration</title> |
| 106 | <body> |
85 | <body> |
| 107 | |
86 | |
| 108 | <p> |
87 | <p> |
| 109 | As the latest Linux stable kernel is 2.6, the configuration will be done for |
88 | As the latest Linux stable kernel is 2.6, the configuration will be done for |
| 110 | these series of the kernel. Most Bluetooth devices are connected to a USB port, |
89 | these series of the kernel. Most Bluetooth devices are connected to a USB port, |
| 111 | so USB will be enabled too. If you want, you can use hotplugging in case you |
90 | so USB will be enabled too. Please refer to the <uri |
| 112 | want to use modules instead of compiling support built into the kernel. Please, |
|
|
| 113 | refer to the <uri link="/doc/en/usb-guide.xml"> Gentoo Linux USB Guide</uri>. |
91 | link="/doc/en/usb-guide.xml">Gentoo Linux USB Guide</uri>. |
| 114 | </p> |
92 | </p> |
| 115 | |
93 | |
| 116 | <pre caption="Configuration for 2.6 kernels"> |
94 | <pre caption="Configuration for 2.6 kernels"> |
| 117 | Device Drivers ---> |
|
|
| 118 | Networking Support ---> |
95 | Networking ---> |
| 119 | |
96 | |
| 120 | <*> Bluetooth subsystem support ---> |
97 | <*> Bluetooth subsystem support ---> |
| 121 | |
98 | |
| 122 | --- Bluetooth subsystem support |
99 | --- Bluetooth subsystem support |
| 123 | <M> L2CAP protocol support |
100 | <M> L2CAP protocol support |
| … | |
… | |
| 142 | <comment>(The four drivers below are for PCMCIA Bluetooth devices and will only |
119 | <comment>(The four drivers below are for PCMCIA Bluetooth devices and will only |
| 143 | show up if you have also selected PCMCIA support in your kernel.)</comment> |
120 | show up if you have also selected PCMCIA support in your kernel.)</comment> |
| 144 | <M> HCI DTL1 (PC Card) driver |
121 | <M> HCI DTL1 (PC Card) driver |
| 145 | <M> HCI BT3C (PC Card) driver |
122 | <M> HCI BT3C (PC Card) driver |
| 146 | <M> HCI BlueCard (PC Card) driver |
123 | <M> HCI BlueCard (PC Card) driver |
| 147 | <M> HCI UART (PC Card) device driver |
124 | <M> HCI UART (PC Card) device driver |
| 148 | <comment>(The driver below is intended for HCI Emulation software.)</comment> |
125 | <comment>(The driver below is intended for HCI Emulation software.)</comment> |
| 149 | <M> HCI VHCI (Virtual HCI device) driver |
126 | <M> HCI VHCI (Virtual HCI device) driver |
| 150 | |
127 | |
| 151 | <comment>(Move back three levels to Device Drives and then check if USB is |
128 | <comment>(Move back three levels to Device Drives and then check if USB is |
| 152 | enabled. This is required if you use a Bluetooth dongle, which are mostly USB |
129 | enabled. This is required if you use a Bluetooth dongle, which are mostly USB |
| … | |
… | |
| 178 | <comment>(One way to check for the device)</comment> |
155 | <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> |
156 | # <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> |
157 | <comment>(The Cls=e0(unk. ) identifies the Bluetooth adapter.)</comment> |
| 181 | T: Bus=02 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0 |
158 | T: Bus=02 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0 |
| 182 | D: Ver= 1.10 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 |
159 | D: Ver= 1.10 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 |
| 183 | P: Vendor=0a12 ProdID=0001 Rev= 5.25 |
160 | P: Vendor=0a12 ProdID=0001 Rev= 5.25 |
| 184 | <comment>(Some might show up on lsusb from sys-apps/usbutils)</comment> |
161 | <comment>(Some might show up on lsusb from sys-apps/usbutils)</comment> |
| 185 | # <i>lsusb</i> |
162 | # <i>lsusb</i> |
| 186 | Bus 003 Device 002: ID 046d:c00e Logitech, Inc. Optical Mouse |
163 | Bus 003 Device 002: ID 046d:c00e Logitech, Inc. Optical Mouse |
| 187 | Bus 003 Device 001: ID 0000:0000 |
164 | Bus 003 Device 001: ID 0000:0000 |
| 188 | Bus 002 Device 002: ID 0db0:1967 Micro Star International Bluetooth Dongle |
165 | Bus 002 Device 002: ID 0db0:1967 Micro Star International Bluetooth Dongle |
| … | |
… | |
| 206 | files or the like may need <c>bluez-firmware</c>. |
183 | files or the like may need <c>bluez-firmware</c>. |
| 207 | </p> |
184 | </p> |
| 208 | |
185 | |
| 209 | <pre caption="Installing bluez-libs and bluez-utils"> |
186 | <pre caption="Installing bluez-libs and bluez-utils"> |
| 210 | # <i>emerge net-wireless/bluez-libs net-wireless/bluez-utils</i> |
187 | # <i>emerge net-wireless/bluez-libs net-wireless/bluez-utils</i> |
| 211 | </pre> |
|
|
| 212 | |
|
|
| 213 | <warn> |
|
|
| 214 | Do not emerge <c>bluez-kernel</c> or <c>bluez-sdp</c> as they will break |
|
|
| 215 | <c>bluez-utils</c>! |
|
|
| 216 | </warn> |
|
|
| 217 | |
|
|
| 218 | <p> |
|
|
| 219 | Additionally, as we have compiled the Bluetooth subsystem as modules, we will |
|
|
| 220 | need hotplug and coldplug, which are explained in the <uri |
|
|
| 221 | link="http://www.gentoo.org/doc/en/usb-guide.xml#doc_chap4_sect2">Gentoo Linux |
|
|
| 222 | USB Guide</uri>. |
|
|
| 223 | </p> |
|
|
| 224 | |
|
|
| 225 | <pre caption="Emerging hotplug and coldplug"> |
|
|
| 226 | # <i>emerge hotplug coldplug</i> |
|
|
| 227 | # <i>rc-update add coldplug boot</i> |
|
|
| 228 | </pre> |
188 | </pre> |
| 229 | |
189 | |
| 230 | </body> |
190 | </body> |
| 231 | </section> |
191 | </section> |
| 232 | <section> |
192 | <section> |
| … | |
… | |
| 249 | # <i>hciconfig</i> |
209 | # <i>hciconfig</i> |
| 250 | hci0: Type: USB |
210 | hci0: Type: USB |
| 251 | BD Address: 00:01:02:03:04:05 ACL MTU: 192:8 SCO MTU: 64:8 |
211 | BD Address: 00:01:02:03:04:05 ACL MTU: 192:8 SCO MTU: 64:8 |
| 252 | DOWN |
212 | DOWN |
| 253 | RX bytes:131 acl:0 sco:0 events:18 errors:0 |
213 | RX bytes:131 acl:0 sco:0 events:18 errors:0 |
| 254 | TX bytes:565 acl:0 sco:0 commands:17 errors:0 |
214 | TX bytes:565 acl:0 sco:0 commands:17 errors:0 |
| 255 | </pre> |
215 | </pre> |
| 256 | |
216 | |
| 257 | <p> |
217 | <p> |
| 258 | This shows that the Bluetooth device has been recognised. As you might have |
218 | This shows that the Bluetooth device has been recognised. As you might have |
| 259 | noticed the device is <e>DOWN</e>. Let's configure it so that we can bring it |
219 | noticed the device is <e>DOWN</e>. Let's configure it so that we can bring it |
| … | |
… | |
| 262 | please refer to <c>man hcid.conf</c>. |
222 | please refer to <c>man hcid.conf</c>. |
| 263 | </p> |
223 | </p> |
| 264 | |
224 | |
| 265 | <pre caption="Editing /etc/bluetooth/hcid.conf"> |
225 | <pre caption="Editing /etc/bluetooth/hcid.conf"> |
| 266 | <comment>(Recommended changes to be made to the file are shown)</comment> |
226 | <comment>(Recommended changes to be made to the file are shown)</comment> |
|
|
227 | |
|
|
228 | # HCId options |
|
|
229 | options { |
|
|
230 | # Automatically initialize new devices |
|
|
231 | autoinit yes; |
| 267 | |
232 | |
| 268 | <comment>(Change security to "auto")</comment> |
233 | <comment>(Change security to "auto")</comment> |
| 269 | # Security Manager mode |
234 | # Security Manager mode |
| 270 | # none - Security manager disabled |
235 | # none - Security manager disabled |
| 271 | # auto - Use local PIN for incoming connections |
236 | # auto - Use local PIN for incoming connections |
| 272 | # user - Always ask user for a PIN |
237 | # user - Always ask user for a PIN |
| 273 | # |
238 | # |
| 274 | security auto; |
239 | security auto; |
| 275 | |
240 | |
|
|
241 | # Pairing mode |
|
|
242 | pairing multi; |
|
|
243 | |
|
|
244 | <comment>(You only need a pin helper if you are using <=bluez-libs-2.x and <=bluez-utils-2.x) |
| 276 | <comment>(Change pin_helper to use /etc/bluetooth/pin-helper)</comment> |
245 | (Change pin_helper to use /etc/bluetooth/pin-helper)</comment> |
| 277 | # PIN helper |
246 | # PIN helper |
| 278 | pin_helper /etc/bluetooth/pin-helper; |
247 | pin_helper /etc/bluetooth/pin-helper; |
|
|
248 | } |
| 279 | |
249 | |
|
|
250 | # Default settings for HCI devices |
|
|
251 | device { |
| 280 | <comment>(Set your device name here, you can call it anything you want)</comment> |
252 | <comment>(Set your device name here, you can call it anything you want)</comment> |
| 281 | # Local device name |
253 | # Local device name |
| 282 | # %d - device id |
254 | # %d - device id |
| 283 | # %h - host name |
255 | # %h - host name |
| 284 | name "BlueZ at %h (%d)"; |
256 | name "BlueZ at %h (%d)"; |
| 285 | |
257 | |
|
|
258 | # Local device class |
|
|
259 | class 0x3e0100; |
|
|
260 | |
|
|
261 | # Inquiry and Page scan |
|
|
262 | iscan enable; pscan enable; |
|
|
263 | |
|
|
264 | # Default link mode |
|
|
265 | lm accept; |
|
|
266 | |
|
|
267 | # Default link policy |
|
|
268 | lp rswitch,hold,sniff,park; |
|
|
269 | |
| 286 | <comment>(Leave as is, if you don't know what exactly these do)</comment> |
270 | <comment>(Leave as is, if you don't know what exactly these do)</comment> |
| 287 | # Authentication and Encryption (Security Mode 3) |
271 | # Authentication and Encryption (Security Mode 3) |
| 288 | #auth enable; |
272 | #auth enable; |
| 289 | #encrypt enable; |
273 | #encrypt enable; |
| 290 | } |
274 | } |
| … | |
… | |
| 293 | <p> |
277 | <p> |
| 294 | After that, we have to configure the Bluetooth device PIN. That will help in |
278 | After that, we have to configure the Bluetooth device PIN. That will help in |
| 295 | pairing this device with another one. |
279 | pairing this device with another one. |
| 296 | </p> |
280 | </p> |
| 297 | |
281 | |
| 298 | <note> |
|
|
| 299 | You can choose from different pin helpers, depending on what you want to use. |
|
|
| 300 | Available pin helpers are: <c>/usr/lib/kdebluetooth/kbluepin</c> |
|
|
| 301 | (net-wireless/kdebluetooth), <c>/usr/bin/bluepin</c> or |
|
|
| 302 | <c>/etc/bluetooth/pin-helper</c> among others. |
|
|
| 303 | </note> |
|
|
| 304 | |
|
|
| 305 | <pre caption="Editing /etc/bluetooth/pin"> |
282 | <pre caption="Editing /etc/bluetooth/pin"> |
| 306 | <comment>(Change 123456 with your desired pin number.)</comment> |
283 | <comment>(Replace 123456 with your desired pin number.)</comment> |
| 307 | 123456 |
284 | 123456 |
| 308 | </pre> |
285 | </pre> |
| 309 | |
286 | |
| 310 | <impo> |
287 | <impo> |
| 311 | This number (of your choice) must be the same in all your hosts with Bluetooth |
288 | This number (of your choice) must be the same in all your hosts with Bluetooth |
| 312 | devices so they can be paired. This number must also be kept secret since anyone |
289 | devices so they can be paired. This number must also be kept secret since anyone |
| 313 | with knowledge of this number can essentially establish connections with your |
290 | with knowledge of this number can essentially establish connections with your |
| 314 | devices. |
291 | devices. |
| 315 | </impo> |
292 | </impo> |
| 316 | |
293 | |
|
|
294 | <note> |
|
|
295 | Beginning with <c>>=bluez-libs-3.x</c> and <c>>=bluez-utils-3.x</c>, pin helpers |
|
|
296 | have been replaced by passkey agents. There are a few different graphical |
|
|
297 | passkey agents available to help manage your PIN, such as <c>bluez-gnome</c> and |
|
|
298 | <c>kdebluetooth</c>. You can also use <c>passkey-agent</c> (found in |
|
|
299 | <c>bluez-utils</c>) from the command line. |
|
|
300 | </note> |
|
|
301 | |
| 317 | </body> |
302 | </body> |
| 318 | </section> |
303 | </section> |
| 319 | <section> |
304 | <section> |
| 320 | <title>Services configuration</title> |
305 | <title>Services configuration</title> |
| 321 | <body> |
306 | <body> |
| … | |
… | |
| 334 | </pre> |
319 | </pre> |
| 335 | |
320 | |
| 336 | <p> |
321 | <p> |
| 337 | Let's be sure that the Bluetooth daemons started correctly. If we can see that |
322 | Let's be sure that the Bluetooth daemons started correctly. If we can see that |
| 338 | both <c>hcid</c> and <c>sdpd</c> are running, then we configured Bluetooth the |
323 | both <c>hcid</c> and <c>sdpd</c> are running, then we configured Bluetooth the |
| 339 | right way. After that, we can see if the decices are now up and running with |
324 | right way. After that, we can see if the devices are now up and running with |
| 340 | the configured options. |
325 | the configured options. |
| 341 | </p> |
326 | </p> |
| 342 | |
327 | |
| 343 | <pre caption="Checking whether Bluetooth daemons started correctly"> |
328 | <pre caption="Checking whether Bluetooth daemons started correctly"> |
| 344 | <comment>(Check to see if the services are running)</comment> |
329 | <comment>(Check to see if the services are running)</comment> |
| … | |
… | |
| 348 | 26054 ? 00:00:00 sdpd |
333 | 26054 ? 00:00:00 sdpd |
| 349 | |
334 | |
| 350 | # <i>hciconfig -a</i> |
335 | # <i>hciconfig -a</i> |
| 351 | hci0: Type: USB |
336 | hci0: Type: USB |
| 352 | BD Address: 00:0A:0B:0C:0D:0E ACL MTU: 192:8 SCO MTU: 64:8 |
337 | BD Address: 00:0A:0B:0C:0D:0E ACL MTU: 192:8 SCO MTU: 64:8 |
| 353 | UP RUNNING PSCAN ISCAN AUTH ENCRYPT |
338 | UP RUNNING PSCAN ISCAN |
| 354 | RX bytes:125 acl:0 sco:0 events:17 errors:0 |
339 | RX bytes:125 acl:0 sco:0 events:17 errors:0 |
| 355 | TX bytes:565 acl:0 sco:0 commands:17 errors:0 |
340 | TX bytes:565 acl:0 sco:0 commands:17 errors:0 |
| 356 | Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00 |
341 | Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00 |
| 357 | Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 |
342 | Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 |
| 358 | Link policy: RSWITCH HOLD SNIFF PARK |
343 | Link policy: RSWITCH HOLD SNIFF PARK |
| … | |
… | |
| 389 | </pre> |
374 | </pre> |
| 390 | |
375 | |
| 391 | <pre caption="Scanning for remote devices"> |
376 | <pre caption="Scanning for remote devices"> |
| 392 | # <i>hcitool scan</i> |
377 | # <i>hcitool scan</i> |
| 393 | Scanning ... |
378 | Scanning ... |
| 394 | 00:0A:0B:0C:0D:0E Grayhat |
379 | 00:0A:0B:0C:0D:0E Grayhat |
| 395 | </pre> |
380 | </pre> |
| 396 | |
381 | |
| 397 | <pre caption="Inquiring remote devices"> |
382 | <pre caption="Inquiring remote devices"> |
| 398 | # <i>hcitool inq</i> |
383 | # <i>hcitool inq</i> |
| 399 | Inquiring ... |
384 | Inquiring ... |
| 400 | 00:0A:0B:0C:0D:0E clock offset: 0x5579 class: 0x72010c |
385 | 00:0A:0B:0C:0D:0E clock offset: 0x5579 class: 0x72010c |
| 401 | </pre> |
386 | </pre> |
| 402 | |
387 | |
| 403 | <p> |
388 | <p> |
| 404 | Now that we now the MAC address of the remote Bluetooth devices, we can check |
389 | Now that we know the MAC address of the remote Bluetooth devices, we can check |
| 405 | if we paired them correctly. |
390 | if we paired them correctly. |
| 406 | </p> |
391 | </p> |
| 407 | |
392 | |
| 408 | <pre caption="Running l2ping"> |
393 | <pre caption="Running l2ping"> |
| 409 | # <i>l2ping 00:0A:0B:0C:0D:0E</i> |
394 | # <i>l2ping 00:0A:0B:0C:0D:0E</i> |
| 410 | Ping: 00:0A:0B:0C:0D:0E from 00:01:02:03:04:05 (data size 20) ... |
395 | Ping: 00:0A:0B:0C:0D:0E from 00:01:02:03:04:05 (data size 20) ... |
| 411 | 20 bytes from 00:0A:0B:0C:0D:0E id 200 time 69.85ms |
396 | 20 bytes from 00:0A:0B:0C:0D:0E id 200 time 69.85ms |
| 412 | 20 bytes from 00:0A:0B:0C:0D:0E id 201 time 9.97ms |
397 | 20 bytes from 00:0A:0B:0C:0D:0E id 201 time 9.97ms |
| 413 | 20 bytes from 00:0A:0B:0C:0D:0E id 202 time 56.86ms |
398 | 20 bytes from 00:0A:0B:0C:0D:0E id 202 time 56.86ms |
| 414 | 20 bytes from 00:0A:0B:0C:0D:0E id 203 time 39.92ms |
399 | 20 bytes from 00:0A:0B:0C:0D:0E id 203 time 39.92ms |
| 415 | 4 sent, 4 received, 0% loss |
400 | 4 sent, 4 received, 0% loss |
| 416 | </pre> |
401 | </pre> |
| 417 | |
402 | |
| 418 | </body> |
403 | </body> |
| 419 | </section> |
404 | </section> |
| 420 | <section> |
405 | <section> |
| … | |
… | |
| 448 | |
433 | |
| 449 | # Bluetooth address of the device |
434 | # Bluetooth address of the device |
| 450 | <comment>(Enter the address of the device you want to connect to)</comment> |
435 | <comment>(Enter the address of the device you want to connect to)</comment> |
| 451 | device 00:0A:0B:0C:0D:0E; |
436 | device 00:0A:0B:0C:0D:0E; |
| 452 | |
437 | |
| 453 | } |
438 | } |
| 454 | </pre> |
439 | </pre> |
| 455 | |
440 | |
| 456 | <p> |
441 | <p> |
| 457 | After configuring RFCOMM, we can connect to any device. Since we've made the |
442 | After configuring RFCOMM, we can connect to any device. Since we've made the |
| 458 | required settings to the <path>/etc/bluetooth/rfcomm.conf</path> file, we just |
443 | required settings to the <path>/etc/bluetooth/rfcomm.conf</path> file, we just |
| … | |
… | |
| 482 | CTRL+C. |
467 | CTRL+C. |
| 483 | </p> |
468 | </p> |
| 484 | |
469 | |
| 485 | <pre caption="Listening for incoming RFCOMM connections"> |
470 | <pre caption="Listening for incoming RFCOMM connections"> |
| 486 | # <i>rfcomm listen 0 1</i> |
471 | # <i>rfcomm listen 0 1</i> |
| 487 | Waiting for connection on channel 1 |
472 | Waiting for connection on channel 1 |
| 488 | </pre> |
473 | </pre> |
| 489 | |
474 | |
| 490 | <p> |
475 | <p> |
| 491 | In a similar way to the connect command, the listen command can receive two |
476 | In a similar way to the connect command, the listen command can receive two |
| 492 | parameters. The first one explicits the RFCOMM TTY device node (usually 0) that |
477 | parameters. The first one explicits the RFCOMM TTY device node (usually 0) that |
| 493 | will be used to accept a connection, while the second is the channel that will |
478 | will be used to accept a connection, while the second is the channel that will |
| 494 | be used. |
479 | be used. |
| 495 | </p> |
480 | </p> |
| 496 | |
481 | |
| 497 | <p> |
482 | <p> |
| 498 | Each time you call the <c>rfcomm</c> command, you can also specify the physical |
483 | Each time you call the <c>rfcomm</c> command, you can also specify the physical |
| 499 | device you want to use. Below you can see a small example specifiying the |
484 | device you want to use. Below you can see a small example specifiying the |
| … | |
… | |
| 508 | <comment>(To use a determined device when connecting to another one)</comment> |
493 | <comment>(To use a determined device when connecting to another one)</comment> |
| 509 | </pre> |
494 | </pre> |
| 510 | |
495 | |
| 511 | </body> |
496 | </body> |
| 512 | </section> |
497 | </section> |
| 513 | <section> |
498 | <!-- Deleting pan chapter, bug 266690, until we know how the hell to do this --> |
| 514 | <title>Setting up a Personal Area Network (PAN)</title> |
|
|
| 515 | <body> |
|
|
| 516 | |
|
|
| 517 | <note> |
|
|
| 518 | Please note that setting up a Personal Area Network is optional. This section |
|
|
| 519 | describes how to set up and connect to a Network Access Point, though setting |
|
|
| 520 | up a Group Ad-Hoc Network follows a similar way. |
|
|
| 521 | </note> |
|
|
| 522 | |
|
|
| 523 | <p> |
|
|
| 524 | First of all, we need the <c>bnep</c> module loaded. And probably we want it |
|
|
| 525 | loaded each time the computer starts. |
|
|
| 526 | </p> |
|
|
| 527 | |
|
|
| 528 | <pre caption="Loading the bnep module"> |
|
|
| 529 | # <i>modprobe bnep</i> |
|
|
| 530 | # <i>echo "bnep" >> /etc/modules.autoload.d/kernel-2.6</i> |
|
|
| 531 | </pre> |
|
|
| 532 | |
|
|
| 533 | <p> |
|
|
| 534 | We have to start the <c>pand</c> daemon in the host that will provide the NAP. |
|
|
| 535 | We'll have to specify that we want to provide a NAP service and that this host |
|
|
| 536 | will be the master, thus the other hosts that connect to it, the slaves. |
|
|
| 537 | Another possible service is GN (Group ad-hoc Network). |
|
|
| 538 | </p> |
|
|
| 539 | |
|
|
| 540 | <pre caption="Running the pand daemon"> |
|
|
| 541 | # <i>pand --listen --role NAP --master --autozap</i> |
|
|
| 542 | </pre> |
|
|
| 543 | |
|
|
| 544 | <p> |
|
|
| 545 | After doing that, we have a host listening, so the rest of hosts just have to |
|
|
| 546 | connect to that one. |
|
|
| 547 | </p> |
|
|
| 548 | |
|
|
| 549 | <pre caption="Connecting to the Network Access Point"> |
|
|
| 550 | # <i>pand --connect 00:0A:0B:0C:0D:0E --service NAP --autozap</i> |
|
|
| 551 | </pre> |
|
|
| 552 | |
|
|
| 553 | <p> |
|
|
| 554 | If everything went fine, we can now configure the IP addresses of our hosts. |
|
|
| 555 | </p> |
|
|
| 556 | |
|
|
| 557 | <pre caption="bnep IP address configuration"> |
|
|
| 558 | host0 #<i> ifconfig bnep0 192.168.2.1</i> |
|
|
| 559 | host1 #<i> ifconfig bnep0 192.168.2.2</i> |
|
|
| 560 | |
|
|
| 561 | host0 #<i> ifconfig bnep0</i> |
|
|
| 562 | bnep0 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 |
|
|
| 564 | inet6 addr: fe80::210:60ff:fea3:cb41/64 Scope:Link |
|
|
| 565 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
|
|
| 566 | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 |
|
|
| 567 | TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 |
|
|
| 568 | collisions:0 txqueuelen:1000 |
|
|
| 569 | RX bytes:208 (208.0 b) TX bytes:188 (188.0 b) |
|
|
| 570 | |
|
|
| 571 | host1 #<i> ifconfig bnep0</i> |
|
|
| 572 | bnep0 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 |
|
|
| 574 | inet6 addr: fe80::210:60ff:fea2:dd2a/64 Scope:Link |
|
|
| 575 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
|
|
| 576 | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 |
|
|
| 577 | TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 |
|
|
| 578 | collisions:0 txqueuelen:1000 |
|
|
| 579 | RX bytes:208 (208.0 b) TX bytes:188 (188.0 b) |
|
|
| 580 | </pre> |
|
|
| 581 | |
|
|
| 582 | <p> |
|
|
| 583 | Finally, we can do a simple test to see that the network is working fine. |
|
|
| 584 | </p> |
|
|
| 585 | |
|
|
| 586 | <pre caption="IP ping between bnep interfaces"> |
|
|
| 587 | host1 #<i> ping 192.168.2.1</i> |
|
|
| 588 | PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. |
|
|
| 589 | 64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=34.0 ms |
|
|
| 590 | 64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=37.3 ms |
|
|
| 591 | |
|
|
| 592 | --- 192.168.2.1 ping statistics --- |
|
|
| 593 | 2 packets transmitted, 2 received, 0% packet loss, time 1000ms |
|
|
| 594 | rtt min/avg/max/mdev = 34.045/35.690/37.336/1.656 ms |
|
|
| 595 | </pre> |
|
|
| 596 | |
|
|
| 597 | </body> |
|
|
| 598 | </section> |
|
|
| 599 | </chapter> |
499 | </chapter> |
| 600 | |
500 | |
| 601 | <chapter id="apps"> |
501 | <chapter id="apps"> |
| 602 | <title>Desktop Applications for Bluetooth</title> |
502 | <title>Desktop Applications for Bluetooth</title> |
| 603 | <section> |
503 | <section> |
| … | |
… | |
| 635 | This adds menu entries under Applications > System Tools from where you can |
535 | This adds menu entries under Applications > System Tools from where you can |
| 636 | easily start up the manager or File sharing to transfer files between devices. |
536 | easily start up the manager or File sharing to transfer files between devices. |
| 637 | </p> |
537 | </p> |
| 638 | |
538 | |
| 639 | <p> |
539 | <p> |
| 640 | To transfer files (the easy way): |
540 | To transfer files (the easy way): |
| 641 | </p> |
541 | </p> |
| 642 | |
542 | |
| 643 | <ul> |
543 | <ul> |
| 644 | <li> |
544 | <li> |
| 645 | From the Phone to the Computer - Send the file from the phone via Bluetooth |
545 | 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 |
621 | 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 |
622 | Evolution e-mail client. You will need the <c>irmc</c> USE flag set to |
| 723 | ensure that <c>multisync</c> has Bluetooth support. |
623 | ensure that <c>multisync</c> has Bluetooth support. |
| 724 | </li> |
624 | </li> |
| 725 | <li> |
625 | <li> |
| 726 | <c>media-plugins/xmms-btexmms</c>: Btexmms is an XMMS plugin that allows |
626 | <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 |
627 | tools (server and client) that can be used to send files to your mobile |
| 728 | control for XMMS. |
628 | phone. |
| 729 | </li> |
629 | </li> |
| 730 | </ul> |
630 | </ul> |
| 731 | |
631 | |
| 732 | </body> |
632 | </body> |
| 733 | </section> |
633 | </section> |