- Подключаем Bluetooth устройства к Linux
- Linux Compatible Bluetooth Dongles
- Kinivo BTD-400 USB Bluetooth Adapter
- DAYKIT Mini USB Bluetooth 4.0 Dual Mode Adapter Dongle
- Plugable USB Bluetooth 4.0 Low Energy Micro Adapter
- Sabrent USB Bluetooth 4.0 Micro Adapter
- Panda Bluetooth 4.0 USB Nano Adapter
- Buyer’s Guide: Choosing the best Linux Compatible Bluetooth Dongle
- Final Thoughts
Подключаем Bluetooth устройства к Linux
В данной публикации я расскажу о своем опыте подключения USB Bluetooth стика к серверу на Linux. Основная мысль «поспешишь-людей насмешишь». Работы было на 2 строки в терминале, но я ее превратил в незабываемый квест.
Translation to English is here . Также основной канал в telegram .
В первой части этой «трилогии» я рассказал про USB стик, ссылку на данную статью можно найти ниже:
Я думал, что смогу просто подключить стик в сервер и все чудесным образом заработает, но ничего не произошло. Причин этому было много, и неверная интеграция, и отсутствие необходимого ПО на сервере.
Во-первых, я установил стик в сервер. Далее я выполнил команду ls /dev/
Я не увидел ничего особенного в списке устройств, а также извлечение стика из сервера не давало никакой разницы. Ок, я начал свои поиски и набрел на команду lsusb . Результатом ее выполнения стал список устройств, среди которых был мой Bluetooth
Второй волшебной командой стала usb-devices
Результатом второй команды стала полная информация о стике. Ок, значит стик в системе, но что с этой информацией делать — непонятно.
Вначале я нарвался на 2 интеграции в Home Assistant: Bluetooth LE Tracker и Bluetooth Tracker . Но позже нашлось то, что мне было действительно нужно Xiaomi Mijia BLE Temperature and Humidity Sensor . Не смотря на то, что интеграция у меня не заработала и пользоваться ей я так и не стал, в ее описании есть важные слова, которые я сразу не заметил:
Preferred solution: Install the bluepy and btlewrap library (via pip). When using a virtual environment, make sure to use install the library in the right one.
Fallback solution: Install btlewrap library (via pip) and gatttool via your package manager. Depending on the distribution, the package name might be: bluez, bluetooth or bluez-deprecated.
Если бы я обратил внимание на это, то все бы заработало на пару часов раньше. Я же пошел ложным путем, перемотав страницы в самый конец — настроил конфиг в HA и ничего не заработало. Я начал читать с пункта Configuration.
Нужно выполнить команду sudo hcitool lescan или команду bluetoothctl в зависимости от конфигурации используемой ОС. В результате получим MAC адрес нашего термометра. Но я знал MAC адрес термометра и не выполнил эти пункты, зря.
Уже попозже, когда я немного подкрепился, я начал искать проблемы. Наконец я додумался почитать описание интеграции, но почему-то начать читать с первой строчки мне в голову не пришло. Я все же выполнил команды и получил отрицательный ответ на каждую:
Наконец я начал думать, а как вообще работает bluetooth в Linux? Я в процессе чтения нашел сайт , где описано как происходит настройка bluetooth. Вот цитата:
Устройства Bluetooth встречаются довольно часто в наше время. Это простой и дешевый способ добавить поддержку беспроводных технологий для смартфона или любого другого гаджета. Система Linux может использовать различные протоколы: OBEX, A2DP, DUN, HID и другие для взаимодействия с различными устройствами.
Большинство Bluetooth адаптеров выполнены в виде USB и могут быть настроены с помощью утилит HCL. Некоторые устройства, такие как Atheros, требуют для своей работы установленных прошивок в системе.
Далее приводились команды:
sudo apt-get install bluetooth bluez bluez-tools rfkill rfcomm и sudo service bluetooth start. Если бы я прочитал описание к интеграции, то сразу бы и установил все как следует. Т.к. на приставке я пока работаю из под root, то моя команда выгледела так: apt-get install bluetooth bluez bluez-tools. О пакетах rfkill и rfcomm мой сервер ничего не знал. Пакеты установились
Linux Compatible Bluetooth Dongles
Do your laptop/PC lack integrated Bluetooth and you wish to have Bluetooth support? If yes, you should get a Bluetooth dongle for the PC. A Bluetooth USB dongle is a USB-sized device that lets your computer transmit or receive Bluetooth signals. It’s really affordable yet very effective to enjoy a Bluetooth connection.
Nevertheless, it is difficult to find a Linux-compatible Bluetooth dongle because there aren’t many companies that support Linux. Considering how difficult this task is, we have composed a list of the 5 best USB Bluetooth adapters compatible with Linux.
We have devised the below list with thorough research and went through the reviews of customers. Needless to say, you can blindly trust these dongles. So, without further ado, let’s find out which 5 Bluetooth dongles have piqued our interest. And they will definitely get the job done for you too.
Kinivo BTD-400 USB Bluetooth Adapter
Kinivo tops our list as the best Linux-compatible Bluetooth USB dongle as of today. It is a simple yet inexpensive piece of hardware that gets the job done well without any hiccups. Plus, it’s also very versatile, as it’s not just compatible with Linux but also with Windows, and Raspberry Pi.
This plug-and-play adapter is compatible with Bluetooth specification v4.0 Class 2 and low energy technology. So, it consumes a lot less power and is still fully compatible with older Bluetooth equipment in your room.
In terms of range, you get 32 feet of unrestricted connection. During our tests, we didn’t notice any connection drops or accidental disconnection. 10 meters is more than enough range to move about in your room while staying wirelessly paired to your devices.
While some users complained about the poor sound quality of their speakers when connected, we didn’t notice any such problem. If you run into the same problem, simply register your BT device as a hands-free device to fix it up.
DAYKIT Mini USB Bluetooth 4.0 Dual Mode Adapter Dongle
Are you looking for a special Bluetooth dongle for a PC? Consider this option. The DAYKIT Mini USB dongle is compatible with Bluetooth 4.0 (or earlier). It also features EDR and class 2 low energy technology, which saves battery significantly. What’s more, it works with most Linux distros right out of the package. No hassles!
The CSR8510 Chip dual-mode transmission allows speed and quality without the annoying mess of cables and maximum efficiency. When the devices are close, the transmission rate reaches as high as 3 Mbps. That means, larger files (or data) take less time to transfer between devices.
This dongle has a working range of 33 feet. Yes, that’s even more than our top pick. But we preferred Kinivo’s model because of its reliability. That doesn’t mean, Daykit isn’t reliable. It just lags a little when working with multiple devices at the same time.
The Bluetooth devices compatible with the dongle are the headsets, speakers, projectors, printers, and PAD/Phone. You can also pair it with keyboard, mouse, and mobiles via multi-pairing. Don’t forget to connect your Bluetooth speaker for listening to the latest hit songs in stereo.
Plugable USB Bluetooth 4.0 Low Energy Micro Adapter
Like other brands on this list, Plugable is a reputable name in the industry. Their Low energy Micro adapter works right out of the box with any of your Linux distros. And not just that, it also supports all of your Windows 7 devices natively and other versions with some additional drivers.
It is a certified class 2 Bluetooth dongle that has been approved by the Bluetooth Special Interest Group. In other words, it is high quality. Moreover, the Plugable USB Bluetooth 4.0 dongle allows uncompromising multi-pairing. Since it operates on Bluetooth 4.0 version, you can enjoy simultaneous connections with multiple devices.
It offers32 feet range which is more than enough to get everything in a room working. This Bluetooth version also promises low consumption of power which is beneficial for battery life. Plus, a two years manufacturer’s warranty is enticing, considering these devices do get hot and toasty when working with multiple devices.
Last but not least, you do not have to worry about this sizing because it has a Nano design. Because of this, it can easily fit in all USB ports without blocking nearby connections.
Sabrent USB Bluetooth 4.0 Micro Adapter
This smart black-colored Bluetooth USB dongle efficiently adds Bluetooth to a Linux desktop or laptop. It sports the Bluetooth 4.0 version (BLE) Low Energy, connecting everywhere while utilizing minimal power.
Its Smart Wireless connectivity and multi-pairing support allow smooth connection with speaker, printer, headset, mobile phone, keyboard, mouse, and more. This means that you can connect all of your devices and enjoy their connection simultaneously. You can also access files between the paired Bluetooth devices and transfer them to one another too.
The device is small but easy to insert and remove when not in use. It is both slim and portable, so you can carry it anywhere in your back pocket. Furthermore, with this dongle, you can walk approximately 30 feet away with no quality loss.
Overall, it’s a cracking piece of adapter kit for the price. The package is complete because it offers a Driver CD, USB Bluetooth adapter, and a user manual.
Panda Bluetooth 4.0 USB Nano Adapter
If you want to transform your computer into a Bluetooth 4.0 enabled power machine, the Panda Bluetooth USB adapter is another good option. It comes with EDR and Low Energy Bluetooth Class 2 4.0 version.
After inserting this dongle, you can also wirelessly connect with Bluetooth devices on versions 2.0, 2.1, and 3.0 because of the backward compatibility. You can simultaneously pair up multiple devices such as keyboards, serial devices, mobile phones, mouse, printers, handsets, modems, speakers, and Smart Ready devices.
This means that whatever device you may have can easily connect via multi-pairing support. With those devices, an 80 feet operating range is offered. This is the longest supporting range of a Bluetooth dongle for PC among those mentioned in this article.
The Nano’s small size and portability make it easy to use and carry. After inserting, the dongle can stay in the USB port on the computer without interfering with the nearby USB slots.
You can transfer files at a fast rate of 3 Mbps which is superfast. The package includes a user’s manual and Bluetooth software stack. It also comes with 1 year of limited manufacturer warranty. So if it goes kaput during this period, you can easily get a replacement.
Buyer’s Guide: Choosing the best Linux Compatible Bluetooth Dongle
Is shopping for the best Bluetooth USB dongle a stressful experience for you? Don’t worry, in this section, you will get to know which about some important factors to keep in mind. We have also used these factors in our reviews for comparison.
Bluetooth version
If you want your dongle to have high security and minimal energy usage, you are advised to select adapters with Bluetooth version 4.0. However, this version sometimes does not work with the old versions. To tackle this problem, you should be attentive if the company has offered backward compatibility or if the package states the Smart Ready label.
You can also go with an adapter offering Bluetooth 3.0 version if a better device isn’t available.
Range
Before shopping for a USB dongle, ask yourself how far the Bluetooth signals should go. A lot of people prefer buying a class 2 Bluetooth adapter having a range of almost 10 meters. This range is enough for standard size residential apartments. In case you live in a house with the floor in between the connected devices, you should purchase a class 1 Bluetooth adapter with a range of 100 meters. But keep in mind that class 1 adapters are VERY costly.
Multi-pairing support
This feature is sought after while buying a Bluetooth dongle for a PC. With multi-pairing, you can easily switch between various devices (laptop, mobile, etc.) without the need to pair them repeatedly to the adapter. Therefore, buy a Bluetooth adapter having a multi-pairing function, especially if more people in the house want to use the system.
NFC support
If you want to couple the paired devices easily, Near Field Communication (NFC) is a must-have feature. This technology allows the Bluetooth devices to form a wireless connection with each other just by touching them. However, remember that the paired devices need to have a built-in NFC chip for this feature to work.
Final Thoughts
That’s just about everything you need to know. In this article, we discussed the 5 best Bluetooth USB dongles perfectly compatible with Linux. While there are some other devices – apart from the ones discussed in this list – compatible with the Linux platform, you can never be sure about their reliability. We hope the information presented in this piece was valuable to you. Thank you for reading.