我的蓝牙键盘无法配对。你能帮我吗?
刚买了这款非常好的蓝牙桌面套装 和这款华硕笔记本电脑 并在其上安装了 Ubuntu 15.04。
首先我的鼠标无法配对。我按照以下建议安装了 Bluez5 和蓝牙管理器,解决了这个问题艾瑞克·鲍尔这里: 蓝牙鼠标未配对但未连接
现在键盘没有配对。
在键盘上,我按住一个小按钮 3 秒钟,使其进入配对模式。蓝牙管理器看到键盘。我点击“设置”。蓝牙管理器提示我在键盘上输入代码。我在键盘上输入该代码并按下 ENTER:砰,蓝牙管理器立即显示“添加设备失败”。
/var/log/syslog 的最后几行如下。感谢您的帮助!
last lines of /var/log/syslog:
bluetoothd[1144]: Error reading PNP_ID value: Attribute requires authentication before read/write
bluetoothd[1144]: Unable to register GATT service with handle 0x0011 for device FF:DE:BC:04:E4:E9:
org.blueman.Applet[1357]: ERROR:dbus.connection:Exception in handler for D-Bus signal:
org.blueman.Applet[1357]: Traceback (most recent call last):
org.blueman.Applet[1357]: File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 230, in maybe_handle_message
org.blueman.Applet[1357]: self._handler(*args, **kwargs)
org.blueman.Applet[1357]: File "/usr/lib/python2.7/dist-packages/blueman/bluez/PropertiesBlueZInterface.py", line 51, in wrapper
org.blueman.Applet[1357]: handler(name, value, **kwargs)
org.blueman.Applet[1357]: File "/usr/lib/python2.7/dist-packages/blueman/plugins/applet/SerialManager.py", line 48, in on_device_property_changed
org.blueman.Applet[1357]: d = Device(path)
org.blueman.Applet[1357]: File "/usr/lib/python2.7/dist-packages/blueman/main/Device.py", line 39, in __init__
org.blueman.Applet[1357]: self.Properties = self.Device.get_properties()
org.blueman.Applet[1357]: File "/usr/lib/python2.7/dist-packages/blueman/bluez/errors.py", line 143, in warp
org.blueman.Applet[1357]: raise parse_dbus_error(exception)
org.blueman.Applet[1357]: DBusException: org.freedesktop.DBus.Error.UnknownObject: Method "GetAll" with signature "s" on interface "org.freedesktop.DBus.Properties" doesn't exist
bluetoothd[1144]: Unable to register GATT service with handle 0x0011 for device FF:DE:BC:05:E4:E9:
bluetoothd[1144]: Error reading PNP_ID value: Attribute requires authentication before read/write
bluetoothd[1144]: Error reading PNP_ID value: Attribute requires authentication before read/write
bluetoothd[1144]: Unable to register GATT service with handle 0x0011 for device FF:DE:BC:05:E4:E9:
bluetoothd[1144]: Report Map read failed: Attribute requires authentication before read/write
bluetoothd[1144]: Protocol Mode characteristic read failed: Attribute requires authentication before read/write
bluetoothd[1144]: HID Information read failed: Attribute requires authentication before read/write
bluetoothd[1144]: Read Report Reference descriptor failed: Attribute requires authentication before read/write
答案1
此问题是由于 gattool 的问题造成的。bluetoothd 调用 gattool 从低功耗蓝牙设备获取属性。可能是设备的固件不支持身份验证协议。
我通过启用蓝牙实验功能来避免此问题。在 /etc/init.d/bluetooth 中添加“-E”选项,NOPLUGIN_OPTION="-E"。然后,重新启动蓝牙服务。
答案2
通过更新 bluez,它对我有用:
apt-add-repository ppa:vidplace7/bluez5
apt-add-repository ppa:blueman/ppa
apt-get update
apt-get install bluez
apt-get install blueman
apt-get install bluez-compat
然后我必须以实验模式启动 bluez:/usr/sbin/bluetooth
用你自己的脚本替换:
#!/bin/sh
bluetooth -E
现在我可以连接blueman-applet
鼠标和键盘了。
有什么想法可以在启动时自动连接或者不使用 blueman(仅使用命令行)吗?
答案3
对我来说,在尝试在蓝牙管理器中配对键盘后,我注意到一个带有密码的小通知气泡。气泡只存在几秒钟。我在键盘上输入密码并按下 Enter,然后键盘就配对了。
尝试了几次才让它工作(将键盘重新置于配对模式)。