From 35d43f317383d558d1100914e02944d495271ad3 Mon Sep 17 00:00:00 2001 From: salty Date: Sat, 14 Mar 2026 12:38:28 -0400 Subject: [PATCH] fix: use LOWPOWER mode + add delay(1) to prevent overheating MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- esp32/uwb_anchor/src/main.cpp | 4 ++-- esp32/uwb_tag/src/main.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/esp32/uwb_anchor/src/main.cpp b/esp32/uwb_anchor/src/main.cpp index f9aa5f2..e423b6e 100644 --- a/esp32/uwb_anchor/src/main.cpp +++ b/esp32/uwb_anchor/src/main.cpp @@ -187,9 +187,9 @@ void setup(void) { DW1000Ranging.attachBlinkDevice(newBlink); 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..."); } diff --git a/esp32/uwb_tag/src/main.cpp b/esp32/uwb_tag/src/main.cpp index 0f0f737..a8a1a65 100644 --- a/esp32/uwb_tag/src/main.cpp +++ b/esp32/uwb_tag/src/main.cpp @@ -373,7 +373,7 @@ void setup(void) { DW1000Ranging.attachNewDevice(newDevice); DW1000Ranging.attachInactiveDevice(inactiveDevice); - DW1000Ranging.startAsTag(TAG_ADDR, DW1000.MODE_LONGDATA_RANGE_ACCURACY); + DW1000Ranging.startAsTag(TAG_ADDR, DW1000.MODE_LONGDATA_RANGE_LOWPOWER); /* Init state */ for (int i = 0; i < NUM_ANCHORS; i++) { @@ -382,7 +382,7 @@ void setup(void) { 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"); } @@ -408,4 +408,7 @@ void loop(void) { /* Display at 5 Hz */ display_update(); + + /* Yield to prevent tight-loop when no anchors respond */ + delay(1); }