# Setting up Bluetooth



## cstefan (Apr 6, 2022)

I'm new to FreeBSD, coming from Linux.

I have the Qualcomm Atheros AR9565/QCA9565, which provides both WiFi and Bluetooth. WiFi works fine since the installation, so I'm guessing the correct driver & firmware are there.

However, when I try to run `$ service bluetooth start`, I get


> /etc/rc.d/bluetooth: ERROR: Unsupported device:


There's no device listed, which makes me think that the 'unsupported device' doesn't exist.

I tried looking around, but I can't find any sensible next steps for troubleshooting this (I don't even know how the Bluetooth stuff works in FreeBSD).

Thanks


----------



## SirDice (Apr 6, 2022)

Technically bluetooth is a network protocol. But it's not the kind of networking the "Networking" section is intended for.


----------



## astyle (Apr 6, 2022)

cstefan said:


> I'm new to FreeBSD, coming from Linux.
> 
> I have the Qualcomm Atheros AR9565/QCA9565, which provides both WiFi and Bluetooth. WiFi works fine since the installation, so I'm guessing the correct driver & firmware are there.
> 
> ...


Bluetooth _should_ work in FreeBSD...  SirDice 's post was a hint to look here: https://docs.freebsd.org/en/books/handbook/advanced-networking/#network-bluetooth .... can you connect the dots between that and the URL?


----------



## cstefan (Apr 7, 2022)

Sorry for the wrong topic, I was unsure so I went with Networking because I saw another post like this there.



astyle said:


> Bluetooth _should_ work in FreeBSD... _*[FONT=monospace]SirDice[/FONT]*_ 's post was a hint to look here: https://docs.freebsd.org/en/books/handbook/advanced-networking/#network-bluetooth .... can you connect the dots between that and the URL?


This is the first page I visited. But I can't do what it tells me, because 'starting the Bluetooth stack' doesn't work, as my BT device doesn't show up anywhere.

Am I correct in assuming that the same driver should manage both the BT and WiFi stuff in that card?


----------



## cstefan (Apr 7, 2022)

I just realized what I was doing wrong. Sorry for the ignorance.

If I actually run the correct command, passing the device: `service bluetooth start ubt0`


> /etc/rc.d/bluetooth: ERROR: Unable to setup Bluetooth stack for device ubt0



But then, I run it again and it works. Kind of.

At this point, doing `hccontrol -n ubt0hci inquiry` returns no devices. I found out that I'm supposed to start bthidd, so I did, but nothing changed. I have a mouse on discovery mode. Also tried my phone.

Edit: After a second reboot, `hccontrol` now just says


> Could not execute command "inquiry". Operation timed out


----------



## astyle (Apr 7, 2022)

Ignorance is not a sin. BTW, just off the top of my head, OpenBSD, of all things, had Bluetooth working pretty good, they even had decent documentation. So I'm thinking, maybe OpenBSD's instructions would be repeatable under FreeBSD.


----------



## cstefan (Apr 8, 2022)

astyle said:


> Ignorance is not a sin. BTW, just off the top of my head, OpenBSD, of all things, had Bluetooth working pretty good, they even had decent documentation. So I'm thinking, maybe OpenBSD's instructions would be repeatable under FreeBSD


A few searches lead me to this commit, which removed the Bluetooth stack. Apparently there hasn't been anything ever since.


----------



## astyle (Apr 8, 2022)

cstefan said:


> A few searches lead me to this commit, which removed the Bluetooth stack. Apparently there hasn't been anything ever since.


Wow, this makes OpenBSD less attractive for me. It might still work for some appliances like a router or a firewall, but no go on a desktop...


----------



## grahamperrin@ (Apr 9, 2022)

OpenBSD​


cstefan said:


> … this commit, which removed the Bluetooth stack. Apparently there hasn't been anything ever since.



<https://man.openbsd.org/OpenBSD-5.5/bluetooth.4> in 5.5 but not in 5.6. 

From <https://old.reddit.com/r/openbsd/comments/ftx3dw/-/> (2020-04-02): 



> … If I want to work on Bluetooth on OpenBSD, where and how should I start?



More recent, involving an adapter: Bluetooth Audio on OpenBSD with the Creative BT-W3 : openbsd

FreeBSD​
Again, involving adapters: 









						Using Bluetooth audio devices (speaker, headphones, earbuds) with FreeBSD
					

Here’s just a small recommendation if you want to connect Bluetooth audio devices to a FreeBSD machine, such as wireless speakers or headphones.  Unfortunately, FreeBSD’s support for Bluetooth audio devices is rather weak. Some devices work via the virtual_oss port, but many don’t work. It also...




					forums.freebsd.org


----------



## sidetone (Jun 3, 2022)

https://freebsdfoundation.org/freebsd-project/resources/networking-basics-wifi-and-bluetooth/ works for setting up and identifying a Bluetooth device. In my case, plugging in my dongle showed hardware errors, but it still was identified over Bluetooth and my computer made some type of connection to it. Mine also had the same issue, where the command for starting the service had to be entered twice.

Also, for some commands, press and hold the Wifi/Bluetooth, right before doing so. Mine will allow a connection to be made a few seconds after that.

Even though, my computer identified and linked to my Bluetooth peripheral, that device still isn't functional over it. I cloned the instructions from that link to be about gamepads Thread howto-enabling-multimedia-keys-generic-gamepads-joysticks-for-desktop-usbhid.84464, although that's not expected to fully work yet.


----------

