-----------------------  update @ 2018-07-27 ---------------------

quick start

1.  systemctl start buletooth

2. bluetoothctl

3. scan on

发现鼠标后.

4. scan off

5. connect 4D:7D:96:B0:79:72

6. pair 4D:7D:96:B0:79:72

7. trust 4D:7D:96:B0:79:72

完.

-------------------------------------------------------------

去年地摊买的破无线鼠标坏掉了。看上微软的Designer Mouse蓝牙鼠,但是买之前我要确认我能不能驱起来。

这款鼠标只支持蓝牙4.0。系统支持windows8以上,不支持xp和windows7. 其他系统支持mac和android,没写linux。

由于之前也没搞过蓝牙设备,所以需要了解一下linux下的蓝牙设备。然后在解决鼠标的问题。

需要解决的问题:

1. archlinux下蓝牙设备的使用与配置

2. 确定T450的蓝牙版本。

3. 驱鼠标。

首先,按照惯例还是读一下万事万灵的archlinux文档

0. 插叙一部分其他内容。

  a. rfkill 用以控制无线设备的软开关,功能与键盘上边的快捷键Fn+WiFi,Fn+BT相同。演示如下:

[tong@T7 ~]$ rfkill list
: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
[tong@T7 ~]$ rfkill block
[tong@T7 ~]$ rfkill list
: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: yes
Hard blocked: no
: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
[tong@T7 ~]$ rfkill block
[tong@T7 ~]$ rfkill list
: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: yes
Hard blocked: no
: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
[tong@T7 ~]$ ip link
: lo: <LOOPBACK,UP,LOWER_UP> mtu qdisc noqueue state UNKNOWN mode DEFAULT group default qlen
link/loopback ::::: brd :::::
: lan0: <BROADCAST,MULTICAST> mtu qdisc noop state DOWN mode DEFAULT group default qlen
link/ether :7b:9d:5c:1e:9b brd ff:ff:ff:ff:ff:ff
: wlan0: <BROADCAST,MULTICAST> mtu qdisc mq state DOWN mode DORMANT group default qlen
link/ether dc:::6c:b5:7e brd ff:ff:ff:ff:ff:ff
: internal-br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu qdisc noqueue state UNKNOWN mode DEFAULT group default qlen
link/ether :e4:a6:::9b brd ff:ff:ff:ff:ff:ff
[tong@T7 ~]$ rfkill unblock
[tong@T7 ~]$ ip link
: lo: <LOOPBACK,UP,LOWER_UP> mtu qdisc noqueue state UNKNOWN mode DEFAULT group default qlen
link/loopback ::::: brd :::::
: lan0: <BROADCAST,MULTICAST> mtu qdisc noop state DOWN mode DEFAULT group default qlen
link/ether :7b:9d:5c:1e:9b brd ff:ff:ff:ff:ff:ff
: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu qdisc mq state UP mode DORMANT group default qlen
link/ether dc:::6c:b5:7e brd ff:ff:ff:ff:ff:ff
: internal-br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu qdisc noqueue state UNKNOWN mode DEFAULT group default qlen
link/ether :e4:a6:::9b brd ff:ff:ff:ff:ff:ff
[tong@T7 ~]$ rfkill list
: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: yes
Hard blocked: no
: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
[tong@T7 ~]$ rfkill unblock
[tong@T7 ~]$ rfkill list
: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
[tong@T7 ~]$

1. 使用lsusb命令查看蓝牙设备,我是使用 -v 参数查看到详细信息后最终确定才确定了 Bus2 Device5是蓝牙设备。关于蓝牙设备相关的知识,还需要深入的学习。

在使用lsusb命令前,首先应该使用rfkill命令unblock蓝牙开关(tpacpi_bluetooth_sw),之后才能在lsusb中可见。

[tong@T7 ~]$ lsusb
Bus Device : ID : Intel Corp.
Bus Device : ID 1d6b: Linux Foundation 2.0 root hub
Bus Device : ID 1d6b: Linux Foundation 3.0 root hub
Bus Device : ID 04f2:b449 Chicony Electronics Co., Ltd
Bus Device : ID :0a2a Intel Corp.
Bus Device : ID 138a: Validity Sensors, Inc. Fingerprint Reader
Bus Device : ID 1d6b: Linux Foundation 2.0 root hub
[tong@T7 ~]$

