Ubuntu连接AirPods耳机
有时想让Ubuntu电脑连接AirPods2耳机,最近重装系统后,遇到无法配对耳机的情况,特此记录下摸索过程,AirPods其他型号没有试过,没设备测试(最近新购买了AirPods Pro 2nd Generation,经测试,二代照这方法也是可以匹配到的),方法应该大同小异。
首先,更改控制模式为ControllerMode = bredr,可能值为: "dual", "bredr", "le", 一种不行的话,换其它模式试试
➜ ~ egrep -v '^#|^$' /etc/bluetooth/main.conf
[General]
ControllerMode = bredr
[Policy]
AutoEnable=true
其次,重启bluetooth服务
sudo systemctl restart bluetooth.service
此时,如果你的设备,可通过Gnome Settings的bluetooth页直接识别并匹配的话,下面的步骤作用不大,看看就好。
图形界面无法匹配时,终端操作
1. 开启蓝牙交互控制工具(interactive bluetooth control tool)
➜ ~ bluetoothctl
Agent registered
[CHG] Device F4:F5:DB:65:B0:3B RSSI: -73
[CHG] Device 4C:D1:A1:3F:B2:55 RSSI: -79
[CHG] Device 94:87:E0:A1:89:49 RSSI: -72
[CHG] Device A0:A4:C5:04:43:17 RSSI: -77
[CHG] Device B4:CB:57:16:D5:80 RSSI: -82
2. 扫描设备 scan on, 扫描的时候按住AirPods2背后的匹配按钮
when you begin scan devices, remeber press the AirPods2 button on the back
[bluetooth]# scan on
Discovery started
[NEW] Device 44:66:FC:9C:CC:FC 44-66-FC-9C-CC-FC
[NEW] Device C4:E1:A1:AC:C0:6A C4-E1-A1-AC-C0-6A
[CHG] Device 00:A6:19:18:52:86 RSSI: -69
[NEW] Device 7C:9A:1D:B0:62:02 AirPods
[NEW] Device A4:50:46:BA:7F:49 A4-50-46-BA-7F-49
所在环境设备很多的时候,貌似没有什么好的办法过滤,需要仔细观察自己的设备名,如上所示,我的airpod2设备已经成功识别
[NEW] Device 7C:9A:1D:B0:62:02 AirPods
3. 连接AirPods2 (connect AirPods2)
[bluetooth]# connect 7C:9A:1D:B0:62:02
Attempting to connect to 7C:9A:1D:B0:62:02
[CHG] Device 7C:9A:1D:B0:62:02 ServicesResolved: yes
[CHG] Device 7C:9A:1D:B0:62:02 Paired: yes
Connection successful
[AirPods]#
Haha, it works !
4. 看看设备信息(AirPods2 info)
[AirPods]# info 7C:9A:1D:B0:62:02
Device 7C:9A:1D:B0:62:02 (public)
Name: AirPods
Alias: AirPods
Class: 0x00240418
Icon: audio-headphones
Paired: yes
Trusted: no
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Vendor specific (74ec2172-0bad-4d01-8f77-997b2be0722a)
Modalias: bluetooth:v004Cp200Fd9047
5. 下次再连时,先通过devices命令查询设备地址,地址会被记住一段时间(此时图形界面连接的方式应该也可以使用)
next time, if your devices offline, just get device address, connect it again
[AirPods]# devices
Device 7C:9A:1D:B0:62:02 AirPods
Device AC:49:DB:4E:39:41 mephisto
查看帮助信息,可以试试额外的控制功能,这里不再演示:
[AirPods]# help
Menu main:
Available commands:
-------------------
advertise Advertise Options Submenu
monitor Advertisement Monitor Options Submenu
scan Scan Options Submenu
gatt Generic Attribute Submenu
admin Admin Policy Submenu
list List available controllers
show [ctrl] Controller information
select <ctrl> Select default controller
devices List available devices
paired-devices List paired devices
system-alias <name> Set controller alias
reset-alias Reset controller alias
power <on/off> Set controller power
pairable <on/off> Set controller pairable mode
discoverable <on/off> Set controller discoverable mode
discoverable-timeout [value] Set discoverable timeout
agent <on/off/capability> Enable/disable agent with given capability
default-agent Set agent as the default one
advertise <on/off/type> Enable/disable advertising with given type
set-alias <alias> Set device alias
scan <on/off/bredr/le> Scan for devices
info [dev] Device information
pair [dev] Pair with device
cancel-pairing [dev] Cancel pairing with device
trust [dev] Trust device
untrust [dev] Untrust device
block [dev] Block device
unblock [dev] Unblock device
remove <dev> Remove device
connect <dev> Connect device
disconnect [dev] Disconnect device
menu <name> Select submenu
version Display version
quit Quit program
exit Quit program
help Display help about this program
export Print environment variables
以上主要针对图形界面操作无效时的状况,希望对你有所帮助
相关文章:
- Ubuntu notify-send 定时通知
- Rime输入法引擎和四叶草输入方案
- k8s的startupProbe探针中initialDelaySeconds是否有效
- zfs镜像功能测试
- Linux和iPhone互传文件
- Nginx webdav for Joplin
- Ubuntu 安装LDAP客户端
- lvs端部署
- alacritty 终端使用
- 搭建树莓派无线路由器