# Bluetooth on ThinkPad (ng_ubt)



## Mjölnir (Mar 24, 2021)

Dear wizzards,

I have time until saturday to get the _Bluetooth_ on my _ThinkPad T450s_ up & running.  It is not an external USB dongle, but internal inside the laptop; I strongly guess it's bundled within the WLAN card.  I found some message about `ubt0` in /var/run/dmesg.boot, so I loaded ng_ubt(4) & hcsecd(8) (through `service hcsecd onestart`), but I can't see my sister's birthday gift, an external speaker box that can connect via _Bluetooth_.  Any help to enable me to hide that box in the backyard @saturday & play some loud music via my laptop is highly appreciated!


----------



## eternal_noob (Mar 24, 2021)

The manpage for ng_ubt(4) states that's it is a driver for Bluetooth devices connected via USB. You said that's an internal device and NOT connected via USB. Maybe try another driver?

The handbook lists a few more drivers you can try.


----------



## zirias@ (Mar 24, 2021)

eternal_noob said:


> You said that's an internal device and NOT connected via USB.


Just mentioning this isn't _always_ a contradiction…


----------



## Snurg (Mar 24, 2021)

Mjölnir said:


> Dear wizzards,
> 
> Any help to enable me to hide that box in the backyard @saturday & play some loud music via my laptop is highly appreciated!


Aside of the technical problems getting that to work on FreeBSD (-> this good article from olli@), I'd like to mention the range problem of many/most BT devices.
~10 years ago I tried many BT sticks and their range is usually very disappointing.
I only managed good range (most of my house and garden) using AVM BlueFritz! I sticks, which had 32-bit Linux support.
(Maybe use a CentOS jail?)
Even this only worked when I connected the stick to a 5m USB cable and placed it strategically for maximum coverage.

So I'd advise to do a quick test with the Windows Bluetooth whether the laptop can reach the outside at all.


----------



## Mjölnir (Mar 24, 2021)

Zirias said:


> Just mentioning this isn't _always_ a contradiction…


Yes, it seems that the _Bluetooth thang_  is connected via the internal USB hub.
Snurg No Windoze on this laptop, it's _freed by the BeaSD_ only & I'll take it into the backyard.  The battery is still good for an hour or so, and the speaker box is brand new so that will last much longer.  My experience is that some kernel drivers don't work right when loaded @runtime, thus I've added `ng_ubt_load="YES"` in loader.conf(5) to load @boot, so maybe tomorrow I'll see better results.  Thx so far & bye for now, I need some sleep.


----------



## olli@ (Mar 24, 2021)

Snurg said:


> I'd like to mention the range problem of many/most BT devices.
> ~10 years ago I tried many BT sticks and their range is usually very disappointing.


Bluetooth is not Wifi. Bluetooth was designed as a short-range wireless technlogy. While Bluetooth class-1 supports up to 100 m distance, in practice most devices are only class-2 or even class-3, supporting a maximum of 10 m. This is especially true for battery-driven devices. Also note that _both_ sides have to support the range that you want, i.e. if you have a class-1 USB BT stick that supports 100 m, but your device is only class-2, then all you get is 10 m range. And finally, like WLAN, any obstacles in the way (walls etc.) will reduce the range, of course. It’s also worth mentioning that Bluetooth uses the 2.4 GHz frequency range, which is also used by Wifi and other things, so this might cause interference, further reducing the usable range.

Apart from that, on FreeBSD there is the problem that Bluetooth is not very well supported, as I explained in more detail in my article that you linked above. If you’re lucky you can get your device working. I didn’t, so I had to leverage an alternative solution.


----------



## Snurg (Mar 25, 2021)

olli@ said:


> Bluetooth class-1 supports up to 100 m distance, in practice most devices are only class-2 or even class-3, supporting a maximum of 10 m.


Yes, class 1 stuff is expensive, too.
Didn't use such.


olli@ said:


> And finally, like WLAN, any obstacles in the way (walls etc.) will reduce the range, of course. It’s also worth mentioning that Bluetooth uses the 2.4 GHz frequency range, which is also used by Wifi and other things, so this might cause interference, further reducing the usable range.


Exactly for this reason it matters so much to use a combination of good gain antenna(s), strong transmitter and very senstitive quality receiver amplifier. (Edit: There are some more ways to enhance BT, for example by using a device with an external antenna)

So the effective range with the BlueFritz was 10-14 meters, with two walls between.
And I liked that, considering that many cheap Chinese sticks already had hard difficulties with just one wall.



olli@ said:


> I didn’t, so I had to leverage an alternative solution.


Plug&Play


----------