2. 查看驱动,蓝牙设备由 btusb 驱动。

[tong@T7 ~]$ lsmod |grep ^btusb
btusb
[tong@T7 ~]$ modinfo btusb
filename: /lib/modules/4.7.--ARCH/kernel/drivers/bluetooth/btusb.ko.gz
license: GPL
version: 0.8
description: Generic Bluetooth USB driver ver 0.8
... ...

3. 管理程序,蓝牙设备由软件包bluez (linux蓝牙协议栈实现之一) 进行管理。

[tong@T7 ~]$ pacman -Qii bluez
Name : bluez
Version : 5.42-
Description : Daemons for the bluetooth protocol stack
Architecture : x86_64
URL : http://www.bluez.org/
... ...
UNMODIFIED /etc/dbus-/system.d/bluetooth.conf
UNMODIFIED /etc/bluetooth/main.conf
[tong@T7 ~]$ pacman -Ql bluez
bluez /etc/bluetooth/main.conf
bluez /etc/dbus-/system.d/bluetooth.conf
bluez /usr/lib/bluetooth/bluetoothd
bluez /usr/lib/systemd/system/bluetooth.service
... ...
bluez /usr/share/man/man8/bluetoothd..gz
[tong@T7 ~]$

根据配置文件 bluetooth.conf 中的设置,使用bluetoothd的用户需要加入 ‘lp’ 用户组。

[tong@T7 ~]$ groups
lp wheel docker tong
[tong@T7 ~]$ systemctl start bluetooth
[tong@T7 ~]$

发现报错如下:(ERROR 1)

[tong@T7 ~]$ systemctl status bluetooth 
● bluetooth.service - Bluetooth service
  Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled; vendor preset: disabled)
  Active: active (running) since Fri 2016-10-07 22:32:47 CST; 16min ago
    Docs: man:bluetoothd(8)
Main PID: 570 (bluetoothd)
  Status: "Running"
   Tasks: 1 (limit: 4915)
  CGroup: /system.slice/bluetooth.service
          └─570 /usr/lib/bluetooth/bluetoothd
Oct 07 22:32:47 T7 systemd[1]: Starting Bluetooth service...
Oct 07 22:32:47 T7 bluetoothd[570]: Bluetooth daemon 5.42
Oct 07 22:32:47 T7 systemd[1]: Started Bluetooth service.
Oct 07 22:32:47 T7 bluetoothd[570]: Starting SDP server
Oct 07 22:32:47 T7 bluetoothd[570]: Bluetooth management interface 1.12 initialized
Oct 07 22:32:47 T7 bluetoothd[570]: Failed to obtain handles for "Service Changed" characteristic
Oct 07 22:32:47 T7 bluetoothd[570]: Sap driver initialization failed.
Oct 07 22:32:47 T7 bluetoothd[570]: sap-server: Operation not permitted (1)
[tong@T7 ~]$

KDE图型化配置工具 bluedevil。在发生上面的这个错误之后,有手机s7e进行测试,手机可以接收电脑发送的文件,电脑不能对手机发起链接,每次点击connect按钮错误信息如下:(ERROR 2)

Oct 07 23:30:28 T7 bluetoothd[8666]: a2dp-source profile connect failed for xxx:93:D4: Protocol not available
Oct 07 23:30:59 T7 bluetoothd[8666]: a2dp-source profile connect failed for xxxx93:D4: Protocol not available

a2dp 全名Advanced Audio Distribution Profile,大概因为手机默认会使用这种音频传输,所以由于电脑不支持导致了问题。 从 文档的audio章节 得到的内容,可以尝试安装音频包  pulseaudio-bluetooth 。 安装后果然可以成功connect了。链接成功之后,电脑会自动播放手机的音频。然而手机主动推送给电脑的文件,仍然不能正确接受。

ERROR 1 的错误仍然存在,先rfkill unblock就会打印ERROR 1. 先启动再unblock,就不会打印。当unblock时才打印。23333。

