Simple Code for Ranging

Hi, I would like to make a simple example of a program that connects two mdek1001 devices and lets them communicate simple strings/ranging info. I found a repo on github that does this called single sided 2 way ranging, but It doesn’t seem to be very simple, or use much of the dwm.h library code that was mentioned in the dwm-simple example. If anyone could point me to a basic implementation of this, or the functions necessary to do so, it would be much appreciated. Thanks.

maybe DW1000 API is what you needed, it’s just pure c api without any dependencies.

I have been reading the docs for this, I am still slightly confused on which functions to use/how to do communication/ranging over uwb. Is there a simple way to set up 1 tag and 1 anchor such that the tag will recieve ranging info from anchor?

See these following example

  1. SS-TWR Ranging: ex_06a_ss_twr_init + ex_06b_ss_twr_resp,


  1. DS-TWR Raging: ex_05a_ds_twr_init + ex_05b_ds_twr_resp
1 Like

Thanks so much. In addition, after connection between the devices has been established, I would like to send a string of information from the anchor to the tag. After looking at the SS-TWR ranging code, it looks like the current string being sent is built a certain way for ranging, and should not be edited (im not sure of this), so if that can’t be changed, how would I send this information to the tag without interrupting the message that is already being sent?


Actually the ranging packet used in SS-TWR or DS-TWR can be changed, If you don’t want to modify example code too much, the simplest way to append your information right after existing messages: e.g., tx_poll_msg, rx_resp_msg, and adjust buffer used to store received messages to appropriate size

1 Like

Hi chxt

Is it possible to send custom data between two mdek1001 devices? So far I have read it’s not possible. Would it be possible for you to give me some links regarding this issue?


Yes, It’s possible, so far we have made our own data exchange format between dwm1001-devs. You can start from examples in DW1000 API as we did

Thanks a lot for the link