fix: use LOWPOWER mode + add delay(1) to prevent overheating

- MODE_LONGDATA_RANGE_ACCURACY → MODE_LONGDATA_RANGE_LOWPOWER (both anchor+tag)
- Add delay(1) in tag loop to prevent tight-loop when no anchors respond
- ACCURACY was unnecessary and kept DW1000 radio hot
This commit is contained in:
salty 2026-03-14 12:38:28 -04:00
parent b7dcc00c5e
commit 35d43f3173
2 changed files with 7 additions and 4 deletions

View File

@ -187,9 +187,9 @@ void setup(void) {
DW1000Ranging.attachBlinkDevice(newBlink); DW1000Ranging.attachBlinkDevice(newBlink);
DW1000Ranging.attachInactiveDevice(inactiveDevice); DW1000Ranging.attachInactiveDevice(inactiveDevice);
DW1000Ranging.startAsAnchor(ANCHOR_ADDR, DW1000.MODE_LONGDATA_RANGE_ACCURACY, false); DW1000Ranging.startAsAnchor(ANCHOR_ADDR, DW1000.MODE_LONGDATA_RANGE_LOWPOWER, false);
Serial.printf("[uwb_anchor] DW1000 ready id=%d MODE_LONGDATA_RANGE_ACCURACY\r\n", ANCHOR_ID); Serial.printf("[uwb_anchor] DW1000 ready id=%d MODE_LONGDATA_RANGE_LOWPOWER\r\n", ANCHOR_ID);
Serial.println("[uwb_anchor] Listening for tags..."); Serial.println("[uwb_anchor] Listening for tags...");
} }

View File

@ -373,7 +373,7 @@ void setup(void) {
DW1000Ranging.attachNewDevice(newDevice); DW1000Ranging.attachNewDevice(newDevice);
DW1000Ranging.attachInactiveDevice(inactiveDevice); DW1000Ranging.attachInactiveDevice(inactiveDevice);
DW1000Ranging.startAsTag(TAG_ADDR, DW1000.MODE_LONGDATA_RANGE_ACCURACY); DW1000Ranging.startAsTag(TAG_ADDR, DW1000.MODE_LONGDATA_RANGE_LOWPOWER);
/* Init state */ /* Init state */
for (int i = 0; i < NUM_ANCHORS; i++) { for (int i = 0; i < NUM_ANCHORS; i++) {
@ -382,7 +382,7 @@ void setup(void) {
g_anchor_last_ok[i] = 0; g_anchor_last_ok[i] = 0;
} }
Serial.println("[uwb_tag] DW1000 ready MODE_LONGDATA_RANGE_ACCURACY"); Serial.println("[uwb_tag] DW1000 ready MODE_LONGDATA_RANGE_LOWPOWER");
Serial.println("[uwb_tag] Ranging + display + ESP-NOW active"); Serial.println("[uwb_tag] Ranging + display + ESP-NOW active");
} }
@ -408,4 +408,7 @@ void loop(void) {
/* Display at 5 Hz */ /* Display at 5 Hz */
display_update(); display_update();
/* Yield to prevent tight-loop when no anchors respond */
delay(1);
} }