Hi everyone. I am trying to find the best way to establish a Bluetooth connection to a nRF52832 in the least amount of time.
I'm designing an ultra low power perpheral device which will remain in SYSTEMOFF mode until reset by an external watchdog every 10s. At this point the nRF52832 will advertise using the bluetooth and if no central bluetooth device is present go back to SYSTEMOFF. What is the best way to reduce this wake period?
Currently I'm using a device programmed with the peripheral blinky example and another device programmed with the central blinky example and from the point of advertisement to the point of connection I am getting results of about 33ms.
Benjameen said:if no central bluetooth device is present
There is no way for the peripheral to detect that - other than waiting for a Scan Request or connection request.
So it all depends on how quickly the Central gets to "see" your advertising and, then, how quickly the Central can start its connection process.
Do you have control of the Central ?
That makes sense.
I do have control of the central device. It has the S132 API v5.0. I did increase the scan window to 100ms in an attempt to increase the connection speed.
Ultimately, though, the central device will be a phone app which I imagine would be different.
There is a trade-off between power consumption and the time it takes for the central to find your device and connect.
If you reduce the advertising interval (i.e. you send advertising packets more often), the central will be able to find and connect to your device faster, but the reduced advertising interval will also increase the power consumption. You might find the Online Power Profiler useful when evaluating what advertising interval you want to use.
Then on the central side you have the scan window and scan interval to tweak.
My peripheral has an advertising interval of 20ms and my central has as scan window of 50ms and scan interval of 50ms. Pushing these values any more seems to cause hard fault errors. I'm still getting around 35ms connection times.
Any other ideas? Or another method possibly?
How low do you want to bring it? What's your target? Why isn't 35 ms fast enough?