Bluetooth
bluetoothctl is a command line tool which is shipped with BlueZ – Bluetooth protocol stack for Linux.
-
What are BLE Beacons? - small, versatile, and low-power Bluetooth transmitters that can be detected by wireless devices like BLE-enabled smartphones. Beacons can be deployed in fixed positions, such as mounted on walls or structures, or placed on mobile assets, to provide location references for indoor positioning applications.
-
What is RSSI and its acceptable signal strength? - RSSI stands for Received Signal Strength Indicator. It is an estimated measure of power level that an RF client device is receiving from an access point or router. At larger distances, the signal gets weaker and the wireless data rates get slower, leading to a lower overall data throughput. Signal is measured by the receive signal strength indicator (RSSI), which in most cases indicates how well a particular radio can hear the remote connected client radios.
Scanning for Nearby Devices
$ bluetoothctl scan on
Troubleshooting
Bluetooth icon missing from panel
Install blueman
Devices
$ rfkill # lists the wireless adapters
$ sudo systemctl status bluetooth # check service
$ dmesg | grep -i blue # check module
$ hciconfig -a # hardware details
Function implemented by Bluez can be tested through the interactive client bluetoothctl
which serve as reference implementation.
$ bluetoothctl # interactive mode
[bluetooth]# menu scan
[bluetooth]# clear
[bluetooth]# transport le # enable low energy mode
[bluetooth]# duplicate-data on # enable duplicate advert filter: you will only see one advert
[bluetooth]# back
[bluetooth]# scan on
DebuggingBluetooth
bluetoothd - This is the Bluetooth daemon (i.e. the stack). It provides the core operations (search for devices, pair, etc.) and Bluetooth profiles such as A2DP (music streaming), HID (human interface devices), etc. and exposes a DBus API for the applications to talk to it.
bluetoothctl is communicating with bluetoothd through DBUS.
You can observe HCI communication using sudo btmon
/ man
see also DebuggingDBus - sudo dbus-monitor --system
linux Bluetooth BlueZ
- Bluetooth programming in C with BlueZ
- Bluez Programming - check
client/main.c
, the source code for the bluetoothctl tool.
sudo apt-get install bluetooth bluez libbluetooth-dev
see also
- BlueZ - Official Linux Bluetooth protocol stack