From 76d7cac03a90fd9d55a70f3a2c07a81418aa9706 Mon Sep 17 00:00:00 2001 From: ClockeNessMnstr Date: Wed, 4 Sep 2024 15:08:29 -0400 Subject: [PATCH] Do not teardown for missed message to peer. After max retries is met once the ESP_NOW_Serial_Class performs "end()" which removes the peer from ESP_NOW. Further messages to and from ESP_NOW_Serial are discarded or ignored. Peer should stay in ESP_NOW to re-establish connection even with data loss. This change will retry and drop the data piece by piece instead of aborting the connection. physically --- libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp b/libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp index e4220d45675..b0cbb5ed030 100644 --- a/libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp +++ b/libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp @@ -264,9 +264,10 @@ void ESP_NOW_Serial_Class::onSent(bool success) { //the data is lost in this case vRingbufferReturnItem(tx_ring_buf, queued_buff); queued_buff = NULL; - xSemaphoreGive(tx_sem); - end(); log_e(MACSTR " : RE-SEND_MAX[%u]", MAC2STR(addr()), resend_count); + //send next packet? + //log_d(MACSTR ": NEXT", MAC2STR(addr())); + checkForTxData(); } } }