Bluez blotoothctl scan vs hcitool scan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm running bluez 5.50 on a Raspberry Pi (both Buster and Stretch). I
have a ble sensor device that advertises data only when a button on
the sensor device is pressed. So advertisements are asynchronous and
there are no periodic advertisements in between (and all packets are
unique, no duplicates). I'm having an issue with Bluez though where
once a packet is received, Bluez seems to not report any additional
packets from the device for the next approximately 11 seconds (very
occasionally the interval is shorter). This is with the bluetoothctl
line command tool as well as my own c++ application (based off the
bluez client/main.c example). In both cases before starting a scan I
clear the scan filter, set transport to le, and set duplicate-data
reporting on. Conversely, when running "hcitool lescan" I see all the
packets from the sensor (it even seems to be reporting up to all 3
copies broadcast on the different advertisement channels).

Below is a scan covering about 20 seconds (editing out all unrelated
packets), where I'm pressing down the button on the sensor about every
2 seconds and then holding it down for another 2 seconds before
letting it up. The first chunk is from bluetoothctl, the second from
"hcitool lescan"/"hcidump --raw" (taken at the same time, on a second
raspberry pi). The first four bytes in the bluetoothctl packet data is
a little endian packet seq number incremented by the sensor for each
new packet. The next byte indicates a button up/down action. You can
see bluetoothctl reported only packets numbered 05df, 05e5, 05e9 (3
total). In the hci raw dump the seq number is at the end of the top
line. There you can see all packets are in order, reported 1 to 3
times (I assume it is reporting all advertising channels it catches).
All packets are present, 05df to 05e9, in the hcidump scan (11
packets).

So my question is, is there a way to get those missing advertisements
through the dbus api, possibly some additional setting somewhere? If
not, is the hci api okay to use from c++ and should it do the trick?
Is there another/better approach?

------ bluetoothctl
                                .
[NEW] Device E2:15:00:01:73:96 E2-15-00-01-73-96

[CHG] Device E2:15:00:01:73:96 RSSI: -46
[CHG] Device E2:15:00:01:73:96 ManufacturerData Key: 0x03da
[CHG] Device E2:15:00:01:73:96 ManufacturerData Value:
  df 05 00 00 10 a1 ac 8a b4                       .........

[CHG] Device E2:15:00:01:73:96 RSSI: -45
[CHG] Device E2:15:00:01:73:96 ManufacturerData Key: 0x03da
[CHG] Device E2:15:00:01:73:96 ManufacturerData Value:
  e5 05 00 00 10 e7 4f 67 6e                       ......Ogn
                                             .
[CHG] Device E2:15:00:01:73:96 RSSI: -65
[CHG] Device E2:15:00:01:73:96 ManufacturerData Key: 0x03da
[CHG] Device E2:15:00:01:73:96 ManufacturerData Value:
  e9 05 00 00 10 f4 f9 f8 7d                       ........}

---------- hcidump --raw

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 DF 05
  00 00 10 A1 AC 8A B4 C3
> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 DF 05
  00 00 10 A1 AC 8A B4 BE

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E0 05
  00 00 11 11 0F 3E 24 B6

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E1 05
  00 00 10 F7 68 07 50 BE
> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E1 05
  00 00 10 F7 68 07 50 CF
> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E1 05
  00 00 10 F7 68 07 50 BA

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E2 05
  00 00 11 1D 18 A8 2A BF
> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E2 05
  00 00 11 1D 18 A8 2A C0
> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E2 05
  00 00 11 1D 18 A8 2A B8

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E3 05
  00 00 10 E2 29 C7 F7 BB

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E4 05
  00 00 11 57 F0 5C 76 BD
> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E4 05
  00 00 11 57 F0 5C 76 C1

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E5 05
  00 00 10 E7 4F 67 6E CA

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E6 05
  00 00 11 77 63 92 CE C0
> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E6 05
  00 00 11 77 63 92 CE BA
> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E6 05
  00 00 11 77 63 92 CE BE

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E7 05
  00 00 10 2D 52 48 C2 BD

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E8 05
  00 00 11 EE 32 20 9D BD
> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E8 05
  00 00 11 EE 32 20 9D C1

> 04 3E 19 02 01 03 01 96 73 01 00 15 E2 0D 0C FF DA 03 E9 05
  00 00 10 F4 F9 F8 7D BC



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux