Skip to content

Commit 0eb1625

Browse files
committed
Add menu to control logging. Remove highFreq time stamping.
High freq time stamping was a hold over from OpenLog and is not needed here. We update the timestamps each lastUBXLogSyncTime (currently every 3s).
1 parent 5d7f7a7 commit 0eb1625

File tree

5 files changed

+81
-4
lines changed

5 files changed

+81
-4
lines changed

Firmware/RTK_Surveyor/NVM.ino

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ void recordSystemSettingsToFile()
9191
settingsFile.println("printDebugMessages=" + (String)settings.printDebugMessages);
9292
settingsFile.println("enableSD=" + (String)settings.enableSD);
9393
settingsFile.println("enableDisplay=" + (String)settings.enableDisplay);
94-
settingsFile.println("frequentFileAccessTimestamps=" + (String)settings.frequentFileAccessTimestamps);
9594
settingsFile.println("maxLogTime_minutes=" + (String)settings.maxLogTime_minutes);
9695
settingsFile.println("observationSeconds=" + (String)settings.observationSeconds);
9796
settingsFile.println("observationPositionAccuracy=" + (String)settings.observationPositionAccuracy);
@@ -379,8 +378,6 @@ bool parseLine(char* str) {
379378
settings.enableSD = d;
380379
else if (strcmp(settingName, "enableDisplay") == 0)
381380
settings.enableDisplay = d;
382-
else if (strcmp(settingName, "frequentFileAccessTimestamps") == 0)
383-
settings.frequentFileAccessTimestamps = d;
384381
else if (strcmp(settingName, "maxLogTime_minutes") == 0)
385382
settings.maxLogTime_minutes = d;
386383
else if (strcmp(settingName, "observationSeconds") == 0)

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ BluetoothSerial SerialBT;
188188
#include "esp_bt.h" //Core access is needed for BT stop. See customBTstop() for more info.
189189
#include "esp_gap_bt_api.h" //Needed for setting of pin. See issue: https://github.com/sparkfun/SparkFun_RTK_Surveyor/issues/5
190190

191+
char platformBluetoothPrefix[40] = "Surveyor"; //Sets the prefix for broadcast names
192+
191193
HardwareSerial serialGNSS(2);
192194
#define RXD2 16
193195
#define TXD2 17

Firmware/RTK_Surveyor/menuMain.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ void menuMain()
2323

2424
Serial.println(F("4) Configure Ports"));
2525

26+
Serial.println(F("5) Configure Logging"));
27+
2628
if (online.accelerometer == true)
2729
Serial.println(F("b) Bubble Level"));
2830

@@ -47,6 +49,8 @@ void menuMain()
4749
menuBase();
4850
else if (incoming == '4')
4951
menuPorts();
52+
else if (incoming == '5')
53+
menuLog();
5054
else if (incoming == 'd')
5155
menuDebug();
5256
else if (incoming == 'r')

Firmware/RTK_Surveyor/menuMessages.ino

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,78 @@
1+
//Control the messages that get logged to SD
2+
//Control max logging time (limit to a certain number of minutes)
3+
//The main use case is the setup for a base station to log RAW sentences that then get post processed
4+
void menuLog()
5+
{
6+
while (1)
7+
{
8+
Serial.println();
9+
Serial.println(F("Menu: Logging Menu"));
10+
11+
if (settings.enableSD && online.microSD)
12+
Serial.println(F("microSD card is online"));
13+
else
14+
{
15+
beginSD(); //Test if SD is present
16+
if (online.microSD == true)
17+
Serial.println(F("microSD card online"));
18+
else
19+
Serial.println(F("No microSD card is detected"));
20+
}
21+
22+
Serial.print(F("1) Log to microSD: "));
23+
if (settings.enableLogging == true) Serial.println(F("Enabled"));
24+
else Serial.println(F("Disabled"));
25+
26+
if (settings.enableLogging == true)
27+
{
28+
Serial.print(F("2) Set max logging time: "));
29+
Serial.print(settings.maxLogTime_minutes);
30+
Serial.println(F(" minutes"));
31+
}
32+
33+
Serial.println(F("x) Exit"));
34+
35+
byte incoming = getByteChoice(30); //Timeout after x seconds
36+
37+
if (incoming == '1')
38+
{
39+
settings.enableLogging ^= 1;
40+
}
41+
else if (settings.enableLogging == true)
42+
{
43+
if (incoming == '2')
44+
{
45+
Serial.print(F("Enter max minutes to log data: "));
46+
int maxMinutes = getNumber(menuTimeout); //Timeout after x seconds
47+
if (maxMinutes < 0 || maxMinutes > 60 * 48) //Arbitrary 48 hour limit
48+
{
49+
Serial.println(F("Error: max minutes out of range"));
50+
}
51+
else
52+
{
53+
settings.maxLogTime_minutes = maxMinutes; //Recorded to NVM and file at main menu exit
54+
}
55+
}
56+
else if (incoming == 'x')
57+
break;
58+
else if (incoming == STATUS_GETBYTE_TIMEOUT)
59+
break;
60+
else
61+
printUnknown(incoming);
62+
}
63+
else if (incoming == 'x')
64+
break;
65+
else if (incoming == STATUS_GETBYTE_TIMEOUT)
66+
{
67+
break;
68+
}
69+
else
70+
printUnknown(incoming);
71+
}
72+
73+
while (Serial.available()) Serial.read(); //Empty buffer of any newline chars
74+
}
75+
176
//Control the messages that get broadcast over Bluetooth and logged (if enabled)
277
void menuMessages()
378
{

Firmware/RTK_Surveyor/settings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ struct struct_settings {
248248
bool printDebugMessages = false;
249249
bool enableSD = true;
250250
bool enableDisplay = true;
251-
bool frequentFileAccessTimestamps = false;
252251
int maxLogTime_minutes = 60 * 10; //Default to 10 hours
253252
int observationSeconds = 60; //Default survey in time of 60 seconds
254253
float observationPositionAccuracy = 5.0; //Default survey in pos accy of 5m

0 commit comments

Comments
 (0)