Está en la página 1de 4

4/13/2017 [Bug fix] Potentially solved the problem of not getting 3 ranges when running 3 anchors and 1 tag

tag · Issue #179 · thotro/ardui…

Features Business Explore Pricing This repository Search Sign in or Sign up

thotro / arduino-dw1000 Watch 75 Star 171 Fork 102

Code Issues 109 Pull requests 1 Projects 0 Wiki Pulse Graphs

[Bug fix] Potentially solved the problem of not getting 3 New issue

ranges when running 3 anchors and 1 tag #179


Open ybc82 opened this issue 19 days ago · 10 comments

ybc82 commented 19 days ago Assignees

No one assigned
I have been running 3 anchors and 1 tag simultaneously so that I should be able to get three ranges and
therefore the position of the tag. But I always had problems that some anchors 'died' from time to time (I Labels
can't get range reading of them from the tag; the serial port of the anchors output lots of 'Not found'; the
None yet
serial port of the tag output lots of 'delete inactive device: ', '1 device added'), which other people have
suffered from too.
Projects
I recently found that the solution should be that for the variable '_networkDevicesNumber' declaration in
None yet
DW1000Ranging.h and initialization in DW1000Ranging.cpp, add a 'volatile' to it. My explanation for this is
that otherwise this variable is not read correctly in the function 'addNetworkDevices' and will cause errors in
Milestone
the device list.
No milestone

ybc82 referenced this issue 19 days ago


7 participants
Can't get range #178 Open

xforus commented 19 days ago

Hello ybc82. What example code do you have problems?


Using DW1000Ranging_ANCHOR/TAG, with last version and with defaults, I never had problems receiving
3 ranges.
But I experienced problemes when I decrease cycles of POLLS between BLINKS. For example in:
counterForBlink > 20, when I change to "1" . So 50% POLLS and BLINKS is needed for me.

I found the cause of problem but not solution.


Problem is because last ANCHOR to receive POLL don't receive it. Anchor transmit RANGE INIT but don't
receive POLL. So TAG is waiting for last ANCHOR but never is received, so no range is transmited to other
Anchors, because Tag needs all POLL ACK's to send RANGE.

I don't know if this is the same problem to you.

ybc82 commented 16 days ago

@xforus , I'm using the same example code. I'm using Arduino Pro mini and Arduino 1.6.10. People have
reported that the code works well with Arduino 1.6.9 and I don't know if that's the case.

I think the cause you described is similar to mine. And I figured out that the cause of 'this cause' was that
the non-volatile variable caused problems in new device registration or deletion of inactive devices.

Thank you!

Rotzbua commented 15 days ago Contributor

https://github.com/thotro/arduino-dw1000/issues/179 1/4
4/13/2017 [Bug fix] Potentially solved the problem of not getting 3 ranges when running 3 anchors and 1 tag · Issue #179 · thotro/ardui…
@ybc82 If it fixes the problem, please make a pull request instead of an issue. So the code can be
improved.

In general the code except DW1000.h/cpp are a proof of concept code. I already refactored and changed a
lot but there is still a lot to do if you search TODO . I think the code do not consider about race conditions
and volatile variables. It would be good if you can look for such variables and fix them.

xforus commented 15 days ago

@ybc82 I have changed the variable '_networkDevicesNumber' as you said. But this don't solve my
problem.

I'm using Arduino 1.6.8.


With 1.8.1 it doesn't work nothing.

I think that problem is at receiving part of Anchor.


This is my Log where you can see 3 anchors and 1 Tag. When Tag is expected to receive a POLL ACK
from 3th Anchor but don't receive Poll from Tag so it doesnt' answer with a POLL ACK. Tag don't send
range to other 2 Anchors because it waits to have all POLLS ACK from all Anchors:

Log at TAG part:

BLINK_SEND
ranging init; 1 device added ! -> short:CAE7
RANGING_INIT_RECEIVED CA:E7
POLL_SEND TO 1 DEVICES
POLL_ACK_RECEIVED CA:E7
RANGE_SEND TO 1 DEVICES
RANGE_REPORT_RECEIVED
from: CAE7 Range: 0.46 m RX power: -68.06 dBm

