Skip to content

Commit 4586789

Browse files
committed
Cleanup RTCM log_ds
1 parent e2af03f commit 4586789

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

Firmware/RTK_Surveyor/ESPNOW.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void espnowOnDataRecieved(const uint8_t *mac, const uint8_t *incomingData, int l
6363

6464
//Pass RTCM bytes (presumably) from ESP NOW out ESP32-UART2 to ZED-UART1
6565
serialGNSS.write(incomingData, len);
66-
log_d("ESPNOW: Received %d bytes, RSSI: %d", len, espnowRSSI);
66+
log_d("ESPNOW received %d RTCM bytes, pushed to ZED, RSSI: %d", len, espnowRSSI);
6767

6868
espnowIncomingRTCM = true;
6969
lastEspnowRssiUpdate = millis();
@@ -348,7 +348,8 @@ void espnowProcessRTCM(byte incoming)
348348
espnowOutgoingSpot = 0; //Wrap
349349
esp_now_send(0, (uint8_t *) &espnowOutgoing, sizeof(espnowOutgoing)); //Send packet to all peers
350350
delay(10); //We need a small delay between sending multiple packets
351-
log_d("ESPNOW pushed %d RTCM bytes", sizeof(espnowOutgoing));
351+
352+
espnowBytesSent += sizeof(espnowOutgoing);
352353

353354
espnowOutgoingRTCM = true;
354355
}

Firmware/RTK_Surveyor/NtripClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ void ntripClientUpdate()
460460
i2cGNSS.pushRawData(rtcmData, rtcmCount);
461461
wifiIncomingRTCM = true;
462462

463-
log_d("NTRIP Client pushed %d RTCM bytes to ZED", rtcmCount);
463+
log_d("NTRIP Client received %d RTCM bytes, pushed to ZED", rtcmCount);
464464
}
465465
}
466466

Firmware/RTK_Surveyor/NtripServer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ void ntripServerProcessRTCM(uint8_t incoming)
368368
//If we have not gotten new RTCM bytes for a period of time, assume end of frame
369369
if (millis() - ntripServerTimer > 100 && ntripServerBytesSent > 0)
370370
{
371-
log_d("NTRIP Server pushed %d RTCM bytes to Caster", ntripServerBytesSent);
371+
log_d("NTRIP Server transmitted %d RTCM bytes to Caster", ntripServerBytesSent);
372372
ntripServerBytesSent = 0;
373373
rtcmPacketsSent++; //If not checking RTCM CRC, count based on timeout
374374
}

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ float lBandEBNO = 0.0; //Used on system status menu
354354

355355
uint8_t espnowOutgoing[250]; //ESP NOW has max of 250 characters
356356
unsigned long espnowLastAdd; //Tracks how long since last byte was added to the outgoing buffer
357-
uint8_t espnowOutgoingSpot = 0;
357+
uint8_t espnowOutgoingSpot = 0; //ESP Now has max of 250 characters
358+
uint16_t espnowBytesSent = 0; //May be more than 255
358359
uint8_t receivedMAC[6]; //Holds the broadcast MAC during pairing
359360

360361
int espnowRSSI = 0;
@@ -848,8 +849,12 @@ void updateRadio()
848849
//then we've reached the end of the RTCM stream. Send partial buffer.
849850
if (espnowOutgoingSpot > 0 && (millis() - espnowLastAdd) > 50)
850851
{
852+
rtcmPacketsSent++; //Assume this is the end of the RTCM frame
853+
851854
esp_now_send(0, (uint8_t *) &espnowOutgoing, espnowOutgoingSpot); //Send partial packet to all peers
852-
//log_d("ESPNOW: Sending %d bytes", espnowOutgoingSpot);
855+
856+
log_d("ESPNOW transmitted %d RTCM bytes", espnowBytesSent + espnowOutgoingSpot);
857+
espnowBytesSent = 0;
853858
espnowOutgoingSpot = 0; //Reset
854859
}
855860

Firmware/RTK_Surveyor/Tasks.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ void F9PSerialWriteTask(void *e)
1818
//TODO - control if this RTCM source should be listened to or not
1919
serialGNSS.write(wBuffer, s);
2020
bluetoothIncomingRTCM = true;
21+
log_d("Bluetooth received %d RTCM bytes, sent to ZED", s);
2122

2223
if (settings.enableTaskReports == true)
2324
Serial.printf("SerialWriteTask High watermark: %d\n\r", uxTaskGetStackHighWaterMark(NULL));
@@ -671,4 +672,3 @@ void idleTask(void *e)
671672
}
672673
}
673674
#endif //COMPILE_IDLE_TASKS
674-

0 commit comments

Comments
 (0)