How to make a DWM1001 anchor report tags' positioning information?

I am trying to make an anchor be able to report positioning information of tags it detected. It sounds the bridge (listener) mode of DWM1001 supports the feature. However, the mode is not released in the current firmware and not sure when it will be released.

To work around it, I am trying to use the EVB1000 with DW1000 API to capture communication frames of DWM1001 and obtain positioning information from the frames. I set the EVB1000 operation mode to match the DWM1001 config by setting all S1-567 to ON. It received a lot of RX errors but no frames.

My question is: can EVB1000 capture the frames transmitted by DWM1001?

To display RX data and error, I modified the instance_common.c as below:
In instance_rxerrorcallback function:
instancerxon(&instance_data[instance], 0, 0); //immediate enable if anchor or listener
}
rxerr_cb++; // ADDED
rxerr_is = 1; // ADDED
}

In instance_rxgoodcallback function:
rxd_event = DWT_SIG_RX_OKAY;

dw_event.rxLength = rxd->datalength;

flen = rxd->datalength;  // ADDED
dwt_readrxdata(fdata, flen, 0); // ADDED

In instance_run function:
while(done == INST_NOT_DONE_YET)
{
#ifdef USB_SUPPORT // ADDED below
extern void send_usbmessage(uint8 *string, int len);
char txtbuf[1024];
int i, l, n;
if (flen) {
n = sprintf(txtbuf, “RX(%u):”, flen);
l = (sizeof(txtbuf) - n -1) >> 1;
if (flen > l) flen = l;
for (i=0; i<flen; i++,n+=2) {
sprintf(&txtbuf[n], “%02x”, fdata[i]);
}
send_usbmessage((uint8 *)txtbuf, n);
flen = 0;
}
else if (rxerr_is) {
n = sprintf(txtbuf, “RX ERR:%u”, rxerr_cb);
send_usbmessage((uint8 *)txtbuf, n);
rxerr_is = 0;
}
#endif

1 Like

It can capture frames transmitted from EVB1000 tag as below. It can also see a lot of RX errors as below which are from DWM1001, I guess.

RX:0/420/0 TX:121
RX(24):41cce2cadee00ad35f209809112e0ad35f20791111211b94
RX(39):41cce2cadee00ad35f209809112e0ad35f207911112949b44f0100cca9bf020049f445050026d0
RX:0/421/0 TX:124
RX:0/422/0 TX:124
RX:0/423/0 TX:124
RX:0/424/0 TX:124
RX:0/425/0 TX:124
RX:0/426/0 TX:124
RX:0/427/0 TX:124
RX:0/428/0 TX:124
RX:0/429/0 TX:124
RX:0/430/0 TX:124
RX(24):41cce3cadee00ad35f209809112e0ad35f20791111214d4b
RX(39):41cce3cadee00ad35f209809112e0ad35f207911112949004a01009e84ba020049404005002954
RX:0/431/0 TX:127
RX:0/432/0 TX:127
RX:0/433/0 TX:127
RX:0/434/0 TX:127
RX:0/435/0 TX:127
RX:0/436/0 TX:127
RX:0/437/0 TX:127
RX:0/438/0 TX:127
RX:0/439/0 TX:127
RX:0/440/0 TX:127
RX:0/441/0 TX:127
RX(24):41cce4cadee00ad35f209809112e0ad35f2079111121cd47
RX(39):41cce4cadee00ad35f209809112e0ad35f207911112949424a0100f7a0ba020049824005008ebb
RX:0/442/0 TX:130
RX:0/443/0 TX:130

If I change the default standard SFD of mode 8 to the non-standard SFD, no frames can be captured even for the EVB1000.

Hi P.XU,

There is a listener mode (or passive mode) already implemented in the release 1 which will allow you to listen for tag within UWB range. Please search through the forum and documentation, this feature has been discussed several times.

Technically, an EVB is perfectly able to receive message from a DWM1001 as they have the same transceiver (DW1000), but it is not straightforward. You’d better look at the passive node approach.

Thanks
Yves

Hi Yves,

Thanks for the reply. Maybe I misunderstood the listener mode. I did set the listener mode (passive UWB) in my test. I saw the tag in the mode reporting itself’s and anchors’ locations, but it did not report other tags’s location. Below is my test environment.

1 initiator as ‘A’
3 anchors as ‘B’, ‘C’, ‘D’
1 tag as ‘T’
1 listener as ‘L’, which is connected to my host machine via UART port.

I expected the listener ‘L’ could report the tag ‘T’ location. But I saw it only reported anchors’ locations for ‘A’,‘B’,‘C’,‘D’ which were fixed.

Can the listener mode report other tags’ location, not anchor’s?

This is my DWM1001’s version information:
Device Version: 1.1.5
Config Version: 00010700
Hardware Version: deca002a

Thanks,
P.XU

Hi PXU,

Have you entered the shell user mode and tried the command “les” on the listener ? It will report the position of the tag.

Thanks
Yves

Hi Yves,

That is a good point. When I tried the command “les” on the listener, It did report the tag’s position. But when I was using the API by invoking the dwm_loc_get function, It only reported itself (listener’s) location. Is there a C code API function to get tag’s location on a listener as the “les” command doing?

BTW, how many tags can report by one listener? From the data structure in the API, it sounds one listener can only report the maximum 15 tags. Is it correct?

Thanks,
P.XU

BTW, I have succeeded to get EVB1000 be able to sniff DWM1001’s communication frames. It has to configure the DW1000 using DWT_PHRMODE_EXT instead of DWT_PHRMODE_STD.

Hi P.XU,
I am utilizing DWM1001 connected with Raspberry Pi 3+ and have run into the same issue while trying to get data from other tags by using listener mode, specifically the dwm_loc_get function.
The DWM1001 seems to not report what it heard from other around rather than itself while using generic mode probably because it only does exactly what it is commanded from the dwm1001_tlv.h file.
I have tried to simulate the enter command (0x0D) to swtich into shell mode from generic mode by using C function: the proof is that the DWM1001 cannot recognize the command 0x0C (dwm_loc_get). Then I assumed that the command ‘les’ can also be simulated by sending ASCII values owing to the fact that ‘LES’ command is not recognizable in shell mode. However, I just received errors and some data like:

7ea75a80 SPI0: Rx step 1:
SPI0: Wait 10 ms…
SPI: Rx 1 bytes: 0xff
SPI0: Rx step 2:
SPI0: Wait 10 ms…
SPI: Rx 255 bytes: 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
SPI0: Wait 10 ms…
HAL_SPI: ERROR: RET_VAL type wrong: 255

So I would like to ask what I have done wrong in this case and whether I should keep trying to use shell mode by utilizing C function or there is a tlv command that is similar to ‘les’ from shell mode.
Best regards,
Hoa

Hi Hoa,

Are you access UART, or SPI?

The shell mode is only supported by UART. You can use C code to access the serial port. Sending “\r\r” to switch to the shell mode and then sending “les\r” to trigger the DWM1001 reporting positioning data of other tags. The UWB mode of the DWM1001 device must be passive.

Goold luck!

Hi P.XU,
Thanks for the advice, it really helps me out.
May I ask whether there is any TLV command similar to ‘les’ in Shell Mode? Because while using Shell Mode, a lot of useful C functions are unsuable, which is kinda inconvenient.
Best regards,
Hoa

Unfortunately, there is not.

1 Like

is there any code for Arduino to send these commands with

becaurs this code do not work:

Serial1.print(\r\r);
Serial1.print(les\r);

sorry for this stupid question but i do not find any helf in different forums

thank you

I am not familiar with Arduino. But, generally speaking, you should check the following things:

  1. if the code is correct. (I noticed there is no quotes in your print string.)
  2. if the serial port is the one you connect to the DWM1001 and the connections (Tx/Rx/GND) are correct.
  3. if you have permission to access the serial port
  4. if the serial port settings is correct (8 bits, 1 stop, 115200 bps baud rate)

Hi hharmes,
Have you tried replacing \r with 0x0D yet?
For switching from generic mode to shell mode, your connection must firstly be UART. After, you can secondly transmit 0x0D, then delay for 100ms, then 0x0D. It worked for my case.
And by the way, I would like to ask how you manage the connection between DWM1001 and Arduino because from my perspective, you have to compile multiple files in runable program using AVR gcc on Arduino IDE, which is something I have been curious about since the release 1 of DWM1001.
Best regards,
Hoa

hey
thanks you for your comments
for P.XU:

  1. sorry, in the program i used qoutes
  2. the connetions are correct
  3. the measuared voltage on the dwm modul Looks Right (measuared with oscilocope)
  4. i checked again the port Settings and they are correct

and Hoa_Vu
yes i have read that 0x0D should work and i also tried the delay of 100ms but i don’t know if i’m in Shell mode when the lep, les or lec command don’t work or is there any way

i use the normal Arduino program you can download on it’s Website then the programming is easy
and to get the 3.3V i used an 1€ Level shifter from eBay
if that is what you mean

Thanks for your reply, hharmes.
To check whether you are in Shell mode or not, you can use TLV commands from the file dwm1001_tlv.h (you can read more in the API guide document). If the DWM1001 still understands those tlv, it means you are still in Generic mode. Furthermore, you can check your serial connection as well (If it has not entered Shell mode, you may have to check the connection between Arduino and DWM1001).
And about the Arduino IDE, due to my lack of usage, I still don’t know how to compile multiple files in to one file and flash it into the Arduino. I am currently trying to modify Decawave’s source code file to suit the Arduino system (which requires AVR gcc of the Arduino as I mentioned earlier).
So what I want to ask is:

  1. How can you compile a multiple files’ project by Arduino IDE and flash it in the Arduino?
  2. Can you just simply use UART connection to communicate with the DWM1001 through Arduino serial?
    Best regards,
    Hoa

Hey Hoa,
thank you for your answer.
first of all i can’t help you with the problem to compile multiple files to the arduino
second yes i have other possibles to communicate wiith the dwm module e.g. SPI but I’ve never used the SPI communication with the Arduino

i’ve read that the UART communication can’t work because the dwm module is programmed to communicate with an host device like an Computer or an Raspian

if you get yan manage that the dwm module communicate with the Arduino i think it will be a cool Thing if you could upload it to GitHub or something like that

thank you

Best regards,
hharmes