Skip to content

Commit 04dcd41

Browse files
committed
Change L-Band menu to PointPerfect. Add AP config for PointPerfect, external triggers, NTRIP client, NTRIP Server/Client caster.
1 parent 4f912bf commit 04dcd41

File tree

11 files changed

+1226
-622
lines changed

11 files changed

+1226
-622
lines changed

Firmware/RTK_Surveyor/AP-Config/index.html

Lines changed: 389 additions & 142 deletions
Large diffs are not rendered by default.

Firmware/RTK_Surveyor/AP-Config/src/main.js

Lines changed: 185 additions & 140 deletions
Large diffs are not rendered by default.

Firmware/RTK_Surveyor/Display.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ void displayKeysUpdated()
20392039
void paintKeyDaysRemaining(int daysRemaining, uint16_t displayTime)
20402040
{
20412041
//28 days
2042-
//until L-Band
2042+
//until PP
20432043
//keys expire
20442044

20452045
if (online.display == true)
@@ -2077,9 +2077,9 @@ void paintKeyDaysRemaining(int daysRemaining, uint16_t displayTime)
20772077
oled.print("Until");
20782078

20792079
y += fontHeight;
2080-
textX = x - (oled.getStringWidth("L-Band") / 2);
2080+
textX = x - (oled.getStringWidth("PP") / 2);
20812081
oled.setCursor(textX, y);
2082-
oled.print("L-Band");
2082+
oled.print("PP");
20832083

20842084
y += fontHeight;
20852085
textX = x - (oled.getStringWidth("Keys") / 2);
@@ -2099,7 +2099,7 @@ void paintKeyDaysRemaining(int daysRemaining, uint16_t displayTime)
20992099

21002100
void paintKeyWiFiFail(uint16_t displayTime)
21012101
{
2102-
//L-Band
2102+
//PP
21032103
//Update
21042104
//Failed
21052105
//No WiFi
@@ -2115,9 +2115,9 @@ void paintKeyWiFiFail(uint16_t displayTime)
21152115
int fontHeight = 13;
21162116
int textX;
21172117

2118-
textX = x - (oled.getStringWidth("L-Band") / 2); //Starting point of text
2118+
textX = x - (oled.getStringWidth("PP") / 2); //Starting point of text
21192119
oled.setCursor(textX, y);
2120-
oled.print("L-Band");
2120+
oled.print("PP");
21212121

21222122
y += fontHeight;
21232123
textX = x - (oled.getStringWidth("Update") / 2);

Firmware/RTK_Surveyor/Form.ino

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static void handleFirmwareFileUpload(AsyncWebServerRequest *request, String file
291291
void onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len)
292292
{
293293
if (type == WS_EVT_CONNECT) {
294-
char settingsCSV[3000];
294+
char settingsCSV[4000];
295295
memset(settingsCSV, 0, sizeof(settingsCSV));
296296
createSettingsString(settingsCSV);
297297
log_d("Sending command: %s\n\r", settingsCSV);
@@ -411,22 +411,47 @@ void createSettingsString(char* settingsCSV)
411411
stringRecord(settingsCSV, "radioPortBaud", settings.radioPortBaud);
412412
stringRecord(settingsCSV, "dataPortChannel", settings.dataPortChannel);
413413

414-
//New settings not yet integrated
414+
//LBand
415+
char hardwareID[13];
416+
sprintf(hardwareID, "%02X%02X%02X%02X%02X%02X", unitMACAddress[0], unitMACAddress[1], unitMACAddress[2], unitMACAddress[3], unitMACAddress[4], unitMACAddress[5]); //Get ready for JSON
417+
stringRecord(settingsCSV, "hardwareID", hardwareID);
418+
419+
char apDaysRemaining[50];
420+
if (strlen(settings.pointPerfectCurrentKey) > 0)
421+
{
422+
uint8_t daysRemaining = daysFromEpoch(settings.pointPerfectNextKeyStart + settings.pointPerfectNextKeyDuration + 1);
423+
sprintf(apDaysRemaining, "%d", daysRemaining);
424+
}
425+
else
426+
sprintf(apDaysRemaining, "No Keys");
427+
428+
stringRecord(settingsCSV, "daysRemaining", apDaysRemaining);
429+
430+
stringRecord(settingsCSV, "pointPerfectDeviceProfileToken", settings.pointPerfectDeviceProfileToken);
431+
stringRecord(settingsCSV, "enablePointPerfectCorrections", settings.enablePointPerfectCorrections);
432+
stringRecord(settingsCSV, "home_wifiSSID", settings.home_wifiSSID);
433+
stringRecord(settingsCSV, "home_wifiPW", settings.home_wifiPW);
434+
stringRecord(settingsCSV, "autoKeyRenewal", settings.autoKeyRenewal);
435+
436+
//External PPS/Triggers
415437
stringRecord(settingsCSV, "enableExternalPulse", settings.enableExternalPulse);
416438
stringRecord(settingsCSV, "externalPulseTimeBetweenPulse_us", settings.externalPulseTimeBetweenPulse_us);
417439
stringRecord(settingsCSV, "externalPulseLength_us", settings.externalPulseLength_us);
418440
stringRecord(settingsCSV, "externalPulsePolarity", settings.externalPulsePolarity);
419441
stringRecord(settingsCSV, "enableExternalHardwareEventLogging", settings.enableExternalHardwareEventLogging);
420-
stringRecord(settingsCSV, "profileName", settings.profileName);
421-
stringRecord(settingsCSV, "serialTimeoutGNSS", settings.serialTimeoutGNSS);
422-
stringRecord(settingsCSV, "pointPerfectDeviceProfileToken", settings.pointPerfectDeviceProfileToken);
423-
stringRecord(settingsCSV, "enableLBandCorrections", settings.enableLBandCorrections);
424-
stringRecord(settingsCSV, "enableIPCorrections", settings.enableIPCorrections);
425-
stringRecord(settingsCSV, "home_wifiSSID", settings.home_wifiSSID);
426-
stringRecord(settingsCSV, "home_wifiPW", settings.home_wifiPW);
427-
stringRecord(settingsCSV, "autoKeyRenewal", settings.autoKeyRenewal);
442+
443+
//Profiles
444+
char apProfileName[50];
445+
sprintf(apProfileName, "Profile Name: %s", settings.profileName);
446+
stringRecord(settingsCSV, "profileName", apProfileName);
447+
448+
//New settings not yet integrated
449+
//...
428450

429451
strcat(settingsCSV, "\0");
452+
if(strlen(settingsCSV) > sizeof(settingsCSV))
453+
Serial.println("Error: settingCSV too small");
454+
430455
Serial.printf("settingsCSV len: %d\n\r", strlen(settingsCSV));
431456
Serial.printf("settingsCSV: %s\n\r", settingsCSV);
432457
#endif
@@ -545,10 +570,8 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
545570
settings.serialTimeoutGNSS = settingValue;
546571
else if (strcmp(settingName, "pointPerfectDeviceProfileToken") == 0)
547572
strcpy(settings.pointPerfectDeviceProfileToken, settingValueStr);
548-
else if (strcmp(settingName, "enableLBandCorrections") == 0)
549-
settings.enableLBandCorrections = settingValue;
550-
else if (strcmp(settingName, "enableIPCorrections") == 0)
551-
settings.enableIPCorrections = settingValue;
573+
else if (strcmp(settingName, "enablePointPerfectCorrections") == 0)
574+
settings.enablePointPerfectCorrections = settingValue;
552575
else if (strcmp(settingName, "home_wifiSSID") == 0)
553576
strcpy(settings.home_wifiSSID, settingValueStr);
554577
else if (strcmp(settingName, "home_wifiPW") == 0)
@@ -680,6 +703,14 @@ void stringRecord(char* settingsCSV, const char *id, char* settingValue)
680703
strcat(settingsCSV, record);
681704
}
682705

706+
//Add record with uint64_t
707+
void stringRecord(char* settingsCSV, const char *id, uint64_t settingValue)
708+
{
709+
char record[100];
710+
sprintf(record, "%s,%ld,", id, settingValue);
711+
strcat(settingsCSV, record);
712+
}
713+
683714
//Break CSV into setting constituents
684715
//Can't use strtok because we may have two commas next to each other, ie measurementRateHz,4.00,measurementRateSec,,dynamicModel,0,
685716
bool parseIncomingSettings()

Firmware/RTK_Surveyor/NVM.ino

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ void recordSystemSettingsToFile(File * settingsFile)
187187
settingsFile->printf("%s=%d\n\r", F("ntripClient_TransmitGGA"), settings.ntripClient_TransmitGGA);
188188
settingsFile->printf("%s=%d\n\r", F("serialTimeoutGNSS"), settings.serialTimeoutGNSS);
189189
settingsFile->printf("%s=%s\n\r", F("pointPerfectDeviceProfileToken"), settings.pointPerfectDeviceProfileToken);
190-
settingsFile->printf("%s=%d\n\r", F("enableLBandCorrections"), settings.enableLBandCorrections);
191-
settingsFile->printf("%s=%d\n\r", F("enableIPCorrections"), settings.enableIPCorrections);
190+
settingsFile->printf("%s=%d\n\r", F("enablePointPerfectCorrections"), settings.enablePointPerfectCorrections);
192191
settingsFile->printf("%s=%s\n\r", F("home_wifiSSID"), settings.home_wifiSSID);
193192
settingsFile->printf("%s=%s\n\r", F("home_wifiPW"), settings.home_wifiPW);
194193
settingsFile->printf("%s=%d\n\r", F("autoKeyRenewal"), settings.autoKeyRenewal);
@@ -696,10 +695,8 @@ bool parseLine(char* str, Settings *settings)
696695
settings->serialTimeoutGNSS = d;
697696
else if (strcmp(settingName, "pointPerfectDeviceProfileToken") == 0)
698697
strcpy(settings->pointPerfectDeviceProfileToken, settingValue);
699-
else if (strcmp(settingName, "enableLBandCorrections") == 0)
700-
settings->enableLBandCorrections = d;
701-
else if (strcmp(settingName, "enableIPCorrections") == 0)
702-
settings->enableIPCorrections = d;
698+
else if (strcmp(settingName, "enablePointPerfectCorrections") == 0)
699+
settings->enablePointPerfectCorrections = d;
703700
else if (strcmp(settingName, "home_wifiSSID") == 0)
704701
strcpy(settings->home_wifiSSID, settingValue);
705702
else if (strcmp(settingName, "home_wifiPW") == 0)

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,18 @@
3636
(Done) Ports - Configure Radio and Data port baud rates
3737
(Done) Test menu
3838
(Done) Firmware upgrade menu
39-
Enable various debug outputs sent over BT
4039
4140
TODO:
42-
Add ntripServer_MountPoint and PWDownload to AP config
43-
Add ntripClient_TransmitGGA to AP config
44-
Add ntripServer_CasterUser/PW to AP config
45-
Add maxLogLength_minutes to AP config
46-
Add L-Band to AP config
4741
4842
*/
4943

5044
const int FIRMWARE_VERSION_MAJOR = 2;
51-
const int FIRMWARE_VERSION_MINOR = 0;
45+
const int FIRMWARE_VERSION_MINOR = 1;
5246

5347
#define COMPILE_WIFI //Comment out to remove WiFi functionality
54-
#define COMPILE_BT //Comment out to remove Bluetooth functionality
48+
//#define COMPILE_BT //Comment out to remove Bluetooth functionality
5549
#define COMPILE_AP //Comment out to remove Access Point functionality
56-
//#define ENABLE_DEVELOPER //Uncomment this line to enable special developer modes (don't check power button at startup)
50+
#define ENABLE_DEVELOPER //Uncomment this line to enable special developer modes (don't check power button at startup)
5751

5852
//Define the RTK board identifier:
5953
// This is an int which is unique to this variant of the RTK Surveyor hardware which allows us
@@ -356,7 +350,7 @@ int incomingSettingsSpot = 0;
356350
unsigned long timeSinceLastIncomingSetting = 0;
357351
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
358352

359-
//L-Band Corrections
353+
//PointPerfect Corrections
360354
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
361355
SFE_UBLOX_GNSS i2cLBand; // NEO-D9S
362356

@@ -471,7 +465,7 @@ bool mqttMessageReceived = false; //Goes true when the subscribed MQTT channel r
471465
uint8_t leapSeconds = 0; //Gets set if GNSS is online
472466
unsigned long systemTestDisplayTime = 0; //Timestamp for swapping the graphic during testing
473467
uint8_t systemTestDisplayNumber = 0; //Tracks which test screen we're looking at
474-
unsigned long rtcWaitTime = 0; //At poweron, we give the RTC a few seconds to update during L-Band Key checking
468+
unsigned long rtcWaitTime = 0; //At poweron, we give the RTC a few seconds to update during PointPerfect Key checking
475469

476470
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
477471

@@ -510,7 +504,7 @@ void setup()
510504

511505
beginSystemState(); //Determine initial system state. Start task for button monitoring.
512506

513-
updateRTC(); //The GNSS likely has time/date. Update ESP32 RTC to match. Needed for L-Band key expiration.
507+
updateRTC(); //The GNSS likely has time/date. Update ESP32 RTC to match. Needed for PointPerfect key expiration.
514508

515509
Serial.flush(); //Complete any previous prints
516510

@@ -543,7 +537,7 @@ void loop()
543537

544538
updateNTRIPClient(); //Move any available incoming NTRIP to ZED
545539

546-
updateLBand(); //Check if we've recently received L-Band corrections or not
540+
updateLBand(); //Check if we've recently received PointPerfect corrections or not
547541

548542
//Convert current system time to minutes. This is used in F9PSerialReadTask()/updateLogs() to see if we are within max log window.
549543
systemTime_minutes = millis() / 1000L / 60;

Firmware/RTK_Surveyor/States.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,8 +1116,8 @@ void updateSystemState()
11161116
//We want an immediate change from this state
11171117
forceSystemStateUpdate = true; //Imediately go to this new state
11181118

1119-
//If user has turned off L-Band, skip everything
1120-
if (settings.enableLBandCorrections == false)
1119+
//If user has turned off PointPerfect, skip everything
1120+
if (settings.enablePointPerfectCorrections == false)
11211121
{
11221122
changeState(settings.lastState); //Go to either rover or base
11231123
}
@@ -1220,7 +1220,7 @@ void updateSystemState()
12201220

12211221
case (STATE_KEYS_WIFI_CONNECTED):
12221222
{
1223-
if (updatePointPerfectKeys() == true) //Connect to ThingStream MQTT and get L-Band key UBX packet
1223+
if (updatePointPerfectKeys() == true) //Connect to ThingStream MQTT and get PointPerfect key UBX packet
12241224
{
12251225
displayKeysUpdated();
12261226
}
@@ -1239,7 +1239,7 @@ void updateSystemState()
12391239
if (settings.pointPerfectNextKeyStart > 0)
12401240
{
12411241
uint8_t daysRemaining = daysFromEpoch(settings.pointPerfectNextKeyStart + settings.pointPerfectNextKeyDuration + 1);
1242-
Serial.printf("Days until L-Band keys expire: %d\n\r", daysRemaining);
1242+
Serial.printf("Days until PointPerfect keys expire: %d\n\r", daysRemaining);
12431243
paintKeyDaysRemaining(daysRemaining, 2000);
12441244
}
12451245
}

0 commit comments

Comments
 (0)