DWM1001C tag using shell mode with script provides same position after move

I have a network set up. Looks great in DRTLS.

I have written a script that calls apg or lec or les or lep in a loop, and then readline(). I am trying to get a continuous stream of position.

Tag is connected via pins to UART RX and TX on an RPi.

The data returned provides an accurate position at the beginning, but after moving the tag, it gives me approximately the same location (slight variations) over and over, no matter how far the tag has been moved. For instance, using lep: POS,0.51,1.77,0.09,71, and it will repeat this over and over with slight variations at the hundredth of a meter, long after the tag as moved a meter or more.

When I restart the script, it gives me the new position accurately. For instance: POS,0.84,2.34,0.24,79, but then it repeats that over and over long after I move it to some new position.

Is another command needed to get the tag to provide the latest data?

Any help? Thanks.

This seems like a hack - but I found that closing the serial connection, after getting position data from the tag, and then reopening the serial connection before the next request, resolved the issue.

Hi @robopp
without source code is is hard to guess what is wrong. But you must call lec or les or lep only once and then just read the data output.

Very common issue is that you should not use the shell as a program interface. Shell is designed as a Human to module interface and for program interface you should use binary API and not shell. Please see the DWM1001-API-Guide.pdf

Cheers JK
Visit us at CES 2023!

We will be presenting a brand new Ultra-Wideband Demo Kit with the latest LEAPS RTLS based on Ultra-wideband technology.

LEAPS RTLS is an advanced and versatile modular UWB Subsystem that will replace the well-known PANS RTLS.

@leapslabs I am primarily a C# and Python programmer. Are there any examples using the binary API using Python?

Hi @robopp
very raw C# example (I have mixed few codes together so it could contains some errors)

    public bool ResetDWM()
    {
        SerialPort port = new SerialPort("COM10", 115200, Parity.None, 8, StopBits.One);
        port.Open();
        port.DiscardInBuffer();

        byte[] data = new byte[10];
        data[0] = 0x14;     // reset command
        data[1] = 0x0;      // command payload len
        port.Write(data, 0, data[1] + 2);

        System.Threading.Thread.Sleep(200);  // wait a bit

        int count = port.BytesToRead;
        if (count != 3)  // it should return only 3 characters
        {
            port.DiscardInBuffer();
            return false;
        }

        count = port.Read(data, 0, count);
        if((data[0] != 0x40) | (data[1] != 0x01) | (data[2] != 0x0))  // check if response is OK
        {
            port.DiscardInBuffer();
            return false;
        }
        return true;

}