From 4e06f7a96d794b2ac27c3751f9421fb202b15afb Mon Sep 17 00:00:00 2001 From: acidburns Date: Wed, 4 Feb 2026 00:35:01 +0100 Subject: [PATCH] Log ACK transmit and reject cases - Add debug log for ACK TX with batch/sender/receiver ids - Log rejected ACKs to help diagnose mismatched ids or batches --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 1b50178..0f49a3f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -497,6 +497,9 @@ static void send_batch_ack(uint16_t batch_id, uint16_t sender_id) { write_u16_le(&ack.payload[0], batch_id); write_u16_le(&ack.payload[2], sender_id); write_u16_le(&ack.payload[4], g_short_id); + if (SERIAL_DEBUG_MODE) { + serial_debug_printf("ack: tx batch_id=%u sender=%u receiver=%u", batch_id, sender_id, g_short_id); + } lora_send(ack); lora_receive_continuous(); } @@ -851,6 +854,9 @@ static void sender_loop() { g_last_acked_batch_id = ack_id; serial_debug_printf("ack: ok batch_id=%u", ack_id); finish_inflight_batch(); + } else if (SERIAL_DEBUG_MODE) { + serial_debug_printf("ack: reject batch_id=%u sender=%u receiver=%u exp_batch=%u exp_sender=%u", + ack_id, ack_sender, ack_receiver, g_last_sent_batch_id, g_short_id); } } }