Skip to content
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

BLE notification time inconsistent #55

Open
ArdenKolodner opened this issue May 7, 2023 · 1 comment
Open

BLE notification time inconsistent #55

ArdenKolodner opened this issue May 7, 2023 · 1 comment

Comments

@ArdenKolodner
Copy link

ArdenKolodner commented May 7, 2023

I have an ESP32S3 connecting via BLE to multiple MbientLab MetaMotionS devices. The BLE client on the ESP32 subscribes to a characteristic on each device, which is supposed to send a notification update at 100Hz. This works fine when using Bluedroid, but unfortunately Bluedroid causes other problems down the line and we want to switch to NimBLE.

However, for some reason, when using NimBLE, most of the notifications from all devices except the last one are dropped. Each time a new device is connected, the device that was previously the most recent connection suddenly develops this problem, in addition to all previous ones. Only about 10% of the notifications go through, which is far too few for our use case. We found that changing the connection interval with setConnectionParameters made more of the notifications go through, but still not most, even when trying the max value.

Since the issue doesn't occur with Bluedroid, and nothing else is changed, the problem seems like it must be with NimBLE.

Does anybody know why this problem occurs or how to fix it?

Note: we use NimBLE through the esp-nimble-cpp library, but this seems unlikely to be the issue since it just provides an interface for BLE connection and callbacks just immediately call our code.

@ArdenKolodner
Copy link
Author

Oddly enough, setting the connection parameters will reverse the issue: the first connected device will now be the fast one, and the others, including the last one, will be slow. This seems to be the case even if I set the connection interval to a very large value, instead of very small, and even happened sometimes when I set invalid connection parameters and got an 0x0212 HCI error. So maybe it’s not the actual parameter values that are affecting anything, but some side effect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant