Skip to content

Commit 0db1b14

Browse files
committed
Start ZTP at boot if NTRIP Enabled but no credentials
1 parent 3d99fbe commit 0db1b14

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

Firmware/RTK_Everywhere/menuPP.ino

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ typedef struct
6666

6767
// The various services offered by PointPerfect
6868
const PP_Service ppServices[] = {
69-
{"Disabled", PP_MODEL_NONE, PP_DELIVERY_NONE, PP_ENCODING_NONE}, // Do not use PointPerfect corrections
70-
{"Flex NTRIP/RTCM", PP_MODEL_SSR, PP_DELIVERY_NTRIP, PP_ENCODING_RTCM}, // Uses "ZTP-RTCM-100" profile
69+
{"Disabled", PP_MODEL_NONE, PP_DELIVERY_NONE, PP_ENCODING_NONE}, // Do not use PointPerfect corrections
70+
{"Flex NTRIP/RTCM", PP_MODEL_SSR, PP_DELIVERY_NTRIP, PP_ENCODING_RTCM}, // Uses "ZTP-RTCM-100" profile
7171
{"Flex L-Band North America", PP_MODEL_SSR, PP_DELIVERY_LBAND_NA, PP_ENCODING_SPARTN}, // Uses "ZTP-LBand" profile
72-
{"Global", PP_MODEL_SSR, PP_DELIVERY_LBAND_GLOBAL, PP_ENCODING_SPARTN}, // Uses "ZTP-Global" profile
73-
{"Live", PP_MODEL_OSR, PP_DELIVERY_NTRIP, PP_ENCODING_RTCM}, // Uses "ZTP-Live" profile
74-
{"Flex MQTT (Deprecated)", PP_MODEL_SSR, PP_DELIVERY_MQTT, PP_ENCODING_SPARTN}, // Uses "ZTP-IP" profile, now deprecated
72+
{"Global", PP_MODEL_SSR, PP_DELIVERY_LBAND_GLOBAL, PP_ENCODING_SPARTN}, // Uses "ZTP-Global" profile
73+
{"Live", PP_MODEL_OSR, PP_DELIVERY_NTRIP, PP_ENCODING_RTCM}, // Uses "ZTP-Live" profile
74+
{"Flex MQTT (Deprecated)", PP_MODEL_SSR, PP_DELIVERY_MQTT,
75+
PP_ENCODING_SPARTN}, // Uses "ZTP-IP" profile, now deprecated
7576
// "ZTP-RTCM-100-Trial" profile deprecated
7677
// "ZTP-LBand+IP" profile deprecated
7778
};
@@ -317,8 +318,6 @@ const char *printDeviceId()
317318
// Present user with list of available services, list depends on platform
318319
void menuPointPerfectSelectService()
319320
{
320-
clearBuffer(); // Empty buffer of any newline chars
321-
322321
while (1)
323322
{
324323
systemPrintln();
@@ -1379,14 +1378,24 @@ bool provisioningKeysNeeded()
13791378
keysNeeded = true;
13801379

13811380
// If requestKeyUpdate is true, begin provisioning
1382-
// Must come first to allow NTRIP/RTCM type services to start provisioning
1381+
// Must come before pointPerfectServiceUsesKeys() check
13831382
if (settings.requestKeyUpdate)
13841383
{
13851384
if (settings.debugPpCertificate)
13861385
systemPrintln("requestKeyUpdate is true.");
13871386
break;
13881387
}
13891388

1389+
// If NTRIP service, but no credentials, then start provisioning
1390+
// Must come before pointPerfectServiceUsesKeys() check
1391+
if (pointPerfectNtripNeeded() &&
1392+
strlen(settings.ntripClient_CasterHost) == 0) // NTRIP service, but no credentials
1393+
{
1394+
if (settings.debugPpCertificate)
1395+
systemPrintln("NTRIP credentials empty, starting ZTP.");
1396+
break;
1397+
}
1398+
13901399
if (pointPerfectServiceUsesKeys() == false)
13911400
{
13921401
keysNeeded = false;
@@ -1421,8 +1430,6 @@ bool provisioningKeysNeeded()
14211430
// If there are 28 days remaining, PointPerfect won't have new keys.
14221431
if (daysRemaining < 28)
14231432
{
1424-
// When did we last try to get keys? Attempt every 24 hours - or always for DEVELOPER
1425-
// if (rtc.getEpoch() - settings.lastKeyAttempt > ( ENABLE_DEVELOPER ? 0 : SECONDS_IN_A_DAY))
14261433
// When did we last try to get keys? Attempt every 24 hours
14271434
if (rtc.getEpoch() - settings.lastKeyAttempt > SECONDS_IN_A_DAY)
14281435
{

0 commit comments

Comments
 (0)