I can use hcitool lescan with the --duplicates flag to capture periodic LE Advertising Reports (proximity beacons) from two nearby BLE devices:
$ sudo hcitool lescan --duplicates
LE Scan ...
C8:0F:10:29:4D:98 MI1S
C8:0F:10:29:4E:75 MI1S
C8:0F:10:29:4E:75 MI1S
C8:0F:10:29:4D:98 MI1S
C8:0F:10:29:4E:75 MI1S
C8:0F:10:29:4D:98 MI1S
<snip>
Here is that scan again, with timestamps added to show the periodicity:
$ sudo stdbuf -i0 -o0 -e0 hcitool lescan --duplicates | perl -nle 'print scalar(localtime), " ", $_'
Wed Apr 13 13:46:45 2016 LE Scan ...
Wed Apr 13 13:46:46 2016 C8:0F:10:29:4E:75 MI1S
Wed Apr 13 13:46:47 2016 C8:0F:10:29:4D:98 MI1S
Wed Apr 13 13:46:48 2016 C8:0F:10:29:4E:75 MI1S
Wed Apr 13 13:46:48 2016 C8:0F:10:29:4D:98 MI1S
Wed Apr 13 13:46:50 2016 C8:0F:10:29:4D:98 MI1S
Wed Apr 13 13:46:52 2016 C8:0F:10:29:4E:75 MI1S
<snip>
At the Embedded Linux Conference and IoT Summit last week (April 2016), a presenter who works on the BlueZ stack said to no longer use hcitool, and to use bluetoothctl instead.
I tried that today, but it only shows the first LE Advertising Report for a device (like hcitool does without the --duplicates option):
$ sudo bluetoothctl
[NEW] Controller 5C:F3:70:62:68:28 BlueZ 5.38 [default]
[bluetooth]# power on
Changing power on succeeded
[CHG] Controller 5C:F3:70:62:68:28 Powered: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller 5C:F3:70:62:68:28 Discovering: yes
[CHG] Device C8:0F:10:29:4E:75 RSSI: -72
[CHG] Device C8:0F:10:29:4D:98 RSSI: -65
[bluetooth]# devices
Device C8:0F:10:29:4D:98 MI1S
Device C8:0F:10:29:4E:75 MI1S
How do you use bluetoothctl to capture repeated LE Advertising Reports from the same device, like hcitool does with the --duplicates option?
bluetoothctl
talks to the Bluetooth daemon via DBus, instead of directly with the hardware likehcitool
does. And hcitool usually fails now because the BT daemon has exclusive access. – Ozonolysis