Skip to content

Add support for multiple NTRIP Servers #777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 69 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
af3082c
Add git commands to update the git repositories in the library
LeeLeahy2 Dec 21, 2023
eb61f35
Update compile-rtk-firmware.yml
nseidle Dec 27, 2023
eb363ab
Add core load test sketch
nseidle Dec 29, 2023
fd67bf3
Remove taskYield from idle task
nseidle Dec 29, 2023
b35e006
Rename variable to settingString
nseidle Dec 30, 2023
c94e138
Rename settingString
nseidle Dec 30, 2023
5e3e22f
Remove overwrite of settingString
nseidle Dec 30, 2023
444f0f7
Typo
nseidle Dec 30, 2023
b0c12fe
Update form.h via Python
github-actions[bot] Dec 30, 2023
44b78b5
Merge pull request #740 from LeeLeahy2/library
nseidle Jan 2, 2024
4d83441
Add NETWORK_STOP macro to print location of call to networkStop
LeeLeahy2 Jan 10, 2024
03bc00e
Network: Fix issue 749, networkUserClose failed to get network
LeeLeahy2 Jan 19, 2024
4f47fc5
Merge pull request #751 from LeeLeahy2/network-stop
nseidle Jan 19, 2024
31d301f
Merge pull request #752 from LeeLeahy2/fix-749
nseidle Jan 19, 2024
967c59d
Update form.h via Python
github-actions[bot] Jan 19, 2024
e20b3cc
makefile: Support the copy of the partition file
LeeLeahy2 Jan 20, 2024
11ccad3
Merge pull request #753 from LeeLeahy2/copy-partition
nseidle Jan 23, 2024
8bc7e1d
Merge branch 'main' into release_candidate
nseidle Mar 21, 2024
8128cdc
Increase the RTCM transmit timeout from 3 seconds to 15 seconds
LeeLeahy2 Apr 30, 2024
4ce4676
Merge pull request #765 from LeeLeahy2/rtcm-timeout
nseidle Apr 30, 2024
3f6f545
Add item 34 to debug menu to display the partition table
LeeLeahy2 Apr 30, 2024
b70f481
Properly separate WiFi state values from WiFi mode values
LeeLeahy2 Apr 24, 2024
092daf8
Add NTRIP_SERVER_DATA structure
LeeLeahy2 Apr 25, 2024
2f3060d
Switch to using ntripServerArray
LeeLeahy2 Apr 25, 2024
cb578a7
Move NTRIP server data into the data structure
LeeLeahy2 Apr 26, 2024
cc50096
Add the NTRIP Server number to the error messages
LeeLeahy2 Apr 26, 2024
033cf37
Add unique values for each of the NTRIP server settings
LeeLeahy2 Apr 26, 2024
0287433
Increase NTRIP_SERVER_MAX from 1 to 2
LeeLeahy2 Apr 30, 2024
eebc1e2
Merge pull request #764 from LeeLeahy2/display-partitions
nseidle Apr 30, 2024
e869349
Elevate Bluetooth SPP buffer full error.
nseidle May 10, 2024
0e09e34
Move logo display after power on check
nseidle May 10, 2024
34e047d
Prevent SPI scanning if SD card fails to mount
nseidle May 10, 2024
7edb87f
Resolve #769. Add settings.geographicRegion. Delete settings.LBandFreq
PaulZC Jun 5, 2024
f5a3259
Better key distribution topic extraction
PaulZC Jun 5, 2024
7aa3b4e
Change coordinateIdentifyInputType userEntryOriginal parameter to con…
PaulZC Jun 5, 2024
1675bb4
Fix for #771
PaulZC Jun 5, 2024
a4d2264
Update Form.ino
PaulZC Jun 5, 2024
5ead5d9
Add missing coordinate type print (main.js)
PaulZC Jun 6, 2024
91567db
Correct negative DDMMSS.sss in main.js
PaulZC Jun 6, 2024
03f426e
Add printRTKState
PaulZC Jun 6, 2024
da4809b
Correct system state print
PaulZC Jun 6, 2024
d1e3bd2
Check coordinate types are the same in menuBase
PaulZC Jun 6, 2024
3cf5141
Fix bug in coordinateIdentifyInputType for DD-MM-SS.ssss
PaulZC Jun 6, 2024
0d8c2b0
Update form.h
PaulZC Jun 6, 2024
0ea041b
Comment coordinate type console logs in main.js
PaulZC Jun 6, 2024
1623da9
Merge branch 'Multiple_NTRIP' into ntrip-server
PaulZC Jun 6, 2024
669108c
Merge pull request #766 from LeeLeahy2/ntrip-server
PaulZC Jun 6, 2024
91dd639
ntripServer settings - add missing underscores etc.
PaulZC Jun 6, 2024
48cbc3b
Fix ntripServer menu
PaulZC Jun 6, 2024
831be66
Better debug in ntripServerProcessRTCM - equal printing of servers 0 …
PaulZC Jun 6, 2024
e078576
Correct pointers for ntripServer_CasterHost in createSettingsString
PaulZC Jun 6, 2024
93ce386
Merge pull request #773 from sparkfun/Multiple_NTRIP
PaulZC Jun 6, 2024
e742118
Increase name array size for NTRIP CasterHost etc.
PaulZC Jun 6, 2024
e763587
Better NTRIP debugging
PaulZC Jun 7, 2024
cbdf890
Update NtripServer.ino
PaulZC Jun 7, 2024
af73bf3
Replace ntripServer/ClientRestart with ntripServer/ClientStop when ne…
PaulZC Jun 7, 2024
e26e9ed
Update form.h via Python
github-actions[bot] Jun 10, 2024
4bf4bbc
Update form.h via Python
github-actions[bot] Jun 10, 2024
de3af28
Prevent NtripServer from disabling settings.enableNtripServer
PaulZC Jun 10, 2024
8d1e600
Retry startFixedBase up to 3 times
PaulZC Jun 10, 2024
ac70ffc
Cosmetic: correct ntripServerStop in Developer.ino
PaulZC Jun 10, 2024
35098d1
Update form.h
PaulZC Jun 10, 2024
2449300
Correct web config NTRIP Server validation
PaulZC Jun 14, 2024
2346fa0
Update form.h via Python
github-actions[bot] Jun 14, 2024
518e4b7
Allow HPG v1.50 firmware
nseidle Jul 19, 2024
390824f
Update form.h via Python
github-actions[bot] Jul 22, 2024
8a5b634
Add ZED firmware test to system test display
nseidle Jul 22, 2024
5f901d2
Check ZED-F9R firmware in display test
nseidle Jul 22, 2024
40607b9
Update form.h via Python
github-actions[bot] Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/compile-rtk-firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
env:
FILENAME_PREFIX: RTK_Surveyor_Firmware
FIRMWARE_VERSION_MAJOR: 4
FIRMWARE_VERSION_MINOR: 0
FIRMWARE_VERSION_MINOR: 1
POINTPERFECT_TOKEN: ${{ secrets.POINTPERFECT_TOKEN }}

