-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Coded PHY (Bluetooth 5.0 feature) when scanning. #1225
Comments
There are not any operating systems APIs to request using coded phy that I am aware of. |
What about Windows, Mac and Linux? |
http://www.bluez.org/
|
@pvvx So far I am very happy with the implementation of your software when using it with Linux. |
Why was it opened? |
This is a feature that has been requested by multiple users. I don't know if it is currently technically possible, but maybe some day. |
Starting with the bluetooth 5.0 standard from 2016, it is required to set secondary and primary PHY for scanning and advertising. |
How are things going with the support of "Periodic Advertising with Responses (PAwR)", "Encrypted Advertising Data" and so on? |
any news on this? |
Seriously, how hasn't this been tackled yet? It's like waiting for the next ice age! We've got all the specs laid out, bugs squashed left and right, and yet, we're still twiddling our thumbs here without BLE LongRange support in Bleak? Come on, folks! Android and Linux have sorted their end ages ago, and Bluetooth 5.0 has been out since the dinosaurs roamed the Earth! We've got the adapter practically waving its hands saying, "I'm ready, use me!" So, what gives? Can we please get some action on this? |
|
Hi @dlech, are there any plans to implement Bluetooth 5.0+ in bleak? I'm trying to investigate support for LE/long-range. Just wondering if you know of any updates about this or might know how to find out, if BT 5.0+ is indeed now working in bluez? Cheers |
I'm curious about this too |
I don't think anything much has changed. Windows and Android look like they might provide some APIs for enabling Coded PHY explicitly, but Mac and BlueZ don't (BlueZ can handle it on the low-level management interface to the kernel, but we don't use that, we use the D-bus API which doesn't have any APIs for this). |
So Bleak is almost ten years out of date, just like Linux? |
That might be the practical outcome, but from what @dlech has said, it seems like the challenge is to make this possible in D-bus first. If so, feedback needs to be provided to the D-bus team. @pvvx the productive way forward is to isolate the issue. It seems like the target for feedback should be the D-bus team. @dlech, would you say that is correct? Also, aside from the possibility of this being made possible via D-bus, is there any prospect of having bleak using BlueZ' own kernel interface for this? |
Are you sure Bluez supports connection with LE Long Range devices? LE Long Range advertising is received by the adapter itself, independently of Bluez. The only difference is in the initialization of the adapter - specifying the modes in which it operates. |
Everyone has long switched to alternative APIs. |
What are the alternative interfaces? |
For simple options - opening a socket to work directly with the adapter via HCI. Have to use alternative bluetooth stack. There are already several of them. To work in Bluez requires rewriting all existing Bluez command formats used in the API, adding primary and secondary PHY types. No one will do this. |
What do you recommend instead of Bluez? |
Yes, @pvvx, what do you recommend? I think the priority in order to be productive is to make a suggestion that the bleak team could consider. What you're saying is an interesting description of the problem—but in order to solve it, what would you recommend to the bleak team? You mention alternative bluetooth stacks... do you recommend any? |
I don't use Linux much because it is very outdated and I can't recommend anything optimal. For BLE in Linux, you need to start by reworking the BT adapter drivers in the kernel... |
Okay, well that doesn't seem to help the issue. So it seems like the options are:
@DienoX, perhaps we can get in touch with the D-bus team to inquire. |
A simple example of receiving LE Long Range advertising can be made from https://github.com/frawau/aioblescan.
https://github.com/frawau/aioblescan/blob/master/aioblescan/aioblescan.py#L1185 |
I suggest migrating to Fluoride. It has a lot of users on Android so it gets a lot of support and is well supported by other devices. Recently Chromeos switched to it. |
And it looks like it is very actively maintained. @dlech, would something like this at all be a possibility? |
And it has supported Bluetooth Long Range for several years. |
No, accessing this interface requires elevated permissions. And going behind the back of
It does look like Floride can run on Linux, but someone would need to package it to make it easy for people to install. Then we would also need to develop a new backend in Bleak for it. So technical possibility is high, but likelihood of someone actually doing the work, not so much. |
all
all
Linux, Android
bluetoothctl -v
) in case of Linux:bluetoothctl: 5.66
Description
There is no advertising reception and the ability to connect to BLE LongRange (Coded PHY).
What I Did
Bugs in Android and Linux with scanning with different PHY format have long been fixed.
The specification 'Bluetooth 5.0' since 2016 opens the work of BLE advertising in two PHY modes - LE Coded or 1M on the main channels for extended advertising.
home-assistant/core#88277 (comment)
Logs
Switch the adapter to work with CodedPHY:

hcitool -i hci0 cmd 08 31 03 04 04
Further work in 'Bleak' is limited to 'Coded PHY' format only.
Information about adapter capabilities:
The adapter's capabilities allow it to accept 1M and Coded PHY.
What are the commands to make 'Bleak' work according to the Bluetooth 5.0 specification?
The text was updated successfully, but these errors were encountered: