我正在使用 Debian Jessie(測試)。我有一個藍牙滑鼠 (Microsoft Sculpt Comfort),我可以將其配對並正常使用,但經過一段時間的不活動(大約 10 分鐘)後,它停止工作,我必須手動觸摸設定可發現滑鼠上的按鈕並在命令列上重新配對。
我在 OS X 上嘗試過的相同滑鼠並且可以工作,所以這不是硬體問題
內核3.14.12-1 (2014-07-11)
我將滑鼠與以下命令配對:
sudo hidd --connect 30:59:B7:72:A5:A7
正確配對後,這就是/var/log/系統日誌輸出
Jan 7 15:22:42 desktop hidd: New HID device 30:59:B7:72:A5:A7 (Microsoft Bluetooth Mouse )
Jan 7 15:22:42 desktop kernel: [103877.102083] hid-generic 0005:045E:07A2.0009: unknown main item tag 0x0
Jan 7 15:22:42 desktop kernel: [103877.102481] input: Microsoft Bluetooth Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0/bluetooth/hci0/hci0:42/0005:045E:07A2.0009/input/input51
Jan 7 15:22:42 desktop kernel: [103877.102884] hid-generic 0005:045E:07A2.0009: input,hidraw3: BLUETOOTH HID v1.29 Mouse [Microsoft Bluetooth Mouse ] on 00:15:83:c8:52:19
經過一段空閒時間後,這會列印在同一個日誌檔案上:
Jan 7 15:34:34 desktop acpid: input device has been disconnected, fd 20
如果我單擊滑鼠按鈕或移動它,則會列印以下內容:
Jan 7 15:49:55 desktop bluetoothd[650]: Refusing input device connect: No such file or directory (2)
Jan 7 15:49:56 desktop bluetoothd[650]: Refusing connection from 30:59:B7:72:A5:A7: unknown device
這似乎表明滑鼠仍在工作並嘗試告訴作業系統重新連接,但它不能。
這是udevadm 訊息 -p回覆:
P: /devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0/bluetooth/hci0/hci0:42/0005:045E:07A2.0004/input/input22
E: ABS=100000000
E: DEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0/bluetooth/hci0/hci0:42/0005:045E:07A2.0004/input/input22
E: EV=10001f
E: ID_FOR_SEAT=input-pci-0000_00_02_0-usb-0_3_1_0
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_INPUT_MOUSE=1
E: ID_PATH=pci-0000:00:02.0-usb-0:3:1.0
E: ID_PATH_TAG=pci-0000_00_02_0-usb-0_3_1_0
E: KEY=4837fff072ff32d bf54444600000000 1f0001 30f908b17c007 ffe77bfad9415fff febeffdff3cfffff fffffffffffffffe
E: MODALIAS=input:b0005v045Ep07A2e0129-e0,1,2,3,4,14, k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,8B,8C,8E,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,A9,AB,AC,AD,AE,B0, B1,B2,B5,B6,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,CE,CF,D0,D1,D2,D4,D8,D9,DB,DF,E4,E7,E8,E9,EA,EB,F0,F1,100,110,111,112,113,114,161,162,166,16A,1 6E,172,174,176,178,179,17A,17B,17C,17D,17F,180,182,183,185,188,189,18C,18D,18E,18F,190,191,192,193,195,198,199,19A,1A0,1A1,1A2,1A3,1A4,1A5,1A6, 1A7,1A8,1A9,1AA,1AB,1AC,1AD,1AE,1B0,1B1,1B7,1BA,r0,1,6,7,8,9,a20,m4,lsfw
E: MSC=10
E: NAME="Microsoft Bluetooth Mouse "
E: PHYS="00:15:83:c8:52:19"
E: PRODUCT=5/45e/7a2/129
E: PROP=0
E: REL=3c3
E: SUBSYSTEM=input
E: TAGS=:seat:
E: UNIQ="30:59:b7:72:a5:a7"
E: USEC_INITIALIZED=55796705
答案1
這個問題有3種解決方案。也許甚至將其中的兩個結合起來就可以解決您的問題。
解決方案1
編輯文件並設定區塊內的/etc/bluetooth/input.conf
參數。IdleTimeout=0
[General]
root@nwdesktop:~# vim /etc/bluetooth/input.conf
# Configuration file for the input service
# This section contains options which are not specific to any
# particular interface
[General]
# Set idle timeout (in minutes) before the connection will
# be disconnect (defaults to 0 for no timeout)
IdleTimeout=0
重啟藍牙服務:
root@nwdesktop:~# /etc/init.d/bluetooth restart
* Stopping bluetooth [ OK ]
* Starting bluetooth [ OK ]
這將防止由於藍牙滑鼠和鍵盤超時而斷開連接。
解決方案2
建立一個 udev 規則來避免滑鼠自動掛起
root@nwdesktop:~# vi /etc/udev/rules.d/91-local.rules
ACTION=="add", SUBSYSTEM=="bluetooth", ATTR{product}=="Microsoft Bluetooth Mouse ", ATTR{power/control}="on"
root@nwdesktop:~# # udevadm control --reload-rules
解決方案3
這並不讓我感到自豪,但是...使用 hidd connect 命令創建一個腳本:
user@nwdesktop:~# vi /home/user/recconect.sh
#!/bin/bash
sudo hidd --connect 30:59:B7:72:A5:A7
現在,新增到您的 crontab:
root@nwdesktop:~# vi /etc/crontab
*/10 * * * * root /home/user/recconect.sh
乾杯。
答案2
要啟用(連接)Sony MDR-ZX550BN 無線耳機,我唯一要做的就是在 /etc/bluetooth/input.conf 中
新增/取消註解行:
#在使用者空間輸入設定檔中啟用 HID 協定處理
#預設為 false(HIDP 在 HIDP 核心模組中處理)
使用者空間HID=true
並且自然地重新啟動服務 /etc/init.d/bluetooth restart
PS 我正在使用 Debian 8 Jessie
答案3
查看日誌,我注意到每次斷開連接都會拋出一條帶有 UPower 偵錯訊息的行。看來 xfce4-power-manager 正在使用此守護程序時不時地輪詢觸控板的電池電量。對我來說解決這個問題的似乎是完全禁用和卸載 UPower 和 xfce4-power-manager。