Page cover image

解决多系统蓝牙配对问题

  • bluetooth
Date
Oct 23, 2022
Description
Public
Public
Published
Tags
bluetooth
URL
 
可能大家遇到过切换另一个系统之后,
 
原系统配对的蓝牙设备就连接不上了
 
除非重新配对
 

通用方案

开始看万能的 Arch Wiki
 
 

同步方案

 
为什么不能直接一键同步呢?
 
还真找到个用于同步 KEY 的项目
 
bt-dualboot
x2esUpdated Nov 26, 2022
 
发现 AUR 里没有, 于是自己打包了一个
 
 
遇到这种源里没有的 python 模块, 尤其是需要 sudo 运行的
 
可以参考这篇文章来编写 PKGBUILD
 
打包好尝试运行…出现了以下报错
Config parser error: no LinkKey section
Updated Nov 24, 2022
 
上游的问题…还是等它修吧
 
打算按照这个 PR 改一下试试
Do not crash on devices without a LinkKey
Updated Sep 21, 2022
 
搞定了…
 
$ sudo bt-dualboot -l WARNING: Following devices paired on Linux for multiple BT-adapters: { .join(problem_devices_macs)} WARNING: Following devices paired on Windows for multiple BT-adapters: { .join(problem_devices_macs)} Needs sync ========== Following devices available for sync with `--sync-all` or `--sync MAC` options. [34:82:C5:3D:A6:38] Galaxy Buds+ (A638) [DC:2C:26:0A:6F:67] Keychron K8 Have to be paired in Windows ============================ Following devices unavailable for sync unless you boot Windows and pair them [40:26:19:DF:2B:21] 郑xx的AirPods [D8:B0:53:2A:DC:17] Xiaomi Pad 5 [FC:58:FA:25:7F:D2] Crosley CR8005D
 
开始同步
 
sudo bt-dualboot --sync-all -b > BACKUP /run/media/icepie/14CEFE8FCEFE67FE/Windows/System32/config/SYSTEM to /var/backup/bt-dualboot/SYSTEM-2022-10-23--11-34-38 WARNING: Following devices paired on Linux for multiple BT-adapters: { .join(problem_devices_macs)} WARNING: Following devices paired on Windows for multiple BT-adapters: { .join(problem_devices_macs)} Syncing... ========== [34:82:C5:3D:A6:38] Galaxy Buds+ (A638) [DC:2C:26:0A:6F:67] Keychron K8 WARNING: Following devices paired on Linux for multiple BT-adapters: { .join(problem_devices_macs)} WARNING: Following devices paired on Windows for multiple BT-adapters: { .join(problem_devices_macs)} Traceback (most recent call last): File "/usr/bin/bt-dualboot", line 8, in <module> sys.exit(main()) File "/usr/lib/python3.10/site-packages/bt_dualboot/cli/app.py", line 342, in main app.run() File "/usr/lib/python3.10/site-packages/bt_dualboot/cli/app.py", line 262, in run self.sync_all() File "/usr/lib/python3.10/site-packages/bt_dualboot/cli/app.py", line 242, in sync_all sync_manager.push(devices_for_push, dry_run=self.is_dry_run()) File "/usr/lib/python3.10/site-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 254, in push self._update_windows_registry(devices_for_update) File "/usr/lib/python3.10/site-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 210, in _update_windows_registry pairing_key = hex_string_to_reg_value(device.pairing_key) File "/usr/lib/python3.10/site-packages/bt_dualboot/bt_windows/convert.py", line 87, in hex_string_to_reg_value value = ",".join(hex_string_to_pairs(hex_string.lower())) AttributeError: 'NoneType' object has no attribute 'lower'
 
敲…又报错了….有空再折腾了