Fix LXMF bidirectional messaging, increase known_destinations cap

Outbound (Ratdeck→Python) was broken because Identity::recall() could
never find the recipient. Root cause: OS::time() returns seconds since
boot on ESP32, but persisted known_destinations entries carried timestamps
from the previous session. New announces got timestamp ~31s while persisted
entries had ~5000s, so the LRU cull immediately removed the new entry.

The microReticulum Identity.cpp fix (timestamp normalization on load) is
in .pio/libdeps and must be upstreamed to ratspeak/microReticulum separately.

Changes:
- known_destinations cap 256→512 (PSRAM pool was 1% used, plenty of room)
- Fix link delivery destHash: onLinkEstablished callback was passing link_id
  instead of LXMF destination hash, corrupting conversation routing
- Add diagnostic logging: [LXMF-DIAG], [TCP-DIAG], [HEART-DIAG], [DIAG-PROOF]
  for tracing link establishment, proof routing, and interface status
This commit is contained in:
DeFiDude
2026-03-20 19:24:28 -06:00
parent 45df807424
commit 43e5420416
4 changed files with 39 additions and 3 deletions
+10
View File
@@ -138,6 +138,16 @@ void TCPClientInterface::send_outgoing(const RNS::Bytes& data) {
uint8_t header_type = (flags >> 6) & 0x01;
uint8_t packet_type = flags & 0x03;
// Diagnostic: identify packet types going through TCP
static const char* pt_names[] = {"DATA", "ANNOUNCE", "LINKREQ", "PROOF"};
Serial.printf("[TCP-DIAG] send: %d bytes ht=%d pt=%s(%d) to %s:%d\n",
(int)data.size(), header_type,
(packet_type < 4) ? pt_names[packet_type] : "?", packet_type,
_host.c_str(), _port);
if (packet_type == 0x03) {
Serial.printf("[TCP-DIAG] *** PROOF packet being sent via TCP! ***\n");
}
if (packet_type != 0x01) { // Not ANNOUNCE
if (header_type == 0) {
// Header1 → wrap as Header2 (handles hops==1, hops==0, unknown path)