Skip to content

Commit 0a0fa77

Browse files
committed
Increase debug print of network consumers
1 parent 855605c commit 0a0fa77

File tree

2 files changed

+53
-7
lines changed

2 files changed

+53
-7
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,49 +1414,94 @@ uint8_t networkConsumers()
14141414
{
14151415
uint8_t consumerCount = 0;
14161416

1417+
uint16_t consumerType = 0;
1418+
14171419
// Rover + NTRIP Client
14181420
if (inRoverMode() == true && settings.enableNtripClient == true)
1421+
{
14191422
consumerCount++;
1423+
consumerType |= (1 << 0);
1424+
}
14201425

14211426
// Base + NTRIP Server
14221427
if (inBaseMode() == true && settings.enableNtripServer == true)
1428+
{
14231429
consumerCount++;
1430+
consumerType |= (1 << 1);
1431+
}
14241432

14251433
// TCP Client
14261434
if (settings.enableTcpClient == true)
1435+
{
14271436
consumerCount++;
1437+
consumerType |= (1 << 2);
1438+
}
14281439

14291440
// TCP Server
14301441
if (settings.enableTcpServer == true)
1442+
{
14311443
consumerCount++;
1444+
consumerType |= (1 << 3);
1445+
}
14321446

14331447
// UDP Server
14341448
if (settings.enableUdpServer == true)
1449+
{
14351450
consumerCount++;
1451+
consumerType |= (1 << 4);
1452+
}
14361453

14371454
// PointPerfect ZTP or get keys
14381455
if (settings.requestKeyUpdate == true)
1456+
{
14391457
consumerCount++;
1458+
consumerType |= (1 << 5);
1459+
}
14401460

14411461
// PointPerfect Corrections enabled with a non-zero length key
14421462
if (settings.enablePointPerfectCorrections == true && strlen(settings.pointPerfectCurrentKey) > 0)
14431463
{
1444-
// Check if keys are expired
1445-
int daysRemaining = daysFromEpoch(settings.pointPerfectNextKeyStart + settings.pointPerfectNextKeyDuration + 1);
1446-
if (daysRemaining > 0)
1447-
consumerCount++;
1464+
if (online.rtc)
1465+
{
1466+
// Check if keys need updating
1467+
int daysRemaining =
1468+
daysFromEpoch(settings.pointPerfectNextKeyStart + settings.pointPerfectNextKeyDuration + 1);
1469+
if (daysRemaining < 28)
1470+
{
1471+
consumerCount++;
1472+
consumerType |= (1 << 6);
1473+
if (settings.debugNetworkLayer)
1474+
systemPrintf("Network consumer daysRemaining: %d\r\n", daysRemaining);
1475+
}
1476+
}
14481477
}
14491478

1450-
//OTA
1479+
// OTA
14511480

14521481
if (settings.debugNetworkLayer)
14531482
{
1454-
static unsigned long lastPrint = millis();
1483+
static unsigned long lastPrint = 0;
14551484

14561485
if (millis() - lastPrint > 2000)
14571486
{
14581487
lastPrint = millis();
1459-
systemPrintf("Network consumer count: %d\r\n", consumerCount);
1488+
systemPrintf("Network consumer count: %d - Consumers: ", consumerCount);
1489+
1490+
if (consumerType & (1 << 0))
1491+
systemPrint("Rover NTRIP Client, ");
1492+
if (consumerType & (1 << 1))
1493+
systemPrint("Base NTRIP Server, ");
1494+
if (consumerType & (1 << 2))
1495+
systemPrint("TCP Client, ");
1496+
if (consumerType & (1 << 3))
1497+
systemPrint("TCP Server, ");
1498+
if (consumerType & (1 << 4))
1499+
systemPrint("UDP Server, ");
1500+
if (consumerType & (1 << 5))
1501+
systemPrint("PPL Key request, ");
1502+
if (consumerType & (1 << 6))
1503+
systemPrint("PPL Key update, ");
1504+
systemPrintln();
14601505
}
14611506
}
14621507

Firmware/RTK_Everywhere/menuPP.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,7 @@ void updateProvisioning()
13551355
{
13561356
httpClientModeNeeded = false; // Tell HTTP_Client to give up
13571357
recordSystemSettings(); // Make sure the new cert and keys are recorded
1358+
systemPrintln("Keys successfully updated!");
13581359
provisioningSetState(PROVISIONING_KEYS_REMAINING);
13591360
}
13601361
else if (ztpResponse == ZTP_DEACTIVATED)

0 commit comments

Comments
 (0)