SliTaz GNU/Linux official and community documentation wiki.
.png

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:guides:bluetooth [2010/04/03 20:27]
ernia
en:guides:bluetooth [2010/08/22 17:39] (current)
linea
Line 1: Line 1:
 +====== Bluetooth ======
 +
 +===== Introduction =====
 +
 This guide will help you to configure bluetooth, e.g. to use your phone as a modem. This guide will help you to configure bluetooth, e.g. to use your phone as a modem.
 Do following steps as root. Do following steps as root.
 First of all you must install Slitaz packages related to bluetooth: First of all you must install Slitaz packages related to bluetooth:
-  tazpkg get-install bluez +  ​tazpkg get-install bluez 
-  tazpkg get-install linux-bluetooth+  ​tazpkg get-install linux-bluetooth
 The first package contains the Official Linux Bluetooth protocol stack www.bluez.org and the second contains the kernel modules related to bluetooth. The first package contains the Official Linux Bluetooth protocol stack www.bluez.org and the second contains the kernel modules related to bluetooth.
 Now you can launch the bluetooth daemon: Now you can launch the bluetooth daemon:
-  bluetoothd +  ​bluetoothd 
-and load the module required by your local bluetooth device, this is very likely btusb +And load the module required by your local bluetooth device, this is very likely btusb: 
-  modprobe btusb +  ​modprobe btusb 
-If btusb is the module you need the command "​hcitool dev" ​will show you the local device address:+If btusb is the module you need the command "​hcitool dev" ​to show you the local device address:
   root@slitaz:/​home/​tux#​ hcitool dev   root@slitaz:/​home/​tux#​ hcitool dev
   Devices:   Devices:
           hci0    00:​02:​72:​xx:​xx:​xx           hci0    00:​02:​72:​xx:​xx:​xx
-If the command "​hcitool dev" does not show you any hci* device you must detect which module you need and repeat previous step until you have a hci* device.+If the command "​hcitool dev" does not show you any hci* device you must detect which module you need and repeat ​the previous step until you have a hci* device.
 Now that you have hci* you can run the "​hcitool scan" command to show you if there is any discoverable device nearby. Now that you have hci* you can run the "​hcitool scan" command to show you if there is any discoverable device nearby.
-So if you are searching e.g. your phone remember to put it in discoverable mode.+So if you are searchinge.g. your phoneremember to put it in discoverable mode:
   root@slitaz:/​home/​tux#​ hcitool scan   root@slitaz:/​home/​tux#​ hcitool scan
   Scanning ...   Scanning ...
Line 23: Line 27:
  
 If you want to start the pairing from the remote device you need to put your local device in discoverable mode: If you want to start the pairing from the remote device you need to put your local device in discoverable mode:
-  hciconfig hci0 piscan +  ​hciconfig hci0 piscan 
-Now launch bluez-simple-agent,​ start the pairing from the remote device and wait for bluez-simple-agent ask you the pin code needed to pair.+ 
 +Now launch bluez-simple-agent,​ start the pairing from the remote device and wait for bluez-simple-agent ​to ask you for the pin code needed to pair.
 This code will be the same one you typed on the phone. When you are done you need to kill bluez-simple-agent with Ctrl-c: This code will be the same one you typed on the phone. When you are done you need to kill bluez-simple-agent with Ctrl-c:
   root@slitaz:/​home/​tux#​ hciconfig hci0 piscan   root@slitaz:/​home/​tux#​ hciconfig hci0 piscan
Line 35: Line 40:
       mainloop.run()       mainloop.run()
   KeyboardInterrupt   KeyboardInterrupt
-  root@slitaz:/​home/​tu +  root@slitaz:/​home/​tux# 
-Put your local device back in undiscoverable mode +Put your local device back in undiscoverable mode: 
-  hciconfig hci0 pscan+  ​hciconfig hci0 pscan
  
-If you want to start the pairing from you local device you do it using bluez-simple-agent with the hci* of your local device and the address of the device you discovered with "​hcitool scan". In this case you will choose the code in bluez-simple-agent and type the same code on the remote device:+If you want to start the pairing from your local device you can do it using bluez-simple-agent with the hci* of your local device and the address of the device you discovered with "​hcitool scan". In this case you will choose the pin in bluez-simple-agent and type the same pin on the remote device:
   root@slitaz:/​home/​tux#​ bluez-simple-agent hci0 00:​18:​C5:​xx:​xx:​xx   root@slitaz:/​home/​tux#​ bluez-simple-agent hci0 00:​18:​C5:​xx:​xx:​xx
   RequestPinCode (/​org/​bluez/​3078/​hci0/​dev_00_18_C5_xx_xx_xx)   RequestPinCode (/​org/​bluez/​3078/​hci0/​dev_00_18_C5_xx_xx_xx)
Line 46: Line 51:
   New device (/​org/​bluez/​3078/​hci0/​dev_00_18_C5_xx_xx_xx)   New device (/​org/​bluez/​3078/​hci0/​dev_00_18_C5_xx_xx_xx)
   root@slitaz:/​home/​tux# ​   root@slitaz:/​home/​tux# ​
-Be fast because bluez-simple-agent ​have a timeout which don't know how to set (suggestions?​)+Be fast because bluez-simple-agent ​has a timeout which don't know how to set (suggestions?​)
  
