Skip to content

Commit 40c0210

Browse files
author
Lee Leahy
committed
NTRIP Server: Add zedBytesSent value
The left justified timestamp is displayed approximately once per second. Data is delivered by the ZED to the ESP32 a byte at a time. The "Tx RTCM" messages are printed after 5 milliesconds of idle time, trying to display transactions between the ZED and the ESP32. The "NTRIP Server transmitted" messages are printed after 100 milliseconds of idle time, trying to display network packets that might be sent to the NTRIP server. In the old behavior, several "Tx RTCM" messages were displayed and the value in the last message equaled the value in the "NTRIP Server transmitted" message. This was confusing because the byte count grew with each "TX RTCM" message. This commit adds the zedBytesSent value to count the bytes sent by the ZED to the ESP32. The zedBytesSent value is displayed after 5 milliseconds of idle time and then reset to zero. Totaling the "Tx RTCM" values between the "NTRIP Server transmitted" messages equals the value in the "NTRIP Server transmitted" message. Another way to say this is: Totaling the bytes output by the ZED ("Tx RTCM") separated by 5 milliseconds of idle time equals the number of bytes ("NTRIP Server transmitted") separated by 100 milliseconds.
1 parent 072bdec commit 40c0210

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Firmware/RTK_Surveyor/NtripServer.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ void ntripServerPrintStatus ()
379379
// This function gets called as each RTCM byte comes in
380380
void ntripServerProcessRTCM(uint8_t incoming)
381381
{
382+
static uint32_t zedBytesSent;
383+
382384
if (ntripServerState == NTRIP_SERVER_CASTING)
383385
{
384386
// Generate and print timestamp if needed
@@ -400,7 +402,8 @@ void ntripServerProcessRTCM(uint8_t incoming)
400402
struct tm timeinfo = rtc.getTimeStruct();
401403
char timestamp[30];
402404
strftime(timestamp, sizeof(timestamp), "%Y-%m-%d %H:%M:%S", &timeinfo);
403-
systemPrintf(" Tx RTCM: %s.%03ld, %d bytes sent\r\n", timestamp, rtc.getMillis(), ntripServerBytesSent);
405+
systemPrintf(" Tx RTCM: %s.%03ld, %d bytes sent\r\n", timestamp, rtc.getMillis(), zedBytesSent);
406+
zedBytesSent = 0;
404407
}
405408
previousMilliseconds = currentMilliseconds;
406409
}
@@ -418,6 +421,7 @@ void ntripServerProcessRTCM(uint8_t incoming)
418421
{
419422
ntripServer->write(incoming); // Send this byte to socket
420423
ntripServerBytesSent++;
424+
zedBytesSent++;
421425
ntripServerTimer = millis();
422426
netOutgoingRTCM = true;
423427
}

0 commit comments

Comments
 (0)