jobs:
Expand Down
252 changes: 158 additions & 94 deletions Firmware/RTK_Surveyor/AP-Config/index.html

Large diffs are not rendered by default.

236 changes: 141 additions & 95 deletions Firmware/RTK_Surveyor/AP-Config/src/main.js

Large diffs are not rendered by default.

158 changes: 88 additions & 70 deletions Firmware/RTK_Surveyor/Base.ino
Original file line number Diff line number Diff line change
Expand Up @@ -239,76 +239,92 @@ bool surveyInReset()
bool startFixedBase()
{
bool response = true;
int retries = 0;
uint16_t maxWait = 1100;

if (settings.fixedBaseCoordinateType == COORD_TYPE_ECEF)
{
// Break ECEF into main and high precision parts
// The type casting should not effect rounding of original double cast coordinate
long majorEcefX = floor((settings.fixedEcefX * 100.0) + 0.5);
long minorEcefX = floor((((settings.fixedEcefX * 100.0) - majorEcefX) * 100.0) + 0.5);
long majorEcefY = floor((settings.fixedEcefY * 100) + 0.5);
long minorEcefY = floor((((settings.fixedEcefY * 100.0) - majorEcefY) * 100.0) + 0.5);
long majorEcefZ = floor((settings.fixedEcefZ * 100) + 0.5);
long minorEcefZ = floor((((settings.fixedEcefZ * 100.0) - majorEcefZ) * 100.0) + 0.5);

// systemPrintf("fixedEcefY (should be -4716808.5807): %0.04f\r\n", settings.fixedEcefY);
// systemPrintf("major (should be -471680858): %ld\r\n", majorEcefY);
// systemPrintf("minor (should be -7): %ld\r\n", minorEcefY);

// Units are cm with a high precision extension so -1234.5678 should be called: (-123456, -78)
//-1280208.308,-4716803.847,4086665.811 is SparkFun HQ so...

response &= theGNSS.newCfgValset();
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_MODE, 2); // Fixed
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_POS_TYPE, 0); // Position in ECEF
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_X, majorEcefX);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_X_HP, minorEcefX);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_Y, majorEcefY);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_Y_HP, minorEcefY);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_Z, majorEcefZ);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_Z_HP, minorEcefZ);
response &= theGNSS.sendCfgValset();
}
else if (settings.fixedBaseCoordinateType == COORD_TYPE_GEODETIC)
{
// Add height of instrument (HI) to fixed altitude
// https://www.e-education.psu.edu/geog862/node/1853
// For example, if HAE is at 100.0m, + 2m stick + 73mm ARP = 102.073
float totalFixedAltitude =
settings.fixedAltitude + (settings.antennaHeight / 1000.0) + (settings.antennaReferencePoint / 1000.0);

// Break coordinates into main and high precision parts
// The type casting should not effect rounding of original double cast coordinate
int64_t majorLat = settings.fixedLat * 10000000;
int64_t minorLat = ((settings.fixedLat * 10000000) - majorLat) * 100;
int64_t majorLong = settings.fixedLong * 10000000;
int64_t minorLong = ((settings.fixedLong * 10000000) - majorLong) * 100;
int32_t majorAlt = totalFixedAltitude * 100;
int32_t minorAlt = ((totalFixedAltitude * 100) - majorAlt) * 100;

// systemPrintf("fixedLong (should be -105.184774720): %0.09f\r\n", settings.fixedLong);
// systemPrintf("major (should be -1051847747): %lld\r\n", majorLat);
// systemPrintf("minor (should be -20): %lld\r\n", minorLat);
//
// systemPrintf("fixedLat (should be 40.090335429): %0.09f\r\n", settings.fixedLat);
// systemPrintf("major (should be 400903354): %lld\r\n", majorLong);
// systemPrintf("minor (should be 29): %lld\r\n", minorLong);
//
// systemPrintf("fixedAlt (should be 1560.2284): %0.04f\r\n", settings.fixedAltitude);
// systemPrintf("major (should be 156022): %ld\r\n", majorAlt);
// systemPrintf("minor (should be 84): %ld\r\n", minorAlt);
do {
if (settings.fixedBaseCoordinateType == COORD_TYPE_ECEF)
{
// Break ECEF into main and high precision parts
// The type casting should not effect rounding of original double cast coordinate
long majorEcefX = floor((settings.fixedEcefX * 100.0) + 0.5);
long minorEcefX = floor((((settings.fixedEcefX * 100.0) - majorEcefX) * 100.0) + 0.5);
long majorEcefY = floor((settings.fixedEcefY * 100) + 0.5);
long minorEcefY = floor((((settings.fixedEcefY * 100.0) - majorEcefY) * 100.0) + 0.5);
long majorEcefZ = floor((settings.fixedEcefZ * 100) + 0.5);
long minorEcefZ = floor((((settings.fixedEcefZ * 100.0) - majorEcefZ) * 100.0) + 0.5);

// systemPrintf("fixedEcefY (should be -4716808.5807): %0.04f\r\n", settings.fixedEcefY);
// systemPrintf("major (should be -471680858): %ld\r\n", majorEcefY);
// systemPrintf("minor (should be -7): %ld\r\n", minorEcefY);

// Units are cm with a high precision extension so -1234.5678 should be called: (-123456, -78)
//-1280208.308,-4716803.847,4086665.811 is SparkFun HQ so...

response &= theGNSS.newCfgValset();
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_MODE, 2); // Fixed
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_POS_TYPE, 0); // Position in ECEF
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_X, majorEcefX);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_X_HP, minorEcefX);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_Y, majorEcefY);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_Y_HP, minorEcefY);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_Z, majorEcefZ);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_ECEF_Z_HP, minorEcefZ);
response &= theGNSS.sendCfgValset();
}
else if (settings.fixedBaseCoordinateType == COORD_TYPE_GEODETIC)
{
// Add height of instrument (HI) to fixed altitude
// https://www.e-education.psu.edu/geog862/node/1853
// For example, if HAE is at 100.0m, + 2m stick + 73mm ARP = 102.073
float totalFixedAltitude =
settings.fixedAltitude + (settings.antennaHeight / 1000.0) + (settings.antennaReferencePoint / 1000.0);

// Break coordinates into main and high precision parts
// The type casting should not effect rounding of original double cast coordinate
int64_t majorLat = settings.fixedLat * 10000000;
int64_t minorLat = ((settings.fixedLat * 10000000) - majorLat) * 100;
int64_t majorLong = settings.fixedLong * 10000000;
int64_t minorLong = ((settings.fixedLong * 10000000) - majorLong) * 100;
int32_t majorAlt = totalFixedAltitude * 100;
int32_t minorAlt = ((totalFixedAltitude * 100) - majorAlt) * 100;

// systemPrintf("fixedLong (should be -105.184774720): %0.09f\r\n", settings.fixedLong);
// systemPrintf("major (should be -1051847747): %lld\r\n", majorLat);
// systemPrintf("minor (should be -20): %lld\r\n", minorLat);
//
// systemPrintf("fixedLat (should be 40.090335429): %0.09f\r\n", settings.fixedLat);
// systemPrintf("major (should be 400903354): %lld\r\n", majorLong);
// systemPrintf("minor (should be 29): %lld\r\n", minorLong);
//
// systemPrintf("fixedAlt (should be 1560.2284): %0.04f\r\n", settings.fixedAltitude);
// systemPrintf("major (should be 156022): %ld\r\n", majorAlt);
// systemPrintf("minor (should be 84): %ld\r\n", minorAlt);

response &= theGNSS.newCfgValset();
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_MODE, 2); // Fixed
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_POS_TYPE, 1); // Position in LLH
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_LAT, majorLat);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_LAT_HP, minorLat);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_LON, majorLong);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_LON_HP, minorLong);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_HEIGHT, majorAlt);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_HEIGHT_HP, minorAlt);
response &= theGNSS.sendCfgValset(maxWait);
}

