Bluetooth Setup - stereoboy/Study GitHub Wiki

$ hcitool dev
Devices:
        hci0    D4:3B:04:A3:31:DE

$ hcitool -i hci0 scan
Scanning ...
	EC:83:50:EA:D6:5F	Xbox Wireless Controller
	9C:B6:D0:B7:CC:06	desktop
	D0:A4:6F:FB:CD:07	EVP-TV
	A0:67:20:FA:6F:6A	회의실TV

$ bluetoothctl trust EC:83:50:EA:D6:5F                                                     
[CHG] Device EC:83:50:EA:D6:5F Trusted: yes                                                            
Changing EC:83:50:EA:D6:5F trust succeeded

$ bluetoothctl connect EC:83:50:EA:D6:5F 
Attempting to connect to EC:83:50:EA:D6:5F
[CHG] Device EC:83:50:EA:D6:5F Connected: yes
[CHG] Device EC:83:50:EA:D6:5F Paired: yes
Connection successful

$ bluetoothctl paired-devices
Device EC:83:50:EA:D6:5F Xbox Wireless Controller
[CHG] Device 60:8A:68:2D:6F:8B RSSI: -81
[CHG] Device 61:13:12:DA:0F:97 RSSI: -51

The error message:

bluetoothd[1136]: Can't get HIDP connection info  
Rejected connection from !bonded device 98:7A:14:86:D9:32  

suggests that your Bluetooth joystick/gamepad is not properly paired (bonded) with your Ubuntu system.


🛠 Fix: Pair and Trust the Bluetooth Device

You need to remove, pair, and trust the Bluetooth controller properly.

1️⃣ Remove the Existing Pairing

Run the following command to list connected devices:

bluetoothctl devices

If you see your joystick’s MAC address (98:7A:14:86:D9:32), remove it:

bluetoothctl remove 98:7A:14:86:D9:32

2️⃣ Restart Bluetooth Service

sudo systemctl restart bluetooth

3️⃣ Manually Pair and Trust the Device

Now, try pairing the joystick again using bluetoothctl:

bluetoothctl

Inside the interactive shell:

scan on

Wait until your device appears (with its MAC address), then run:

pair 98:7A:14:86:D9:32
trust 98:7A:14:86:D9:32
connect 98:7A:14:86:D9:32

If it connects successfully, type:

exit

4️⃣ Enable HIDP (Human Interface Device Protocol)

Your joystick might require HIDP (HID over Bluetooth). Enable it manually:

sudo modprobe hidp

Make sure the kernel module loads at boot:

echo "hidp" | sudo tee -a /etc/modules

5️⃣ Verify Connection

Run:

bluetoothctl info 98:7A:14:86:D9:32

It should show "Connected: yes".

Also, check if the joystick is recognized:

ls /dev/input/js*
jstest /dev/input/js0

🚀 Summary of Fixes

Issue Solution
Device is not paired bluetoothctl pair
Device is not trusted bluetoothctl trust
HIDP error sudo modprobe hidp
Bluetooth service issue sudo systemctl restart bluetooth

Try these steps and let me know if you need more help! 🚀

⚠️ **GitHub.com Fallback** ⚠️