# How to Bluetooth?



## Tracker (Jul 6, 2020)

I followed the Bluetooth chapter from the handbook but after loading

`kldload ng_ubt`

My system couldn't detect ubt0 under either /var/log/messages or under dmesg(8).

When I boot via aUbuntu stick it works perfectly fine and gives the following under `lsusb`


```
Bus 002 Device 003: ID 0489:e011 Foxconn / Hon Hai Acer Bluetooth module
```

How do I even detect my bluetooth device?


----------



## aponomarenko (Jul 7, 2020)

This Bluetooth device is not supported. The ID of the device is missed is the `sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c`: https://github.com/bsdhw/Drivers/blob/master/freebsd/freebsd-12.1.list

It's unlikely to be added in future versions of FreeBSD because it was released 10 years ago.

Your options:

1. Replace it
2. Add compatible USB Bluetooth stick


----------



## Tracker (Jul 7, 2020)

Thanks aponomarenko

Any hacks to get it to work? Adding a usb bluetooth device would block a usb port in my laptop.

Was hoping adding a few lines/recompiling might do the trick


----------



## aponomarenko (Jul 7, 2020)

Tracker said:


> Adding a usb bluetooth device would block a usb port in my laptop.


----------



## T-Daemon (Jul 7, 2020)

Tracker said:


> Any hacks to get it to work?


There is this entry in /usr/src/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c to which *aponomarenko* has pointed to:

```
380  * If for some reason device should not be attached then put
381  * VendorID/ProductID pair into the list below. The format is
382  * as follows:
383  *
384  *      { USB_VPI(VENDOR_ID, PRODUCT_ID, 0) },
385  *
386  * where VENDOR_ID and PRODUCT_ID are hex numbers.
387  */
```

The problem is to find the right Atheros chip section on which the Foxconn / Hon Hai is assumed based on. I couldn't find any hint which chip is used for that module (only in a Linux forum posting the hint to Atheros). There are 5, for 4 different chip models:

```
394         /* Atheros 3011 with sflash firmware */
402         /* Atheros AR9285 Malbec with sflash firmware */
405         /* Atheros 3012 with sflash firmware */
420         /* Atheros AR5BBU12 with sflash firmware */
423         /* Atheros AR5BBU12 with sflash firmware */
```

Or try to find on which chip the module is based on, set the id's in the right section, or apply the "_Try and Error_" method. Add a line with the vendor and product id in the Atheros sections, one after another, rebuild, install, reboot the kernel, check if the module has attached, with no guarantee of success.

If you proceed this way rename you original /boot/kernel to /boot/kernel.orig, otherwise it will be renamed the first time to kernel.old, and overwritten in the second attempt installing a kernel, when the first installed kernel in the try is renamed to kernel.old. You can choose between the installed kernel's at the boot menu pressing 5.

Vendor id is 0489, product id e011.


----------



## aponomarenko (Jul 7, 2020)

Can we steal some info on this from https://github.com/torvalds/linux/blob/master/drivers/bluetooth/btusb.c ?


----------



## T-Daemon (Jul 7, 2020)

aponomarenko said:


> Can we steal some info on this from https://github.com/torvalds/linux/blob/master/drivers/bluetooth/btusb.c ?



I found a similar file while web searching at https://deviwiki.com/wiki/Bluetooth_devices , unfortunately neither of them list the e011 product id . There might be a way to query from Linux with a tool the chip info. But I can't tell which utility that could be.


----------