response &= theGNSS.newCfgValset();
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_MODE, 2); // Fixed
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_POS_TYPE, 1); // Position in LLH
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_LAT, majorLat);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_LAT_HP, minorLat);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_LON, majorLong);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_LON_HP, minorLong);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_HEIGHT, majorAlt);
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_HEIGHT_HP, minorAlt);
response &= theGNSS.sendCfgValset();
}
if (!response) {
systemPrint("startFixedBase failed! ");
if (retries <= 2) {
systemPrintln("Retrying...");
delay(1000);
maxWait = 2200;
}
else {
systemPrintln("Giving up and going into Rover mode!");
}
}
} while ((!response) && (++retries <= 3));

return (response);
}
Expand Down Expand Up @@ -349,7 +365,8 @@ void DevUBLOXGNSS::processRTCM(uint8_t incoming)
rtcmLastReceived = millis();
rtcmBytesSent++;

ntripServerProcessRTCM(incoming);
for (int serverIndex = 0; serverIndex < NTRIP_SERVER_MAX; serverIndex++)
ntripServerProcessRTCM(serverIndex, incoming);

espnowProcessRTCM(incoming);
}
Expand Down Expand Up @@ -391,7 +408,8 @@ void processRTCMBuffer()
rtcmLastReceived = millis();
rtcmBytesSent++;

