Bluetooth Le Signal Strength Linux

Bluetooth LE Signal Strength Linux

On Linux, the way to do this is with the hcitool command. However, you have to be connected to get the rssi of a device. If you want to achieve this from the command line, try:

#hcitool rssi AA:BB:CC:DD:EE:FF

If you want to see the actual C code to achieve this, take a look at the bluez tools/hcitool.c file, under the cmd_rssi function.

static void cmd_rssi(int dev_id, int argc, char **argv)
{
...
}

For Bluetooth Low Energy, I only know one way to do this, and that is using the #btmon command. Run btmon in the background then scan for Bluetooth Low Energy devices:

#./btmon &
# hcitool lescan

The results displayed on the monitor should be similar to this:

> HCI Event: LE Meta Event (0x3e) plen 12                                                                                  
LE Advertising Report (0x02)
Num reports: 1
Event type: Scan response - SCAN_RSP (0x04)
Address type: Public (0x00)
Address: AA:BB:CC:DD:EE:FF (<Vendor Name>)
Data length: 0
***RSSI: -34 dBm (0xde)***
AA:BB:CC:DD:EE:FF <Device Name>

Note that when using btmon you do not have to connect to get the rssi of a BLE device.

Linux Bluetooth l2ping with signal strength (without connecting?)

You can obtain RSSI during inquiry scan, without connecting to devices. Here's an example using pybluez. You could also do the same thing directly from C using Bluez on linux.

inquiry-with-rssi.py



Related Topics



Leave a reply



Submit