Easy settings changing and measurements

Hi,

Do you know how to create app to change settings and retrieve measurements?

I need to make many measurements, with different settings (e.g. PRF, channel, etc.) in different distances. Now I think about DecaWave PC Software, but it seems a bit time consuming. I need it as automated as possible.

Then there’s COM-PC connection but I want to avoid calculations, digging in registers. I need just distance and edit settings.

Has anyone any thoughts?

I came across the same problem, and the PC Software doesn’t have any way of recording the ranging data directly. The best way I found was to use ‘Debug > Log SPI activity’ to record all the SPI activity, and do some post-processing on that afterwords to pull out the data you need. It saves you the time of having to write code to do all the setup and management of the DW1000.

If you want I can send you my python script I put together for parsing the SPI log. You’ll probably need to know a bit of python if you want to modify it.

No need, I’ve done some test but there was a problem with often DecaWave PC crashing.

I need to make it automated, so full controll of settings and logging data would be ideal.

Yah, then you’ll need to write it from scratch. I’ve only had the PC application crash if the usb cable is a bit flaky. Good luck!

Actually if your code gets more than just ToF or distance, you could share it. Because how do I recognize that distance is too long and there can not be measurement done?

Not sure exactly what you mean. If the radios are out of range, they can’t communicate with each-other.

Attached is my spi log parsing script, it outputs csv data whose fomat is on line 129.

Hope it helps.

Yes, they can’t communicate. But there is possibility that let’s say 1 of 500 tries will succeed . Will there be trace of 499 fails? I need it to statistics. Removing lines

filter bad ranging

if dist > -0.5 and dist < 20000.00:

will do the trick?

But there’s a problem on Python 3.2.3 and my log (15MB https://www.dropbox.com/s/mv3i34dhvyfgmce/008.SPI.log?dl=0). Do you know why?

Traceback (most recent call last):
File “readSpiLog.py”, line 148, in
cirs.append(decodeChannelResponse(rawData))
File “readSpiLog.py”, line 69, in decodeChannelResponse
rawCIR = struct.unpack(’<x2032H’, rawData) # first byte is bad
struct.error: unpack requires a bytes object of length 4065

Aahh, looking at the docuementation on the accumulator, if you’re using 16 MHz PFR the accumulator has slightly less data. My measurements have all been with 64 MHz.

Just change line 69 to:
rawCIR = struct.unpack(’<x1984H’, rawData)

As for detecting un-responsed messages, my code doesn’t really try to do that. The problem is the tag’s message triggers actions on the anchor, so if the tag’s inital blink is lost…its hard to tell on the anchor side. I wrote some code to handle transmittion errors better and it keeps track of the errors I can detect in ‘txResetCount’. Discovered a bug in the process! I was accidentally throwing out good ranging data after a failed message.

The tag blinks at 1 Hz as well, so you could just count the number of successful ranges assume a 1 Hz rate.

Attached is the updated code, also handles both 16 and 64 PRF.

So maybe to get number of errors I should log data on tag’s side? There is option to send measurements back to tag from anchor. Tag blinks, and should know If nobody answers?

Thanks!

That sounds like it would work, you would have to see if the tag’s SPI log has that optional report message. Then you would just compare the number of blinks sent, to report messages received.

Dou you have any documentation with description of log file format?

I want to figure out what is in files of SPI log from PC DecaWave. It’s something like:

File:20150524-105901_DecaWaveAllAccum.log, created by DecaRanging MP Version 2.58 (build:Nov 6 2014, 12:05:43)
Mode: 2, Chan 2, Code 9, PRF 64, Plength 64, DataRate 1, PAC 0, ic:10001082, ucode:xxxx, antdl:8069

C5 13 Rx time = 8.226938816481371e-001 0C3D4E88DC

C5 13 Rx time(un) = 8.226941185897436e-001 0C3D4EC400

txdly 4034 rxdly 4034
RX DATA: c5137510605e20990910b222

RX OK WInd(0735), HLP(0747.3750), PSC(0108), SLP(0000.0000), RC(000C 3D4E88DC), DCR(0), DCI(0), NTH(016A), T(6CBE), RSL(-099.7722), FSL(-100.0241), RSMPL(3F)
Accum Len 1016
12, -32
13, -13
-22, 64
3, 50
-41, 82
-17, 78
59, 63
[…]
44, 59
22, 44
13, -17

[TXD]

TX Frame TimeStamp Raw = 21 7DEBBE34
Adding Antenna Delay = 0021 7DEBBE34
05 Tx time = 2.251203838954828e+000

29 19 Rx time = 2.401204230409280e+000 23B9361FE9

29 19 Rx time(un) = 2.401204471153846e+000 23B9365C00

txdly 4034 rxdly 4034
RX DATA: 41cc19cade8210605e209909107510605e209909102934ecb29101174bfdcc03348a470806a750

RX OK WInd(0735), HLP(0751.4531), PSC(0110), SLP(0000.0000), RC(0023 B9361FE9), DCR(0), DCI(0), NTH(016D), T(6BBE), RSL(-097.9686), FSL(-098.6888), RSMPL(00)
Accum Len 1016
-89, -45
-36, -74
-40, 26
[…]

Full example (~4MB) of log file : https://drive.google.com/open?id=0B5nuvl8RDHCrZXpXbWh1Z0RpelU&authuser=0

Hi,
Can you share once again full example ?