ntripServerProcessRTCM(incoming);
for (int serverIndex = 0; serverIndex < NTRIP_SERVER_MAX; serverIndex++)
ntripServerProcessRTCM(serverIndex, incoming);

espnowProcessRTCM(incoming);
}
Expand Down
12 changes: 10 additions & 2 deletions Firmware/RTK_Surveyor/Begin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ void beginBoard()
settings.enablePrintBatteryMessages = false; // No pesky battery messages
}

displaySfeFlame();

char versionString[21];
getFirmwareVersion(versionString, sizeof(versionString), true);
systemPrintf("SparkFun RTK %s %s\r\n", platformPrefix, versionString);
Expand Down Expand Up @@ -361,6 +363,9 @@ void beginBoard()

void beginSD()
{
if(sdCardForcedOffline == true)
return;

bool gotSemaphore;

online.microSD = false;
Expand Down Expand Up @@ -445,6 +450,8 @@ void beginSD()
systemPrintln("SD init failed - using SPI and SdFat. Is card formatted?");
digitalWrite(pin_microSD_CS, HIGH); // Be sure SD is deselected

sdCardForcedOffline = true; //Prevent future scans for SD cards

// Check reset count and prevent rolling reboot
if (settings.resetCount < 5)
{
Expand Down Expand Up @@ -807,13 +814,14 @@ void beginGNSS()
// Construct the firmware version as uint8_t. Note: will fail above 2.55!
zedFirmwareVersionInt = (theGNSS.getFirmwareVersionHigh() * 100) + theGNSS.getFirmwareVersionLow();

// Check this is known firmware
// Check if this is known firmware
//"1.20" - Mostly for F9R HPS 1.20, but also F9P HPG v1.20
//"1.21" - F9R HPS v1.21
//"1.30" - ZED-F9P (HPG) released Dec, 2021. Also ZED-F9R (HPS) released Sept, 2022
//"1.32" - ZED-F9P released May, 2022
//"1.50" - ZED-F9P released July, 2024

const uint8_t knownFirmwareVersions[] = {100, 112, 113, 120, 121, 130, 132};
const uint8_t knownFirmwareVersions[] = {100, 112, 113, 120, 121, 130, 132, 150};
bool knownFirmware = false;
for (uint8_t i = 0; i < (sizeof(knownFirmwareVersions) / sizeof(uint8_t)); i++)
{
Expand Down
8 changes: 4 additions & 4 deletions Firmware/RTK_Surveyor/Developer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ void ntripClientValidateTables() {}
// NTRIP server
//----------------------------------------

bool ntripServerIsCasting() {return false;}
void ntripServerPrintStatus() {systemPrint("NTRIP Server not compiled");}
void ntripServerProcessRTCM(uint8_t incoming) {}
void ntripServerStop(bool clientAllocated) {online.ntripServer = false;}
bool ntripServerIsCasting(int serverIndex) {return false;}
void ntripServerPrintStatus(int serverIndex) {systemPrintf("**NTRIP Server %d not compiled**\r\n", serverIndex);}
void ntripServerProcessRTCM(int serverIndex, uint8_t incoming) {}
void ntripServerStop(int serverIndex, bool clientAllocated) {online.ntripServer[serverIndex] = false;}
void ntripServerUpdate() {}
void ntripServerValidateTables() {}

Expand Down
Loading