-
Notifications
You must be signed in to change notification settings - Fork 41
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
Device connection time is too long #220
Comments
Hello, This 30 seconds timeout may indicate, that the device isn't advertising at all or is out of range. |
The advertising interval is set to 800ms. I have tested lower advertising intervals and the problem is not connected to the advertising interval. We are pretty sure that the advertisements are sent to our custom implementation and even receive them, but the connection is taking a long time. We have retested this behaviour with the App Store Device Manager vs nRF connect. Should we gather more logs? Do you have some guidance on how we can gather additional info around this? |
You may try sniffing it, for example using nRF Sniffer. When you have logs, please open a case on DevZone. I think our Support Team will be more qualified to help you with this issue. |
The main point was that the nRF Connect do not display this issue with a long connection and the nRF Device Manager does. So we are most likely drawn into the direction of the software problem inside the nRF Device Manager library. Any guidance on how to proceed to rule out the software would be appreciative. I will also examine using nRF sniffer the connection itself, but we are using the SoftDevice controller that is closed source and we are unable to do anything there. The devzone issue is the last resort for us since we cannot share the whole application an we are unable to reproduce some minimal samples easily, which will have to try and dedicate a large amount of resources there. |
Let me clarify what I understand: nRF Connect Device Manager
Did you modify the nRF Connect Device Manager app in any way, or are you using version from Google Play Store? nRF Connect
When you scan the device, do you see the interval calculated as ~ 800 ms? Are all packets the same, if you open packet history (clikc MORE button on expended row)?
Both apps use the same public Android API for connection. Did you try connecting with other devices / DKs / samples from nRF Connect SDK? Do you see similar behavior, for example for SMP Server Sample from Zephyr? |
I have recorded two videos. The second is probably the more telling of what is happening when I open both of the applications at the same time nrf connect and device manager. Where you can see that the scanning nRF Connect is showing RIDER name which indicates that the connectable advertisement containing the device name is received by the Android. Here is the question why the android does not initiate the connection? By any means the nRF Connect app is without issues with the connection, however, overall it handles the connections faster it seems. This Android device(Honor Tablet) is the worst case we have seen but the issue is present even on phones that do scan much better (This device sees only a fraction of the advertising packets). Note that sometimes it connects immediately but we are troubleshooting the cases when it takes over 30s or event time outs. nRF Connect Only: Video Screen of Scanning of another Android Device (Better Scanning) OnePlus: Screen of Scanning of another Android Device (Better Scanning) Samsung S24: I will try to obtain a capture from the sniffer where I can simply filter the Connactable advertisements for further debugging. Our application broadcasts multiple advertisements. The problem is that when using a singular advertisement and sample, which does nothing will most likely work. This is the case with most of the nRF Connect SDK samples. When we introduce a larger workload on the stack in this case 3 advertisements(all 800ms as max of the advertising interval) and background scanning of the Bluetooth Controller. Things do not behave as we would expect. |
We have identified that for our devices the Android nRF Connect Device Manager app and the library take very long time to connect on certain Android devices, while the nRF Connect app is significantly and consistently faster when connecting to the very same device.
From our testing we have seen connection times to usually be above 20 seconds and occasionally timeouting, while the nRF Connect app is always < 10s.
We have tried to rule out additional factors, but ultimately cannot figure out what's the reason for this behavior, as nRF Connect app is closed-source. Could you maybe point us to some differences in the connection process that might cause this?
Below I attached logs of our trial with Device Manager app where we sent an echo request to the device. The first connection attempt timeouted, the second one still took 7 second to connect. nRF Connect took 300 milliseconds to connect to the device.
Android device used
Honor Pad X8 (AGM3-W09HN)
Android 12
Logs
Device Manager
nRF Connect
Device used
nRF52833 (Zephyr softdevices BT controller) with split controller and host, with host running on nRF9151.
cc @optical-o
The text was updated successfully, but these errors were encountered: