Skip to content

Tries to connect bluetooth devices on Linux despite error `hci0: command 0x0c24 tx timeout`

Notifications You must be signed in to change notification settings

mageddo-projects/linux-bluetooth-connection-fix

Repository files navigation

linux-bluetooth-connection-fix

Automated process to connect bluetooth devices on Linux despite the error hci0: command <code> tx timeout. Related errors

Bluetooth: hci0: command 0x0c24 tx timeout
Bluetooth: hci0: command 0x0c52 tx timeout
Bluetooth: hci0: command 0x0c1a tx timeout

Running it

Download the latest release:

Discover your device ID, for example 94:CC:56:E5:72:85 is my headphone:

$ bluetoothctl devices
Device 94:CC:56:E5:72:85 WH-1000XM4

Then let's connect to it:

$ java -jar linux-bluetooth-connection-fix.jar 94:CC:56:E5:72:85
[main] INFO com.mageddo.linux.bluetoothfix.BluetoothConnector - found=false, code=0, out=null
[main] WARN com.mageddo.linux.bluetoothfix.BluetoothConnector - systemctl will ask you for root password to restart bluetooth service ...
[main] INFO com.mageddo.linux.bluetoothfix.BluetoothConnector - status=restarted, code=0, out=null
[main] INFO com.mageddo.linux.bluetoothfix.BluetoothConnector - status=tryConnecting, device=94:DB:56:F5:78:41
[main] INFO com.mageddo.linux.bluetoothfix.BluetoothConnector - found=true, code=0, out=null
[main] INFO com.mageddo.linux.bluetoothfix.BluetoothConnector - status=done, occurrence=CONNECTED
[main] INFO com.mageddo.linux.bluetoothfix.BluetoothConnector - status=tried, occurrence=CONNECTED, time=18218
[main] INFO com.mageddo.linux.bluetoothfix.BluetoothConnector - status=successfullyConnected!, device=94:CC:56:E5:72:85, totalTime=19218

Requirements

  • Linux
  • JRE 7+

How it works

After buy a new bluetooth usb dongle, I noticed it was very difficult to make it connect to my headphones, also noticed if I restart the bluetooth service and try to connect sometimes it will work at some moment, so what I did was jut automate this process.

About the bluetooth issue root cause:

I wasn't able to find a real fix for the bluetooth problem, looks like it doesn't even exist, all people advise to buy a new hardware at the end, then I made this program as a workaround.

Related issues

Compiling from source

$ ./gradlew build shadowJar

About

Tries to connect bluetooth devices on Linux despite error `hci0: command 0x0c24 tx timeout`

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages