-
Notifications
You must be signed in to change notification settings - Fork 424
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
Connection interval changes on its own #558
Comments
Hello, Note I fixed your post, making it more readable. Please, make sure it's readable next time. The minimum Interval Connection supported by Android is 11.25 ms, depending on Android version. However, Android requests interval 7.5 ms for service discovery, and switches back to higher one afterwards. If you want to send large amount of data, you don't really want short connection interval. Remember, that when using Write Without Response, or Notifications, the phone may send multiple packets in a single connection interval. By using Date Length Extension (DLE), supported on Android 6+, as far as I remember, the Link Layer packets can send fill 247 bytes in a single packet, but can send multiple such packets one by one, which is faster than sending one per connection interval. So, with too short interval it may be that 2 won't fit. Depending on the length of the "unused" gap between end of the last packet and start of the new interval the upload may be faster or slower. Sometimes increasing the interval increases speed. If you have a good BLE sniffer, like Ellisys, which can show the packets on a time graph, you may tune the connection interval so that as litle time is "wasted" as possible. If your phone sets the interval to 30 ms, I wound't fight with it, rather would tune the MTU so that the packets fit as much as possible. Also, if your device supports even higher MTU, I recommend using value 498. With that a single GATT packet fits into 2 maximum-length Link Layer packets when using DLE. |
Hello! Thank you for correcting the post, I would like to clarify that at the moment the interval of 30ms has been corrected to 12 and now the HCI logs look like this, can you be more specific about what the reason could be?? First of all, I connect, set the MTU and then start working with files
Further, during the file transfer process, the interval changes again to 12ms.
The logs show that I’m transferring files to the device and for some reason it’s set to 12ms again, although previously it was 30, but now it’s fixed. This is an excerpt of the logs, I will attach the full logs |
Hello,
I'm writing an android application, using
no.nordicsemi.android:ble:2.3.1
. I connect to the sensor and write 49KB data to it. Before recording, I set the desired interval (CONNECTION_PRIORITY_HIGH 11.25 - 15ms) and MTU (247). Next, I initiate the sending of files of 128, 232,240 bytes. But the problem is that after sending, GATT sets me to interval 36 and not 12ms as I need. The sensor supports from 12 to 30ms. I tried different versions of Android and the BLE version doesn't really make a difference either. If you need the code, I can show you some excerpts.Nothing helps, maybe there are some articles or something similar.
UPD uploaded HCI log
https://dropmefiles.com/SEgPo two files
Before sending all data, I put this:
Then I receive a log from Gatt:
Then several packets pass through to the device, and then this happens:
The log shows, that after sending the packet, the interval changes without my participation:
The text was updated successfully, but these errors were encountered: