Include RSSI in rangetest csv (#8395)

* Include RSSI in rangetest csv

* Fix typo

* Preserve csv column order

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Ford Jones
2025-10-22 20:08:17 +11:00
committed by GitHub
co-authored by GitHub Ben Meadors
parent 26747038bb
commit 15ee1c2819
+5 -2
View File
@@ -159,6 +159,7 @@ ProcessMessage RangeTestModuleRadio::handleReceived(const meshtastic_MeshPacket
LOG_DEBUG("---- Received Packet:"); LOG_DEBUG("---- Received Packet:");
LOG_DEBUG("mp.from %d", mp.from); LOG_DEBUG("mp.from %d", mp.from);
LOG_DEBUG("mp.rx_snr %f", mp.rx_snr); LOG_DEBUG("mp.rx_snr %f", mp.rx_snr);
LOG_DEBUG("mp.rx_rssi %f", mp.rx_rssi);
LOG_DEBUG("mp.hop_limit %d", mp.hop_limit); LOG_DEBUG("mp.hop_limit %d", mp.hop_limit);
LOG_DEBUG("---- Node Information of Received Packet (mp.from):"); LOG_DEBUG("---- Node Information of Received Packet (mp.from):");
LOG_DEBUG("n->user.long_name %s", n->user.long_name); LOG_DEBUG("n->user.long_name %s", n->user.long_name);
@@ -234,8 +235,8 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp)
} }
// Print the CSV header // Print the CSV header
if (fileToWrite.println( if (fileToWrite.println("time,from,sender name,sender lat,sender long,rx lat,rx long,rx elevation,rx "
"time,from,sender name,sender lat,sender long,rx lat,rx long,rx elevation,rx snr,distance,hop limit,payload")) { "snr,distance,hop limit,payload,rx rssi")) {
LOG_INFO("File was written"); LOG_INFO("File was written");
} else { } else {
LOG_ERROR("File write failed"); LOG_ERROR("File write failed");
@@ -297,6 +298,8 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp)
// TODO: If quotes are found in the payload, it has to be escaped. // TODO: If quotes are found in the payload, it has to be escaped.
fileToAppend.printf("\"%s\"\n", p.payload.bytes); fileToAppend.printf("\"%s\"\n", p.payload.bytes);
fileToAppend.printf("%i,", mp.rx_rssi); // RX RSSI
fileToAppend.flush(); fileToAppend.flush();
fileToAppend.close(); fileToAppend.close();