在Ubuntu 18.04系统中蓝牙鼠标连接失败问题的解决

时间:2021-01-22 15:38:19
2018-08-22 16:00:35作者:谖瓞稿源:linux站

如果你在Ubuntu 18.04操作系统中有蓝牙鼠标连接失败问题,那就参考下面的解决方法处理。

解决方法

首先在系统终端下输入:

bluetoothctl

然后输入:

list

看清除 Controller 的 mac 地址,我的是 AC:2B:6E:91:65:4E,在终端输入:

select AC:2B:6E:91:65:4E

然后输入:

show

此时确保你的鼠标配对已打开,处于可被发现状态,输入:

scan on

在输出信息中找到你的鼠标后,即可输入:

scan off

并记下你鼠标的mac地址,如果你的鼠标连接时要求 pin code,则输入以下命令,若不用则跳过这一条(当然不确定的话需不需要 pin code 就执行一下,也没什么影响的)。

agent on

接下来使用上一条记下的鼠标mac地址,输入:

pair DC:2C:26:AE:35:41

出现 Pairing successful,即配对成功,中间要求 pin code, 就输入对应 pin code即可。这时配对成功,但是鼠标还不能操作,依次输入:

connect DC:2C:26:AE:35:41

trust DC:2C:26:AE:35:41

鼠标即可正常使用了。

参考:Bluetooth Mouse Won't Connect after Reboot - Ubuntu 18.04 LTS

device: Bluetooth Mouse M336/M337/M535

problem: mouse won't pair after restarting computer

resolution:

I have also included them below along with the additional steps I needed to perform.

// open up a command prompt and use the bluetoothctl command

// list the available bluetooth controllers

# bluetoothctl

[bluetooth]# list

Controller 01:23:45:67:89:AB fzidpc73

// choose the controller to work with

[bluetooth]# select 01:23:45:67:89:AB

// show/display the controller details

bluetooth]# show

Controller 01:23:45:67:89:AB

Name: fzidpc73

Alias: fzidpc73-0

Class: 0x000000

Powered: no

Discoverable: no

Pairable: yes

UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)

UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)

UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)

UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)

UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)

Modalias: usb:v1D6Bp0246d0517

Discovering: no

[bluetooth]# power on

[CHG] Controller 01:23:45:67:89:AB Class: 0x000104

Changing power on succeeded

[CHG] Controller 01:23:45:67:89:AB Powered: yes

// scan for bluetooth devices (make sure your mouse is in discovery mode before running this command)

[bluetooth]# scan on

Discovery started

[CHG] Controller 01:23:45:67:89:AB Discovering: yes

[NEW] Device 34:88:5D:87:C0:A6 Bluetooth Mouse M336/M337/M535

[bluetooth]# scan off

Discovery stopped

[CHG] Controller 01:23:45:67:89:AB Discovering: no

// turn the agent on just incase you need to supply a pin code[bluetooth]# agent on

Agent registered

// note that the device might not ask you for a pin code

[bluetooth]# pair 34:88:5D:87:C0:A6

Attempting to pair with 34:88:5D:87:C0:A6

[CHG] Device 34:88:5D:87:C0:A6 Connected: yes

Request PIN code

[agent] Enter PIN code: 1234

[CHG] Device 34:88:5D:87:C0:A6 UUIDs:

00001101-0000-1000-8000-00805f9b34fb

[CHG] Device 34:88:5D:87:C0:A6 Paired: yes

Pairing successful

[CHG] Device 34:88:5D:87:C0:A6 Connected: no

// once you have done this use the following two commands to

// complete setup

[bluetooth]# connect 34:88:5D:87:C0:A6

...

[bluetooth]# trust 34:88:5D:87:C0:A6

...

// your mouse should now work properly even after the computer has been restarted.