https://wiki.archlinux.org/api.php?action=feedcontributions&user=Gratuit&feedformat=atomArchWiki - User contributions [en]2024-03-29T12:21:42ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Bluetooth_mouse&diff=276553Bluetooth mouse2013-09-25T03:32:14Z<p>Gratuit: </p>
<hr />
<div>[[Category:Mice]]<br />
[[Category:Bluetooth]]<br />
[[cs:Bluetooth Mouse]]<br />
[[ru:Bluetooth Mouse]]<br />
This article describes how to set up a [[Bluetooth]] mouse manually with no desktop assistance for Bluetooth. For example, a minimalist XFCE installation. <br />
<br />
== Installation ==<br />
<br />
You need the {{Pkg|bluez}} package and optionally the {{Pkg|bluez-utils}} package from the extra repository.<br />
<br />
Note: The following instructions only work for the {{Pkg|bluez4}} package. For Bluez 5(Current version) please see the bluetoothctl section. <br />
<br />
== Start Bluetooth service ==<br />
<br />
The pertinent options in /etc/conf.d/bluetooth are <br />
HIDD_ENABLE=true<br />
<br />
after that, start bluetooth services with<br />
# systemctl enable bluetooth.service<br />
# systemctl start bluetooth.service<br />
<br />
=== kernel modules ===<br />
No additional actions are necessary if the bluetooth service is started using systemd. If it does not work try following.<br />
<br />
The command<br />
# modprobe -v btusb bluetooth hidp l2cap<br />
loads the kernel modules you need, if they were not loaded automatically.<br />
<br />
=== Test ===<br />
The following command should show your bluetooth adapter:<br />
<br />
{{hc|# hciconfig|<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:22:43:E1:82:E0 ACL MTU: 1021:8 SCO MTU: 64:1<br />
UP RUNNING PSCAN <br />
RX bytes:1062273 acl:62061 sco:0 events:778 errors:0<br />
TX bytes:1825 acl:11 sco:0 commands:39 errors:0<br />
}}<br />
<br />
== Configure Bluetooth Mouse ==<br />
The method described here is based in three steps, in this order:<br />
<br />
# Make the PC learn about the bluetooth mouse.<br />
# Grant the mouse permissions to connect.<br />
# Make the mouse learn about the PC.<br />
<br />
=== Search your mouse ===<br />
First make your mouse discoverable. For example some mouse need to press a button. Then issue the following command as root:<br />
<br />
{{hc|# hcitool scan|<br />
Scanning ...<br />
00:07:61:F5:5C:3D Logitech Bluetooth Mouse M555b<br />
}}<br />
<br />
Your mouse bluetooth address will be similar to {{ic|12:34:56:78:9A:BC}}. You may also find it in the documentation or on the mouse itself.<br />
<br />
== Connecting the mouse ==<br />
hidd --search<br />
hcitool inq<br />
are good for device scanning (I needed to use sudo for 'hidd --search' to automatically connect mouse, searching worked even without sudo).<br />
hidd --connect <bdaddr><br />
to actually connect.<br />
hidd --show<br />
will show your currently connected devices. The mouse should show up in this list. If it does not, press the reset button to make it discoverable.<br />
<br />
Note: If you have the ipw3945 module loaded (wifi on HP computer) the bluetooth wont work.<br />
<br />
== Connecting the mouse at startup ==<br />
Edit /etc/conf.d/bluetooth:<br />
# Arguments to hidd<br />
HIDD_OPTIONS="--connect <enter here your bluetooth mouse address>"<br />
<br />
and test the new settings:<br />
/etc/rc.d/bluetooth stop<br />
hidd --killall (drop mouse connection)<br />
/etc/rc.d/bluetooth start<br />
<br />
Note: The above instructions to start the mouse at startup do not work with the now outdated 3.11 bluetooth packages. New versions such as the current (3.32) packages are not affected. If you are using an older version, then to start the mouse at startup, add:<br />
hidd --connect <enter here your bluetooth mouse address (No capitals!!!)><br />
to your /etc/rc.local file.<br />
<br />
Note #2: You can connect any bluetooth mouse and/or keyboard without any further configuration and without knowing the device address. You can do it by adding the --master and/or --server option in HIDD_OPTIONS depending on your device.<br />
<br />
== Configuring through bluetoothctl ==<br />
Since `bluez>=5` there is bluetoothctl util, that provide simple interface to configuring bluetooth devices.<br />
<br />
For example, configuring autoconnect bluetooth mouse can be done as described above:<br />
# bluetoothctl<br />
[bluetooth]# list<br />
Controller <cmac> BlueZ 5.5 [default]<br />
[bluetooth]# select <cmac><br />
[bluetooth]# power on<br />
[bluetooth]# scan on<br />
/// enable scanning mode on your mouse<br />
[bluetooth]# devices<br />
Device <mmac> Name: Bluetooth Mouse<br />
[bluetooth]# trust <mmac><br />
[bluetooth]# pairable on<br />
[bluetooth]# pair <mmac><br />
[bluetooth]# connect <mmac><br />
<br />
My device was not starting on boot unti I created a udev rule as in:<br />
<br />
https://bbs.archlinux.org/viewtopic.php?id=166362<br />
<br />
== Troubleshooting tips ==<br />
=== Mouse lag ===<br />
If you experience mouse lag you can try to increase the polling rate. There is a wiki article describing the procedure: [[Mouse Polling Rate]].<br />
<br />
=== Problems with the USB dongle ===<br />
If you have trouble with your USB dongle, you may also want to try<br />
# modprobe -v rfcomm<br />
<br />
At this point, you should get an hci0 device with<br />
# hcitool dev<br />
<br />
Sometimes the device is not active right away - try starting the interface with<br />
# hciconfig hci0 up<br />
and searching for devices as shown above.</div>Gratuit