Oct  :: T7 plasmashell[]: file:///usr/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/logic.js:34: TypeError: Cannot read property 'devices' of undefined
Oct :: T7 plasmashell[]: file:///usr/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/logic.js:34: TypeError: Cannot read property 'devices' of undefined
Oct :: T7 plasmashell[]: file:///usr/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/logic.js:34: TypeError: Cannot read property 'devices' of undefined
Oct :: T7 plasmashell[]: file:///usr/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/logic.js:34: TypeError: Cannot read property 'devices' of undefined
Oct :: T7 plasmashell[]: file:///usr/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/logic.js:34: TypeError: Cannot read property 'devices' of undefined
Oct :: T7 plasmashell[]: file:///usr/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/logic.js:34: TypeError: Cannot read property 'devices' of undefined

跟踪了日志,不能上传文件,看似是UI程序的问题。可以忽略,使用命令行工具继续测试。

4. 命令行配置工具 bluetoothctl , 通过安装工具包 bluez-utils。

  a. 启动服务

[tong@T7 ~]$ sudo systemctl start bluetooth
[tong@T7 ~]$ rfkill unblock

  b. 使用 bluetoothctl

Start the bluetoothctl interactive command. There one can input help to get a list of available commands.
  1. Turn the power to the controller on by entering power on. It is off by default.
  2. Enter devices to get the MAC Address of the device with which to pair.
  3. Enter device discovery mode with scan on command if device is not yet on the list.
  4. Turn the agent on with agent on.
  5. Enter pair MAC Address to do the pairing (tab completion works).
  6. If using a device without a PIN, one may need to manually trust the device before it can reconnect successfully. Enter trust MAC Address to do so.
  7. Finally, use connect MAC_address to establish a connection.

连接成功了,但是文件传输过程中,仍然各种报错,除了 sdptool browse 20:2D:xxxxxx 成功意外,其他方式 (obexfs, obexftp, ussp-push) 都不能成功。

在bluetoothctl 中有如下报错信息:

[bluetooth]# connect :xxxD4
Attempting to connect to :xxxxx:D4
[CHG] Device :xxxxx:D4 Connected: yes
[CHG] Device :xxxxx:D4 ServicesResolved: yes
Failed to connect: org.bluez.Error.NotAvailable
[CHG] Device :xxxxx:D4 ServicesResolved: no
[CHG] Device :xxxxx:D4 Connected: no
[bluetooth]# connect :xxxxx:D4
Attempting to connect to :xxxxx:D4
[CHG] Device :xxxxx:D4 Connected: yes
[CHG] Device :xxxxx:D4 ServicesResolved: yes
Failed to connect: org.bluez.Error.Failed
[CHG] Device :xxxxx:D4 ServicesResolved: no
[CHG] Device :xxxxx:D4 Connected: no
[CHG] Device :xxxxx:D4 Connected: yes
[CHG] Device :xxxxx:D4 Connected: no
[bluetooth]#

journal里有如下信息:

Oct  :: T7 sudo[]: pam_unix(sudo:session): session closed for user root
Oct :: T7 bluetoothd[]: :xxxxx:D4: error updating services: Connection timed out ()
Oct :: T7 bluetoothd[]: Unable to get a audio source object
Oct :: T7 bluetoothd[]: Unable to get a audio source object
Oct :: T7 bluetoothd[]: :xxxxx:D4: error updating services: Connection timed out ()
Oct :: T7 bluedevil-sendfile[]: bluedevil.sendfile: Device "/org/bluez/hci0/dev_20_xxxx_D4"
Oct :: T7 bluedevil-sendfile[]: bluedevil.sendfile: Files ()
Oct :: T7 bluedevil-sendfile[]: bluedevil.sendfile: Manager initialized
Oct :: T7 bluedevil-sendfile[]: BluezQt: PendingCall Error: "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken."
Oct :: T7 bluedevil-sendfile[]: bluedevil.sendfile: Error creating session "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken."
Oct :: T7 bluedevil-sendfile[]: bluedevil.sendfile: Initialize Fail Page
Oct :: T7 obexd[]: Unable to find service record
Oct :: T7 bluedevil-sendfile[]: bluedevil.sendfile: Wizard done:

暂时放弃了。。。

蓝牙版本:也学是从这里看吧?!反正看见了4.2

