-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Using hci_usb with Bluez 5.55 or 5.58 #34593
Comments
Your device is not responding for ATT Exchange MTU Request and after 30 seconds BlueZ timeouts and terminates link. I'd suggest checking if ATT request was received on slave device, if yes fix it, if not there might be some IOP issue on LL and this would have to be investigated further... |
What could be the reason for peripheral_dis not accepting ATT Exchange MTU Request? There aren't many options to fix or break this sample code. It's not that this packet is not received due to heavy RF interference or anything. |
@1am |
Of course. Attaching a zip with pcapng (Github doesn't accept raw pcapng but zip worked) between F4:02:11:4D:7C:FF as with HCI_USB and F4:84:A0:B0:37:41 with peripheral_dis.
The one below will be better I guess: |
Thanks @1am. This packet:
Never goes over the air. This might be an issue in the USB driver then.
This is a typo right? |
Since you are using a DK, could you also try the UART transport instead of the USB one and see if that makes it work? |
Yes, a typo of course. I meant nRF52840dk_nrf52833 I've tried HCI UART just now and as when I tested roughly a year ago everything seemed to be very ok on the DK. The only difference from the link you shared is that I had to attach my nRF52840dk_nrf52833 using I really wanted to move towards the HCI USB implementation as I've had very bizarre issue with HCI UART and FT232 which still remains an unsolved mystery for me, though clearly caused by FT232 along the way. Unfortunately my only options are either USB of nRF52840 or FT232 doing USB-UART. |
Could you please send a Pull Request updating the documentation?
HCI USB should work, so this is probably a bug in the USB layer somewhere. Since this seems simple to reproduce I will assign this to @jfischer-no so he can take a look. |
@Vudentz have you seen something similar before, a packet transmitted by BlueZ over USB that doesn't go over the air when using a Zephyr-based controller? |
The ACL Tx (host to controller) bulk end-point of the USB driver is 1 - not 2 as suggested by the the BT HCI USB spec. I faced a similar issue using a custom BT host stack that I could not transmit ACL data. If I change my host to bind ACL Tx to end-point 1, it seems to work. |
@phantomblot-x Could you please share how to change ACL Tx to end-point 1 to try it out? |
Then there is an issue in your "custom BT host stack" because it does not take into account endpoint descriptors. |
That might be the case, but @1am is using vanilla BlueZ and the Linux kernel. That should work out of the box, shouldn't it? |
yes, I will try to recreate and report. |
I don't see how the host stack is supposed to guess that endpoint 1 is for ACL Tx - end-point 1 could be a proprietary interface. Anyway, for best interoperability it should use end-point 2 as suggested by the BT spec. |
I can not reproduce it, neither on master nor on zephyr-v2.5.0 tag. Unlikely that it is relevant to BlueZ version, rather host hardware/controller. @1am what board exactly are you using for hci_usb? |
Hello @jfischer-no I've repeated my tests on Zephyr master with the following setups:
|
It should not make any difference. |
You're right it's nRF52840-Preview-DK, the version is:
|
nRF52840-PDK has known USB device controller issues and is not supported by Zephyr OS. You can use hci_usb on nrf52833dk_nrf52833 for development. |
@phantomblot-x We have a separate issue covering this: |
Before someone reads it here and believes, that is nonsense. With USB we have device, interface, endpoint and whatever descriptors. Which describe a device completely. There is no reason at all to work with hardcoded endpoint addresses. Not even because of "suggestion" or "interoperability" 😉. If the driver on the host side can not read and interpret it then it is a bug in the driver. The interface description for hci_usb is clear, interrupt endpoint for HCI Events, Bulk IN/OUT for ACL Data, HCI command over control endpoint. There must be no "proprietary |
In Vol 4, Part B, section 2 of the BT spec it says: A good host/driver would implement this (agreed), but some hosts may not - those hosts will not work with Zephyr controllers. Too bad! |
Describe the bug
I'm trying to use hci_usb on nRF52840DK to connect peripheral_dis on a nRF52833 DK using bluetoothctrl (or even old hcitool + gatttool). The boards behave correctly, I can see the peripheral advertise, HCI enumerate and I can even connect both. What happens later is problematic and is consistent across more devices and own firmware I've tried - the example above is narrowed down to Zephyr only examples and reference hardware development kits.
After the device HCI connects to peripheral there's nothing more really happening and after 10-20seconds the connection is terminated by remote user.
I'm attaching a video with a demonstration of how it looks in action.
When doing the same with a plain old CSR based dongle everything works just fine. Initially I blamed my own hardware and firmware but eventually I went to the simplest case of 2 DKs with 2 FW examples. I am able to reproduce it on Zephyr master and v2.5.0 branches. Didn't go further in history yet.
To Reproduce
Steps to reproduce the behavior:
cd .../zephyr/samples/bluetooth/hci_usb && west nrf52840dk_nrf52832 && west flash
cd .../zephyr/samples/bluetooth/peripheral_dis && west build -b nrf52833dk_nrf52833 && west flash
btmon
in one terminal windowbluetoothctrl
in second terminal windowExpected behavior
I expected to have services and characteristics discovered and be able to read and write them the same way as I do when using a CSR BLE dongle
Impact
Blocker, can't move on with implementing own software relying on BLE Linux support. Right now it works ok for CSR but it has limit of 5 concurrent connections and I plan to use nRF52840 to handle more and be embedded on the target platform which will later run the software. Currently testing on standard bluez tools to get any potential issues with custom software out of the way.
Logs and console output
btmon output from single connection-to-connection-terminated cycle:
Below is a video showing what happens when these logs get generated:
zephyr-hci_usb-to_zephyr_dis.mp4
Environment (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: