Questions about NDT(Nordic Distance Measuring Toolbox)

Hello!

I'm evaluating NDT and trying to inderstand its capabilities. While the library looks fascinating, I faced some speedbumpers on the evaluation phase.
I want to use this NDT technology in the future project, and I will be grateful if somebody will help me to address the issues I got...
Here are the questions/issues:

1 - If we have more than 2 boards, the ranging works fine for a while (1-5-10 minutes) - in that time we got distances between a "locator" and random "raflector", and "reflectlor" seems to be random - so it is fine, we got the distances to all of the reflectors. But after a while the "locator" boards seems to "lock" on some particular "reflector" board (most often on the nearest one). After this "locking", we got only distances to one reflector board. If we move the locator close to other reflector, if will "relock" after a while to the currently physically closest one, and will measure the distance only to that one. So if we have, for example, 3 "reflectors" and one "locator" - we will only have a distance to one "reflector".

Resetting the "locator" board solves this for a while, but then the situaltion repeats. It seems like there is some implicit synchronization between scan cycle of "locator"'s Softdevice and "reflector"'s Softdevice advertisements.

I think it is somewhere in Softdevices because I tried two things:
- Add a random delay in "disconnected" callback of the "reflector". In my opinion, with this it will not immediately start advertising after a distance measurrement cycle, but with a random delay - and other "reflectors" can drop their advertisements faster than this one - so we should get some diversity in scan results of the "locator" side;

- Add a timestamps for MACs passed the filter on the "locator" side, and if this MAC  was scanned less than N ms ago - just pass it (I created a "dummy" data callback - so the "locator" board will read the scan data Softdevice returned, but will not enqueue DM request)
But both of this workarounds are not working - after a while, the "locator" board still "locks" on the some "reflector".

2 - I like to have one "locator" board and some "reflectors" - so I need to define the roles of the boards. Is there some config option for defining a board role (initiator/reflector)?
3 - I tried to disable the scanning procedure on the 'reflector" boards (I even tried to completely get rid of "scan_start") - but on the "locator" I still can see that the "reflectors" are scanning "locator"'s advertisements. It seems like Softdevice sends scan request packet automatically in answer to the advertisements of the  "reflector" - is there a way to avoid this and send scan requests only manually when needed?

Thanks in advance!

  • Hi, 

    after a while, the "locator" board still "locks" on the some "reflector".

    Both devices act as an advertiser and a scanner at first in the sample. This scanner/advertiser interaction is used as a synchronization point. After a configurable delay, Device A and Device B try to range each other as reflector or initiator. The scanner would store the addresses of the supported devices in a list.

    Is there some config option for defining a board role (initiator/reflector)?

    There is no specific config to assign an initiator/reflector role in the DM sample, but you can modify the sample to achieve that.  

    is there a way to avoid this and send scan requests only manually when needed?

    Do you comment out the if (peer_supported_test(info->addr)) line inside adv_scanned_cb callback function?

    If the device does not act as a scanner it does not build the list of supported peers.

    In the DM sample (from NCS) the device acts as both scanner and advertiser. A list of supported device is build in the scanner callback function. This list is only used for the purpose of sample. It is not used by the dm submodule or the nrf_dm library.

    Note: the current application is not designed to support a large number of units. That will require some changes to the application layer to make it more stable. This has not been in scope for us and it is up to the customer to implement.

    Regards,
    Amanda H.

  • Hello Amanda.

    Thank you for citing the README file.
    I'm sure there is something that I missing - can you please point me to what I am missing?

    I still do not get why just after rebooting the initiator board everything looks good, it measures ranges to all of the anchors it can reach, but after some time, it will only measure the distance to just one (the closest one maybe).
    If I press the reset - for a while (several minutes) it will again measure the distance to all the boards it can reach, but after a while It will again "lock" itself to just the one.
    Why this can be?

    Thanks!

  • Hi, 

    Could you try to comment out the if (peer_supported_test(info->addr)) line inside adv_scanned_cb callback function? Does it help?

    -Amanda H.

  • Hi Amanda.
    Thank you for the suggestion.
    I've tried this, and it doesn't help.
    After some time (about ~5 mins) "locator" board "locks" on one of the reflectors. Resetting the board helps for a while, and then "locking" happens again.
    As I wrote above, I tried to save the timestamps for scanned ranging partners and only perform ranging one time per N ms for the same MAC - but this also doesn't help. 
    It looks like when "locking" occurs, adv_scanned_cb() will only be called for the same MAC repeatedly, so I can't fix this with filtering.

  • Hi, 

    1 - If we have more than 2 boards, the ranging works fine for a while (1-5-10 minutes) - in that time we got distances between a "locator" and random "raflector", and "reflectlor" seems to be random - so it is fine, we got the distances to all of the reflectors. But after a while the "locator" boards seems to "lock" on some particular "reflector" board (most often on the nearest one). After this "locking", we got only distances to one reflector board. If we move the locator close to other reflector, if will "relock" after a while to the currently physically closest one, and will measure the distance only to that one. So if we have, for example, 3 "reflectors" and one "locator" - we will only have a distance to one "reflector".

    Are you checking the distances using the UART print or did you subscribe to the service? Do you check the logs from all the boards?

    Do you change anything in the sample? Could you elaborate on what you modified?

    Could you elaborate in more detail on how to reproduce? What NCS version are you using? Are you using nRF52840DK for all the devices?

    Does setting CONFIG_DM_TIMESLOT_QUEUE_COUNT_SAME_PEER to a lower value work? You can probably try setting this to 1.

    -Amanda H.

Related