[tong@T7 ~]$ hciconfig -a
hci0: Type: Primary Bus: USB
BD Address: DC:::6C:B5: ACL MTU: : SCO MTU: :
UP RUNNING PSCAN ISCAN
RX bytes: acl: sco: events: errors:
TX bytes: acl: sco: commands: errors:
Features: 0xff 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF
Link mode: SLAVE ACCEPT
Name: 'T7'
Class: 0x1c010c
Service Classes: Rendering, Capturing, Object Transfer
Device Class: Computer, Laptop
HCI Version: 4.2 (0x8) Revision: 0x1000
LMP Version: 4.2 (0x8) Subversion: 0x1000
Manufacturer: Intel Corp. ()

最后,管他驱不驱得起,买了再说!

到货! 哪里需要那么复杂,只要打开 bluetooth.service 然后在KDE状态栏配对连接就ok了。马上可用!

长时间使用会不会断啊,什么之类的,还有在观察,有问题以后更新。

简单评价一下这个 鼠。外观设计真的超赞,价钱也不贵。电池藏磁吸附设计,电池的触点也非常的特别。感觉每一个细节都是精心的设计。滑轮的手感我个人不太喜欢,但是也还好。缺点说实在的在于手感。因为这种扁平的设计,当你把手放在鼠标上的时候,手指是悬空的没有支持,并不舒服。当然这一点我在买之前就已经想到了。毕竟在完美好看的外观面前,舒适又算什么呢?2333.

上照一张,附带我提前衰老的爪。

过一段时间,补充稳定性等问题,并补充开关机自动识别之类的设置。等不及了,我要开始体验了。

(2个小时以后)。。。

这么快就回来补充配置了。

第一步,rfkill,rfkill的配置是重启保留的,即如果你之前是block的,关完机再开机它还是block的。如果你之前是unblock的,你关完机再开机它还是unblock的。

第二步,bluez(即守护进程bluetoothd)。使用 systemctl enable bluetooth 设置成开机启动。

第三步,bluetoothctl。依据前文提到的操作,顺序执行 pair, trust, connect. 之后就可以顺利使用了。

  然后,当我退出bluetoothctl时,实际上关于bluetoothctl的这些配置就都失效了。即蓝牙鼠标的关联是断开的。当我把x状态保留在display manager没有登录之前时,就可以测试鼠标的这一时效状态。但是login进入kde之后,鼠标又好使了,因为这个时候kde启动了bluedevil程序用以蓝牙管理。而它会继承之前在bluetoothctl中对蓝牙设备进行的配对等操作。所以在无人工配置的情况下,不进入KDE,蓝牙鼠标就不能用。而这一点我是可以接受的,因为不进KDE,要鼠标又有什么用呢? 当然,FVWM下想必也不好使,这个可以留到之后在处理了。

最后,完成了以上三步之后,在KDE环境里,蓝牙鼠就是完美可用状态。out of box。只要在鼠标上打开开关。在电脑上打开开关(rfkill)。无论重启或开机,或怎么,随时可用,

完,: )

Update @ 20161028

这一周恢复了正常上下班活动,在公司也增加了鼠标的使用频率,有了一些进一步的使用体验,虽然还有小红点。

在左键点击的时候,偶尔会出现塑料与塑料之间摩擦的‘吱吱’的声音,影响使用体验,单击动作也相应的不够干脆清爽。整体上,有一种廉价的质感,有一种做工不精良的感觉。

update @ 20170703

换了新电脑,重新pair鼠标

[root@T7 ~]# bluetoothctl 

不太好用,最后在plasma UI里面莫名其妙的成功了。