BLINK_SEND
ranging init; 1 device added ! -> short:9791
RANGING_INIT_RECEIVED 97:91
POLL_SEND TO 2 DEVICES
POLL_ACK_RECEIVED CA:E7
POLL_ACK_RECEIVED 97:91
RANGE_SEND TO 2 DEVICES
RANGE_REPORT_RECEIVED
from: CAE7 Range: 0.51 m RX power: -67.54 dBm
RANGE_REPORT_RECEIVED
from: 9791 Range: 1.06 m RX power: -70.45 dBm

BLINK_SEND
ranging init; 1 device added ! -> short:BAAB
RANGING_INIT_RECEIVED BA:AB
POLL_SEND TO A 3 DEVICES
POLL_ACK_RECEIVED CA:E7
POLL_ACK_RECEIVED 97:91

(here 3th Anchor should receive a Poll and send an ACK. but it don't. So no range from Tag and
result is : inactive time)

(in next cycle of blink 3th Anchor receive Poll and answres correctly):

BLINK_SEND
!!inactive time!!
delete inactive device: BAAB
ranging init; 1 device added ! -> short:BAAB
RANGING_INIT_RECEIVED BA:AB
POLL_SEND TO 3 DEVICES
POLL_ACK_RECEIVED CA:E7
POLL_ACK_RECEIVED 97:91
POLL_ACK_RECEIVED BA:AB
RANGE_SEND TO 3 DEVICES

https://github.com/thotro/arduino-dw1000/issues/179 2/4
4/13/2017 [Bug fix] Potentially solved the problem of not getting 3 ranges when running 3 anchors and 1 tag · Issue #179 · thotro/ardui…
RANGE_REPORT_RECEIVED
from: CAE7 Range: 0.51 m RX power: -67.36 dBm
RANGE_REPORT_RECEIVED
from: 9791 Range: 0.99 m RX power: -70.16 dBm
RANGE_REPORT_RECEIVED
from: BAAB Range: 0.99 m RX power: -68.09 dBm

kuek commented 14 days ago • edited

hi, I found out that it works well when compiling the code with Atmel Studio. It does not work when compiled
with Arduino IDE. So it seems like a compiler problem to me.

I have one PC with IDE 1.6.11 and another one with 1.6.13, both don't work well when I flashed the tag with
the code and run it in a 3 (or more) anchor scenario. I then started to port the code to Atmel Studio and it
works like charm. There were no code changes at all.

AliSiddiqui4 commented 12 days ago

@kuek did you uploaded the original code using Atmel Studion? and are you receiving all the 3 ranges
form the three tag? and is the mode the default LONGDATA_RANGE_ACCURACY?

rbrtwtrs commented 11 days ago

I changed the variable _networkDevicesNumber to volatile and confirmed that I do now get ranges from all
three anchors. I notice that the data rate varies and it appears to stumble which as Rotzbua says seems like
it is a race condition. Changing to a volatile is a kludge fix to the underlying problem.
I am using the Visual Micro Plugin for Visual Studio. If a particular compiler version does work it is also a
likely kludge fix to the underlying issue.

AliSiddiqui4 commented 4 days ago

@ybc82 WHAT MODE ARE YOU USING?

ybc82 commented 2 days ago

@AliSiddiqui4 I'm not sure what you mean by 'MODE', but generally, I'm using the demo code of
DW1000Ranging.

christoshadjiaslanis commented a day ago • edited

@rbrtwtrs Did you change the _networkDevicesNumber variable to volatile only in the TAG or also in the
Anchors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

https://github.com/thotro/arduino-dw1000/issues/179 3/4
4/13/2017 [Bug fix] Potentially solved the problem of not getting 3 ranges when running 3 anchors and 1 tag · Issue #179 · thotro/ardui…
© 2017 GitHub, Inc. Terms Privacy Security Status Help Contact GitHub API Training Shop Blog About

https://github.com/thotro/arduino-dw1000/issues/179 4/4

También podría gustarte