David Schlachter

Intel 8265 Bluetooth on FreeBSD

You may see the following error if you try to turn on Bluetooth on FreeBSD with a recent Intel chipset:

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

Your dmesg output may also show the card being recognized, but unable to load:

$ dmesg | grep bt
ng_ubt: HCI command 0xfc05 timed out
ubt0 on uhub0
ubt0: <vendor 0x8087 product 0x0a2b, class 224/1, rev 2.00/0.10, addr 1> on usbus0

I'll show you how to enable Bluetooth on FreeBSD, at least 12.2-RELEASE, for the following Intel chipsets:

Name USB Vendor ID USB Product ID
Intel Wireless Bluetooth 8260/8265 0x8087 0x0a2b
Intel Wireless Bluetooth 9460/9560 0x8087 0x0aaa
Intel Wireless Bluetooth 9260 0x8087 0x0025
Intel AX201 Bluetooth 0x8087 0x0026
Intel AX200 Bluetooth 0x8087 0x0029

The above table is taken from a list in ng_ubt_intel.c of Bluetooth chipsets that require firmware to be loaded with iwmbtfw. This article aims to document how to use the firmware loader described in Bug 237083.

First, you'll need to install the firmware files needed by iwmbtfw, which you can do either with ports (comms/iwmbt-firmware) or pkg:

# pkg install iwmbt-firmware

In my case, it was enough to restart, and then start the Bluetooth service twice:

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

I was then able to successfully connect a Bluetooth keyboard, after enabling authentication (hccontrol -n ubt0hci write_authentication_enable 1).

If you do have trouble, you could try to manually load the firmware to your wireless card. To do so, identify the vendor and product IDs of your wireless card. You can find this in your particular dmesg output (last line of sample above), or by comparing the output of usbconfig (see below) to the table above. In my case, my Intel Wireless 8265 card has vendor ID 0x8087 and product ID 0x0a2b.

You'll need your chipset's vendor and product IDs to find its USB unit and address. Take a look at the output of usbconfig. Here's mine:

$ usbconfig
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.1: <0x8086 XHCI root HUB> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.2: <vendor 0x8087 product 0x0a2b> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)

From the above output, my wireless card (vendor 0x8087 product 0x0a2b) is at the USB address ugen0.2.

Use the USB address for your card to load its firmware using iwmbtfw:

# iwmbtfw -d ugen0.2