[daily][device][bluetooth] 蓝牙怎么办!(archlinux下驱动蓝牙鼠标,以及三星手机)的更多相关文章

  1. ARM&Linux 下驱动开发第二节

    驱动文件:qudong.c,make生成qudong.ko文件,烧录到ARM板上 #include<linux/init.h> #include<linux/module.h> ...

  2. Archlinux下i3wm与urxvt的配置

    前段时间学习了GitHub的两位前辈:Airblader和wlh320.他们的相关教程在https://github.com/Airblader/i3和https://github.com/wlh32 ...

  3. 解决 ArchLinux 下中文 Chinese 不能输入 couldnt input 的问题

    解决 ArchLinux 下中文 Chinese 不能输入 couldnt input 的问题 一.Question 一年多的 ArchLinux 用户再次回归.然鹅,见面礼就是终端不能输入中文. 在 ...

  4. Archlinux 下的 VMWare Workstation 维护笔记

    印象中 Archlinux 下的 VMWare Workstation 总是出问题, 因此写这个帖子, 记录出问题时间/原因/解决方案. PS: 每次更新内核后可能需要重新编译 vmware 的内核模 ...

  5. [archlinux][tls] archlinux下使curl支持sslv3的方法

    描述 在archlinux下,希望使用curl产生一条使用sslv3的https访问请求. 使用curl的如下命令: curl -k -vvv --sslv3 https://192.168.7.9: ...

  6. ArchLinux下electronssr无法启动的解决措施

    ArchLinux下electronssr无法启动的解决措施 今天重新配置electron-ssr时发现闪退(无法启动). 于是开始查错 首先是找到了目录位置 /usr/electron-ssr/el ...

  7. Windows7下驱动开发与调试体系构建——0.概述

    本文集内容为windows7x64下驱动开发与调试体系构建,内容目录如下: 1.驱动开发的环境准备 2.R3与R0的通信示例 3.自建调试体系概述 4.在x64下使用汇编代码 5.实战反调试标记位(N ...

  8. [daily][device][archlinux][trackpoint] 修改指点杆速度/敏捷度

    修改指点杆速度,敏捷度: [root@T7 ~]# echo > /sys/devices/platform/i8042/serio1/serio2/sensitivity [root@T7 ~ ...

  9. Mac下驱动BCM20702A0 USB蓝牙

    偶然高了一个USB蓝牙,查到Mac下能识别,无法驱动,就去找了一下.方法很简单,就是把蓝牙的PID和VID加入到驱动里边去,具体方法和步骤如下: 1. 进入到/System/Libary/Extens ...

随机推荐

  1. 【codevs1191】数轴染色 线段树 区间修改+固定区间查询

    [codevs1191]数轴染色 2014年2月15日4317 题目描述 Description 在一条数轴上有N个点,分别是1-N.一开始所有的点都被染成黑色.接着我们进行M次操作,第i次操作将[L ...

  2. 【vijos1066】弱弱的战壕 线段树

    描述 永恒和mx正在玩一个即时战略游戏,名字嘛~~~~~~恕本人记性不好,忘了-_-b. mx在他的基地附近建立了n个战壕,每个战壕都是一个独立的作战单位,射程可以达到无限(“mx不赢定了?!?”永恒 ...

  3. 帧动画FrameAnimation

    <!-- 布局 --> <item android:drawable="@drawable/girl_1" android:duration="100& ...

  4. 2016.6.17 计算机网络复习要点之PPP协议

    点对点协议PPP是目前使用最广泛的数据链路层协议. 1.PPP协议的特点: **我们知道因特网用户通常需要连接到某个ISP才能接入到因特网,PPP协议就是用计算机和ISP进行通信时所使用的数据链路层协 ...

  5. SU suacor命令学习

    前段时间事情忙,今天才更新.

  6. bug记录

    1>-[DYMessageNewsTableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:]: row (37 ...

  7. MVC RenderSection

    简要使用介绍 @RenderSection在母版页中占个位,然后让使用此母版页的子页自己去呈现他们的Section. 在母版页_Layout.cshtml中定义@RenderSection(" ...

  8. netstat -an 提示:不是内部或外部命令

      输入cmd,点击确定按钮:   进入dos操作界面效果:   然后输入netstat -an 然后回车,查看端口: 5 如果输入:netstat -an,提示:不是内部或外部命令,也不是可运行的程 ...

  9. WPF 碰撞检测

    have tested this, it worked, at least for me var x1 = Canvas.GetLeft(e1); var y1 = Canvas.GetTop(e1) ...

  10. DevExpress DXperience 的ASPxFilterControl 不显示 Like 菜单的方法

    当使用Linq 作为数据源时,如果使用 ASPxFilterControl 的 Like 菜单筛选数据,就会出现以下错误 LINQ to Entities does not recognize the ...