Ensure full repeater packet logging

This commit is contained in:
mikecarper committed 2026-08-19 16:20:24 -07:00
1 parent 1e4fee0750
commit a52d4e1cba
4 files changed
+10 -17

No files matched your search

+5
View File
@@ -477,6 +477,11 @@ instead of silently omitting the record. A disconnected host cannot retain an
unbounded capture, so logging deployments should keep the reader attached and
draining the serial port.
Every valid received frame also emits the decoded RX summary, including signal,
timing, hash, type, route, and payload information. Frames that cannot be
decoded still emit their `RAW:` line. Transmitted packets emit the decoded TX
summary.
Ordinary `-logging-` artifacts keep packet logging separate from LoRa OTA.
Use the separately named `-ota-` artifact when LoRa OTA is required. A
`-full-logging-ota-` artifact is intentionally the exception: it combines
+1 -1
View File
@@ -1015,7 +1015,7 @@ const char *MyMesh::getLogDateTime() {
}
void MyMesh::logRxRaw(float snr, float rssi, const uint8_t raw[], int len) {
#if MESH_PACKET_LOGGING && !defined(MESH_COMPACT_PACKET_LOGGING)
#if MESH_PACKET_LOGGING
if (mesh::isUsbLoggingEnabled()) {
// Logging builds prefer backpressure over silently losing a packet record.
Serial.print(getLogDateTime());
+4 -15
View File
@@ -178,8 +178,10 @@ bool Dispatcher::startOutboundTransmit() {
outbound_expiry = futureMillis(max_airtime);
#if MESH_PACKET_LOGGING
logPacketStart("TX", outbound, len);
logPacketEnd(outbound);
if (isUsbLoggingEnabled()) {
logPacketStart("TX", outbound, len);
logPacketEnd(outbound);
}
#endif
return true;
}
@@ -220,23 +222,13 @@ uint32_t Dispatcher::getCADFailMaxDuration() const {
#if MESH_PACKET_LOGGING
void Dispatcher::logPacketStart(const char* direction, const Packet* packet, int len) {
if (!isUsbLoggingEnabled()) return;
#if defined(MESH_COMPACT_PACKET_LOGGING)
(void)packet;
Serial.printf("%s %d\n", direction, len);
#else
Serial.print(getLogDateTime());
Serial.printf(": %s, len=%d (type=%d, route=%s, payload_len=%d)",
direction, len, packet->getPayloadType(),
packet->isRouteDirect() ? "D" : "F", packet->payload_len);
#endif
}
void Dispatcher::logPacketEnd(const Packet* packet) {
if (!isUsbLoggingEnabled()) return;
#if defined(MESH_COMPACT_PACKET_LOGGING)
(void)packet;
#else
const uint8_t type = packet->getPayloadType();
if (packet->payload_len >= 2
&& (type == PAYLOAD_TYPE_PATH || type == PAYLOAD_TYPE_REQ
@@ -246,7 +238,6 @@ void Dispatcher::logPacketEnd(const Packet* packet) {
} else {
Serial.write((uint8_t)'\n');
}
#endif
}
#endif
@@ -602,7 +593,6 @@ void Dispatcher::checkRecv() {
#if MESH_PACKET_LOGGING
if (isUsbLoggingEnabled()) {
logPacketStart("RX", pkt, pkt->getRawLength());
#if !defined(MESH_COMPACT_PACKET_LOGGING)
Serial.printf(" SNR=%d RSSI=%d score=%d time=%d", (int)pkt->getSNR(),
(int)rssi, (int)(score * 1000), air_time);
@@ -611,7 +601,6 @@ void Dispatcher::checkRecv() {
Serial.print(" hash=");
mesh::Utils::printHex(Serial, packet_hash, MAX_HASH_SIZE);
logPacketEnd(pkt);
#endif
}
#endif
logRx(pkt, pkt->getRawLength(), score); // hook for custom logging
-1
View File
@@ -67,7 +67,6 @@ build_flags = ${lora_e5.build_flags}
-D MAX_NEIGHBOURS=50
-D FLOOD_PACKET_FILTER_SLOTS=8
-D FLOOD_CHANNEL_SCOPE_SLOTS=7
-D MESH_COMPACT_PACKET_LOGGING=1
-D ENABLE_HWSERIAL2
-D WITH_RS232_BRIDGE=Serial2
-D WITH_RS232_BRIDGE_RX=PA3