我今天安装了 Ubuntu 18.04(与 Windows 10 双启动)。并尝试使用蓝牙鼠标(ELECOM M-XGM10BB)和 USB 蓝牙适配器(ELECOM LBT-UAN05C2/N)。
首先,我通过 GUI 连接蓝牙鼠标并成功。
但是,当我重新启动时,无法自动连接鼠标(systemctl log 显示Can't get HIDP connection info
)。
注意:鼠标已通过 bluetoothctl 获得信任。
因此,我启动终端并执行以下操作。
使用 bluetoothctl,我成功手动连接鼠标。
有没有办法自动连接鼠标?
$bluetoothctl
[NEW] Controller 00:1B:DC:0F:66:18 yumetodo-desktop [default]
[NEW] Device C8:47:82:27:DA:53 ELECOM BlueLED Mouse
Agent registered
[bluetooth]# devises
Invalid command
[bluetooth]# devices
Device C8:47:82:27:DA:53 ELECOM BlueLED Mouse
[bluetooth]# connect C8:47:82:27:DA:53
Attempting to connect to C8:47:82:27:DA:53
[CHG] Device C8:47:82:27:DA:53 Connected: yes
[CHG] Device C8:47:82:27:DA:53 Paired: yes
Connection successful
[CHG] Device C8:47:82:27:DA:53 ServicesResolved: yes
[ELECOM BlueLED Mouse]# exit
Agent unregistered
[DEL] Controller 00:1B:DC:0F:66:18 yumetodo-desktop [default]
$sudo systemctl status bluetooth
[sudo] yumetodo のパスワード:
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-08-02 19:39:51 JST; 19min ago
Docs: man:bluetoothd(8)
Main PID: 884 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 4915)
CGroup: /system.slice/bluetooth.service
└─884 /usr/lib/bluetooth/bluetoothd
8月 02 19:39:51 yumetodo-desktop systemd[1]: Starting Bluetooth service...
8月 02 19:39:51 yumetodo-desktop bluetoothd[884]: Bluetooth daemon 5.48
8月 02 19:39:51 yumetodo-desktop systemd[1]: Started Bluetooth service.
8月 02 19:39:51 yumetodo-desktop bluetoothd[884]: Starting SDP server
8月 02 19:39:51 yumetodo-desktop bluetoothd[884]: Bluetooth management interface 1.14 initialized
8月 02 19:56:49 yumetodo-desktop bluetoothd[884]: Endpoint registered: sender=:1.88 path=/MediaEndpoint/A2DPSource
8月 02 19:56:49 yumetodo-desktop bluetoothd[884]: Endpoint registered: sender=:1.88 path=/MediaEndpoint/A2DPSink
8月 02 19:57:45 yumetodo-desktop bluetoothd[884]: Can't get HIDP connection info
$/usr/lib/bluetooth/bluetoothd --version
5.48
$lsusb; dmesg | egrep -i 'blue|firm'
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 04bb:0121 I-O Data Device, Inc.
Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 002: ID 0461:4d0e Primax Electronics, Ltd
Bus 001 Device 005: ID 057b:0020 Y-E Data, Inc. HEXA Media Drive 6-in-1 Card Reader Writer
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[ 0.028000] Spectre V2 : Enabling Restricted Speculation for firmware calls
[ 0.061483] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[ 1.491444] [drm] Finished loading DMC firmware i915/skl_dmc_ver1_26.bin (v1.26)
[ 3.122022] Bluetooth: Core ver 2.22
[ 3.122032] Bluetooth: HCI device and connection manager initialized
[ 3.122033] Bluetooth: HCI socket layer initialized
[ 3.122035] Bluetooth: L2CAP socket layer initialized
[ 3.122037] Bluetooth: SCO socket layer initialized
[ 4.444418] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 4.444419] Bluetooth: BNEP filters: protocol multicast
[ 4.444421] Bluetooth: BNEP socket layer initialized
[ 1022.335434] Bluetooth: RFCOMM TTY layer initialized
[ 1022.335446] Bluetooth: RFCOMM socket layer initialized
[ 1022.335455] Bluetooth: RFCOMM ver 1.11
[ 1078.024770] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 1078.024778] Bluetooth: HIDP socket layer initialized
[ 1079.357890] input: ELECOM BlueLED Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/bluetooth/hci0/hci0:71/0005:056E:00E5.0002/input/input25
[ 1079.362031] hid-generic 0005:056E:00E5.0002: input,hidraw1: BLUETOOTH HID v1.29 Mouse [ELECOM BlueLED Mouse] on 00:1b:dc:0f:66:18
$dpkg -l | grep bluez
ii bluez 5.48-0ubuntu3.1 amd64 Bluetooth tools and daemons
ii bluez-cups 5.48-0ubuntu3.1 amd64 Bluetooth printer driver for CUPS
ii bluez-obexd 5.48-0ubuntu3.1 amd64 bluez obex daemon
$bluetoothctl --version
bluetoothctl: 5.48
$rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
$cat -n /etc/bluetooth/main.conf | grep AutoEnable
86 # AutoEnable defines option to enable all controllers when they are found.
89 AutoEnable=true
journalctl 日志如下:
9月 16 13:31:28 yumetodo-desktop kernel: hidraw: raw HID events driver (C) Jiri Kosina
9月 16 13:31:28 yumetodo-desktop bluetoothd[1019]: Can't get HIDP connection info
9月 16 13:31:28 yumetodo-desktop kernel: Bluetooth: HIDP (Human Interface Emulation) ver 1.2
9月 16 13:31:28 yumetodo-desktop kernel: Bluetooth: HIDP socket layer initialized
9月 16 13:31:29 yumetodo-desktop kernel: hid-generic 0005:056E:00E5.0001: unknown main item tag 0x0
9月 16 13:31:29 yumetodo-desktop kernel: input: ELECOM BlueLED Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/bluetooth/hci0/hci0:69/0005:
9月 16 13:31:29 yumetodo-desktop kernel: hid-generic 0005:056E:00E5.0001: input,hidraw0: BLUETOOTH HID v1.29 Mouse [ELECOM BlueLED Mouse] on 00:1b:dc:
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) config/udev: Adding input device ELECOM BlueLED Mouse (/dev/input/mouse0)
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) No input driver specified, ignoring this device.
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) This device may have been added with another device file.
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[1224]: (II) config/udev: Adding input device ELECOM BlueLED Mouse (/dev/input/mouse0)
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[1224]: (II) No input driver specified, ignoring this device.
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[1224]: (II) This device may have been added with another device file.
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) config/udev: Adding input device ELECOM BlueLED Mouse (/dev/input/event22)
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (**) ELECOM BlueLED Mouse: Applying InputClass "libinput pointer catchall"
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) Using input driver 'libinput' for 'ELECOM BlueLED Mouse'
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[1224]: (II) config/udev: Adding input device ELECOM BlueLED Mouse (/dev/input/event22)
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[1224]: (**) ELECOM BlueLED Mouse: Applying InputClass "libinput pointer catchall"
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[1224]: (II) Using input driver 'libinput' for 'ELECOM BlueLED Mouse'
9月 16 13:31:29 yumetodo-desktop upowerd[1185]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/bluetooth/hci0/hci0:6
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[1224]: (II) systemd-logind: got fd for /dev/input/event22 13:86 fd 27 paused 1
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[1224]: (II) systemd-logind: releasing fd for 13:86
9月 16 13:31:29 yumetodo-desktop upowerd[1185]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/bluetooth/hci0/h
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) systemd-logind: got fd for /dev/input/event22 13:86 fd 62 paused 0
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (**) ELECOM BlueLED Mouse: always reports core events
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (**) Option "Device" "/dev/input/event22"
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (**) Option "_source" "server/udev"
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) event22 - ELECOM BlueLED Mouse: is tagged by udev as: Mouse
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) event22 - ELECOM BlueLED Mouse: device is a pointer
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) event22 - ELECOM BlueLED Mouse: device removed
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) XINPUT: Adding extended input device "ELECOM BlueLED Mouse" (type: MOUSE, id
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (**) Option "AccelerationScheme" "none"
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (**) ELECOM BlueLED Mouse: (accel) selected scheme none/0
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (**) ELECOM BlueLED Mouse: (accel) acceleration factor: 2.000
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (**) ELECOM BlueLED Mouse: (accel) acceleration threshold: 4
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) event22 - ELECOM BlueLED Mouse: is tagged by udev as: Mouse
9月 16 13:31:29 yumetodo-desktop /usr/lib/gdm3/gdm-x-session[2137]: (II) event22 - ELECOM BlueLED Mouse: device is a pointer
在 Windows 10 上也出现了同样的问题,ElECOM 支持人员给出了如下说明,并且运行正常。
- 在 Windows 设备管理器中,蓝牙 > 通用蓝牙无线电。打开属性,选择电源管理选项卡,取消选中
Allow the computer to turn off this device to save power
- 在 Windows 控制面板中,电源设置 > 当前计划
Change power plan settings
>Change advanced power settings
> USB 设置 > USB 选择性挂起设置,禁用选择性挂起。 - 删除鼠标设置并重新连接
Ubuntu 有类似电源管理设置的东西吗?
我已经尝试过以下帖子:
答案1
在 Ubuntu 上
$sudo apt install chntpw
- 通过 GUI 配对鼠标
- 重启电脑
在 Windows 上
- 通过 GUI 配对鼠标
- 在管理员控制台上,
powercfg.exe /hibernate off
- 重启电脑
在 Ubuntu 上
- 挂载 Windows C 盘
- 调查蓝牙接口 ID
就我而言,就是这样$bluetoothctl Agent registered [CHG] Controller A4:C3:F0:88:90:45 Pairable: yes [ELECOM BlueLED Mouse]# exit
A4:C3:F0:88:90:45
。 - 使用以下方式调查鼠标蓝牙 ID
chntpw
在几乎所有情况下,您都应该注意chntpw version 1.00 140201, (c) Petter N Hagen Hive </media/yumetodo/4C7E6CE87E6CCC70/Windows/System32/config/SYSTEM> name (from header): <SYSTEM> ROOT KEY at offset: 0x001020 * Subkey indexing type is: 686c <lh> File size 24379392 [1740000] bytes, containing 5276 pages (+ 1 headerpage) Used for data: 372635/23536872 blocks/bytes, unused: 87/38808 blocks/bytes. Simple registry editor. ? for help. > > ls Node has 17 subkeys and 0 values key name <ActivationBroker> <ControlSet001> <DriverDatabase> <HardwareConfig> <Input> <Keyboard Layout> <Maps> <MountedDevices> <ResourceManager> <ResourcePolicyStore> <RNG> <Select> <Setup> <Software> <State> <WaaS> <WPA> > cd ControlSet001 \ControlSet001> cd Service\BTHPORT \ControlSet001\Services\BTHPORT> cd Parameters\Keys (...)\Services\BTHPORT\Parameters\Keys> ls Node has 2 subkeys and 0 values key name <001bdc0f6618> <a4c3f0889045> (...)\Services\BTHPORT\Parameters\Keys> cd a4c3f0889045 (...)\BTHPORT\Parameters\Keys\a4c3f0889045> ls Node has 0 subkeys and 1 values size type value name [value if type DWORD] 16 3 REG_BINARY <c8478227da53> (...)\BTHPORT\Parameters\Keys\a4c3f0889045> hex c8478227da5. cat_vk: No such value <c8478227da5.> (...)\BTHPORT\Parameters\Keys\a4c3f0889045> hex c8478227da53 Value <c8478227da53> of type REG_BINARY (3), data length 16 [0x10] :00000 08 57 94 6B D5 43 8B 13 30 0E 90 A8 1B 43 ED C7 .W.k.C..0....C..
ControlSet001
。但是,ControlSet002
还有另一种可能性。a4c3f0889045
是在步骤 8 中调查的蓝牙接口 ID。08 57 94 6B D5 43 8B 13 30 0E 90 A8 1B 43 ED C7
正是我想要的。 - 编辑蓝牙配置
$sudo nano "/var/lib/bluetooth/A4:C3:F0:88:90:45/C8:47:82:27:DA:53"/info
[General] Name=ELECOM BlueLED Mouse Class=0x000580 SupportedTechnologies=BR/EDR; Trusted=true Blocked=false Services=00001000-0000-1000-8000-00805f9b34fb;00001124-0000-1000-8000-00805f9b34fb;00001200-0000-1000-8000-00805f9b34fb; [LinkKey] Key=0857946BD5438B13300E90A81B43EDC7 Type=4 PINLength=0 [DeviceID] Source=2 Vendor=1390 Product=229 Version=297
Key
用LinkKey
步骤 9 中调查的值 替换。 $sudo systemctl restart bluetooth
- 现在,鼠标已经被Ubuntu识别了。
- 重启电脑
在 Windows 上
- 现在,Windows 已经识别鼠标了。
- 在管理员控制台上,
powercfg.exe /hibernate on
參考文獻: