eclipse-kura / kura

Eclipse Kura™ is a versatile framework to supercharge your edge devices, streamlining the process of configuring your gateway, connecting sensors, and IoT devices to seamlessly collect, process, and send data to the cloud.
https://eclipse.dev/kura/
Eclipse Public License 2.0
503 stars 311 forks source link

HCI 5.0 / Extended Advertising support #2705

Closed srware closed 3 years ago

srware commented 4 years ago

Bluetooth adapters which support HCI 5.0 and extended advertising do not work with the current BluetoothLEBeacon implementation with newer Linux kernels and Bluez versions. This is because the current implementation is using deprecated command-line tools (hcitool and hcidump). The Bluetooth 5.0 spec states that if a card supports extended advertising this will be used by default which means legacy LE scan commands are rejected. the 'hcitool' is deprecated and doesn't support LE scans with HCI 5.0 adapters.

My suggestion would be to re-use the BluetoothLeAdapterImpl with TransportType set to LE to kick off a beacon scan using Bluez DBus API and then kick off a 'btmon' command-line process which can be used to parse advertising packets similar to 'hcidump'.

MMaiero commented 4 years ago

@pierantoniomerlino Can you have a look at this and estimate a feasibility plan?

pierantoniomerlino commented 4 years ago

@srware Thank you for the issue report and the suggestion. I agree that the both hcitool and hcidump are deprecaded in favor of more modern commands like bluetoothctl.

I also agree with your solution, but Kura uses TinyB [1] to manage BLE devices (that is based on Bluez DBus API). So, to kickoff a beacon scan or advertising we'd modify the underlying library. Unfortunately, TinyB currently doesn't support beacons nor there are plans to support that [2].

Of course, any contribution is more than welcome!

[1] https://github.com/intel-iot-devkit/tinyb [2] https://github.com/intel-iot-devkit/tinyb/issues/168