Hey,
I used the nRF distance measurement library to measure long distances and managed to measure the distance to around 140 meters and it seemed to work quite well. The only thing I noticed is that the sampling rate is quite low.
I took the example of the nRF distance measurement and incremented a global counter every time the callback function data_ready() was called from the struct dm_cb (This function indicates that the dm library has some distance data.). A wrokerthread is executed every 900 ms to write this value to the console and reset the value. The counter value varies from 1 to 3. This means that the sampling time is between 300 and 900 ms, right?
Can this be improved?...
How about if I just use one initiator and one reflector per device instead of having one BLE device that supports both functions. Would that help?
If I reduce the advertising interval from (min-max)100 -150 ms to 30-60 ms, would this improve the sampling rate?
Could it be that the application slows down with the number of BLE devices, since it has to initiate more distance measurements? Can I create a whitelist to limit the interaction?
I don't understand why this is slow, since it basically just needs to do maybe a subtraction with the time it takes the refloctor to process, divide by two, and mutliplicate with a constant to get the distance. Correct? Or am I missing something.
Thanks for the help!!!
OS: Windows
SDK: 2.4.1
IDE: Visual Studio Code
Hardware: nRF52840 DK