x2es/bt-dualboot

Report OS support

x2es opened this issue · 10 comments

x2es commented

If you get any success or fail results for OS not listed in Supported OS report it here please.

This script worked flawlessly for me using Ubuntu 22.04 LTS and Windows 10.

I was able to pair Dualshock 4, Dualsense 5 and WH-1000XM4 using Arch Linux v.5.18.1 and Windows 10 v.21H2.

I was able to pair my Sony WH-1000XM3 headphones and Logitec K380 keyboard with Fedora 36 and Windows 10 22H2.

J3RN commented

I'm using Fedora Silverblue 37 and Windows 10 (I'll update the version shortly). I was ultimately unsuccessful with using the script. First, the script crashed because evidently the info file for my Logitech MX Master 3S does not contain the LinkKey key. Not sure what this means, but I removed it as a bluetooth device and was able to proceed.

The issue that ultimately prevented me from was this:

WARNING: Following devices paired on Windows for multiple BT-adapters: <headphone mac>

I do have two bluetooth adapters in my desktop; one is built-in to the motherboard and scarcely works, the other is an external one that I use. Indeed, my headphones have been, at different times, connected to each. I tried just about everything, but could not figure out how to get this error to go away. I wound up extracting the key by hand.

Worked perfectly on EndeavourOS (Arch-based) Cassini and Windows 10 22H2. The devices were Beats Solo Pro and Beats Flex. Worked with both of them.

Thanks man. Appreciate it.

Remember to license the program.

Actually I'm trying it with Garuda Linux and Windows 11 (last updates) and it doesn't work at all. The device (a bluetooth sound bar "creative stage air") is going to be recognised properly, it reports I need to sync it. I do the command "--sync-all -n", it seems has worked correctly but the device do not connect. I tried a reboot but still not working.
Any suggestions? Could be an Arch linux issue, or maybe Windows 11?

mc0e commented

I so far have not got it working with Linux Mint LMDE 5, which is based on debian bullseye.

sudo pip install bt-dualboot produces some graphical messages about wanting to set up kde-wallet, and then complains about the lack of a signing key.

In the terminal, it looks like so:

mc0e@laptop ~ $ sudo pip install bt-dualboot
[sudo] password for mc0e:       
WARNING: Keyring is skipped due to an exception: Failed to open keyring: org.freedesktop.DBus.Error.NoReply: 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..
Collecting bt-dualboot
  Downloading bt_dualboot-1.0.1-py3-none-any.whl (20 kB)
Installing collected packages: bt-dualboot
Successfully installed bt-dualboot-1.0.1

I tried running it anyway. I first got a complaint saying ERROR: Missing dependency `reged`. Install `chntpw` package first., so I installed chntpw. I then tried again, and it looked like so:

mc0e@laptop ~ $ sudo bt-dualboot -l
Traceback (most recent call last):
  File "/usr/local/bin/bt-dualboot", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/cli/app.py", line 342, in main
    app.run()
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/cli/app.py", line 252, in run
    self.list_devices()
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/cli/app.py", line 173, in list_devices
    devices=sync_manager.devices_both_synced(),
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 111, in devices_both_synced
    index = self._index_devices()
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 61, in _index_devices
    linux_devices   = get_linux_devices()
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_linux/devices.py", line 40, in get_devices
    return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_linux/devices.py", line 40, in <listcomp>
    return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 55, in bluetooth_device_factory
    info = extract_info(device_info_path)
  File "/usr/local/lib/python3.9/dist-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 39, in extract_info
    "pairing_key":  config.get("LinkKey", "Key"),
  File "/usr/lib/python3.9/configparser.py", line 781, in get
    d = self._unify_values(section, vars)
  File "/usr/lib/python3.9/configparser.py", line 1149, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'LinkKey'

I then uninstalled an re-installed bt-dualboot. This time I selected the blowfish encryption for kde-wallet. It wanted a password, and while I was doing that, the bt-dualboot install script failed with the same warning message about the keyring. Still, I completed setting up the password for the wallet. I then uninstalled and re-installed bt-dualboot again, and it did not complain. Trying to run sudo bt-dualboot -l still fails with the same message.

mc0e commented

I think the issue is not about the OS, but rather that I have a file in /var/lib/bluetooth/*/*/info which does not have a LinkKey section. It's a PineTime smart-watch.

[General]
Name=InfiniTime
AddressType=static
SupportedTechnologies=LE;
Trusted=false
Blocked=false
Services=00000000-78fc-48fe-8e23-433b3a1942d0;00001530-1212-efde-1523-785feabcd123;00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;00001802-0000-1000-8000-00805f9b34fb;00001805-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180d-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001811-0000-1000-8000-00805f9b34fb;00010000-78fc-48fe-8e23-433b3a1942d0;
Appearance=0x00c2

I'll open an issue.

Worked for me on Fedora 38 / Windows 10 with a Logitech K380 keyboard once I specified the Windows mount path.
Probably my fault for using the Files app in GNOME to mount the Windows partition.
This was my working command:
sudo bt-dualboot --sync-all -b --win /run/media/simonharries/Windows/

Only thing I would note is I didn't receive any error messages to suggest things hadn't worked when using:
sudo bt-dualboot --sync-all -b

Fails to list devices on Arch Linux when Logitech G603 mouse is paired:

# bt-dualboot -l
Traceback (most recent call last):
File "/usr/bin/bt-dualboot", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/lib/python3.11/site-packages/bt_dualboot/cli/app.py", line 342, in main
app.run()
File "/usr/lib/python3.11/site-packages/bt_dualboot/cli/app.py", line 252, in run
self.list_devices()
File "/usr/lib/python3.11/site-packages/bt_dualboot/cli/app.py", line 173, in list_devices
devices=sync_manager.devices_both_synced(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 111, in devices_both_synced
index = self._index_devices()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/bt_dualboot/bt_sync_manager/bt_sync_manager.py", line 61, in _index_devices
linux_devices   = get_linux_devices()
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/bt_dualboot/bt_linux/devices.py", line 40, in get_devices
return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/bt_dualboot/bt_linux/devices.py", line 40, in <listcomp>
return [bluetooth_device_factory(device_path) for device_path in get_devices_paths()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 55, in bluetooth_device_factory
info = extract_info(device_info_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/bt_dualboot/bt_linux/bluetooth_device_factory.py", line 39, in extract_info
"pairing_key":  config.get("LinkKey", "Key"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/configparser.py", line 797, in get
d = self._unify_values(section, vars)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/configparser.py", line 1168, in _unify_values
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'LinkKey'

When I forget about G603 device, bt-dualboot -l lists devices correctly (Sennheiser BT 4.40 only), but I have not tried proceeding further yet.

I'm attaching info file from /var/lib/bluetooth:

# cat info
[General]
Name=G603
Appearance=0x03c2
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
WakeAllowed=true
Services=00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;00010000-0000-1000-8000-011f2000046d;

[IdentityResolvingKey]
Key=614ED00F1990D3FE6223D359F7ECBA66

[LongTermKey]
Key=AA6CE2937B528576885B440EABE0A130
Authenticated=0
EncSize=16
EDiv=38427
Rand=16137368128578021730

[ConnectionParameters]
MinInterval=6
MaxInterval=9
Latency=44
Timeout=216

[DeviceID]
Source=2
Vendor=1133
Product=45084
Version=23