-Now you have your two devices paired, i will go on with the phone as a modem example, ​don't have other experience ​with bluetooth devices. +===== Use a phone as a modem ===== 
-To use your phone as a modem you need the rfcomm module. ​In the moment ​am writing this guide the rfcomm module of Slitaz is compiled without tty support. You can check if this is the case with the following commands:+ 
 +Now you have your two devices paired, i will go on with the phone as a modem example, ​don't have other experiences ​with bluetooth devices. 
 +To use your phone as a modem you need the rfcomm module. ​At the moment ​am writing this guide the rfcomm module of Slitaz is compiled without tty support. You can check if this is the case with the following commands:
   root@slitaz:/​home/​tux#​ zcat /​proc/​config.gz | grep RFCOMM ​                   ​   root@slitaz:/​home/​tux#​ zcat /​proc/​config.gz | grep RFCOMM ​                   ​
   CONFIG_BT_RFCOMM=m   CONFIG_BT_RFCOMM=m
   # CONFIG_BT_RFCOMM_TTY is not set   # CONFIG_BT_RFCOMM_TTY is not set
   root@slitaz:/​home/​tux#​   root@slitaz:/​home/​tux#​
-If CONFIG_BT_RFCOMM_TTY is not =y you must recompile the module with tty support. Install linux-source +If CONFIG_BT_RFCOMM_TTY is not =y you must recompile the module with tty support. Install linux-source: 
-  tazpkg get-install linux-source +  ​tazpkg get-install linux-source 
-cd in /​usr/​src/​`uname -r`/ and give this command  +cd in /usr/src/linux-`uname -r`/ and give this command: 
-  make CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y M=net/​bluetooth/​rfcomm +  ​make CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y M=net/​bluetooth/​rfcomm 
-This will build only the rfcomm module with tty support. You will find it in /​usr/​src/​`uname -r`/​net/​bluetooth/​rfcomm/​rfcomm.ko. +This will build only the rfcomm module with tty support. You will find it in /usr/src/linux-`uname -r`/​net/​bluetooth/​rfcomm/​rfcomm.ko. 
-Now you can delete the old rfcomm module and change ​it with your module: +Now you can delete the old rfcomm module and replace ​it with your module: 
-  rm /​lib/​modules/​`uname -r`/​kernel/​net/​bluetooth/​rfcomm/​rfcomm.ko.gz +  ​rm /​lib/​modules/​`uname -r`/​kernel/​net/​bluetooth/​rfcomm/​rfcomm.ko.gz 
-  cp /​usr/​src/​`uname -r`/​net/​bluetooth/​rfcomm/​rfcomm.ko /​lib/​modules/​`uname -r`/​kernel/​net/​bluetooth/​rfcomm/​  +  ​cp /usr/src/linux-`uname -r`/​net/​bluetooth/​rfcomm/​rfcomm.ko /​lib/​modules/​`uname -r`/​kernel/​net/​bluetooth/​rfcomm/​  
-  depmod -a +  ​depmod -a 
-Now that we have a working rfcomm module we must detect the channel where the phone dialup service is listening. +Now that we have a working rfcomm module we must detect the channel where the phone dialup service is listening: 
-  sdptool browse 00:​18:​C5:​xx:​xx:​xx +  ​sdptool browse 00:​18:​C5:​xx:​xx:​xx 
-where 00:​18:​C5:​xx:​xx:​xx is the address of your phone, will give a list with the services available on your phone. The one you are looking for is Dial-up networking or DUN+Where 00:​18:​C5:​xx:​xx:​xx is the address of your phone, ​it will give a list with the services available on your phone. The one you are looking for is Dial-up networking or DUN:
   Service Name: Dial-up networking   Service Name: Dial-up networking
   Service RecHandle: 0x10000   Service RecHandle: 0x10000
Line 82: Line 89:
     "​Dialup Networking"​ (0x1103)     "​Dialup Networking"​ (0x1103)
       Version: 0x0100       Version: 0x0100
-As you can see it is listening on channel 1, so you edit /​etc/​bluetooth/​rfcomm.conf this way:+       
 +===== rfcomm.conf ===== 
 + 
 +As you can see it is listening on channel 1, so you edit ///​etc/​bluetooth/​rfcomm.conf// this way: 
 +<​file>​
   #   #
   # RFCOMM configuration file.   # RFCOMM configuration file.
Line 99: Line 110:
   #       ​comment "​Example Bluetooth device";​   #       ​comment "​Example Bluetooth device";​
   }   }
-now with +</​file>​ 
-  modprobe rfcomm +Now with: 
-  rfcomm bind all +  ​modprobe rfcomm 
-you can use rfcomm0 as you modem in a wvdial script. +  ​rfcomm bind all 
-you may want to check this guide http://​doc.slitaz.org/​en:​guides:​dialup+You can use /dev/rfcomm0 as modem in a wvdial script. 
 +You may want to check this guide http://​doc.slitaz.org/​en:​guides:​dialup 
 + 
 +----  
 +\\ 
 +^  Page Review Section ​ ^^  
 +|Quality| Good  | 
 +|Review| Minor Updates ​ | 
 +|Priority| Medium | 
 +|Problems| add a [[http://​forum.slitaz.org|forum post link]]| 
 +|:::     | OR add a [[http://​labs.slitaz.org/​issues |lab issue tracker link ]]| 
 +|How to Improve| Add tazhw setup bluetooth ; Please create "​sections"​ for toc| 
 +|::: |  |
  
 +\\
 +----
 
en/guides/bluetooth.1270319268.txt.gz · Last modified: 2010/07/08 17:17 (external edit)