Skip to content

Commit 1dc7798

Browse files
authored
Merge pull request #92 from sparkfun/release_candidate_v1_12
Add NTRIP Client
2 parents 7b756a3 + 544b62e commit 1dc7798

File tree

21 files changed

+781
-305
lines changed

21 files changed

+781
-305
lines changed

Firmware/RTK_Surveyor/AP-Config/index.html

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -874,55 +874,57 @@ <h2>
874874
</div>
875875

876876
<div class="form-group row">
877-
<label for="wifiSSID" class="box-margin20 col-sm-3 col-4 col-form-label">WiFi
877+
<label for="ntripServer_wifiSSID" class="box-margin20 col-sm-3 col-4 col-form-label">WiFi
878878
SSID:</label>
879879
<div class="col-sm-8 col-7">
880-
<input type="text" class="form-control" id="wifiSSID">
881-
<p id="wifiSSIDError" class="inlineError"></p>
880+
<input type="text" class="form-control" id="ntripServer_wifiSSID">
881+
<p id="ntripServer_wifiSSIDError" class="inlineError"></p>
882882
</div>
883883
</div>
884884

885885
<div class="form-group row">
886-
<label for="wifiPW" class="box-margin20 col-sm-3 col-4 col-form-label">WiFi PW:</label>
886+
<label for="ntripServer_wifiPW" class="box-margin20 col-sm-3 col-4 col-form-label">WiFi
887+
PW:</label>
887888
<div class="col-sm-8 col-7">
888-
<input type="text" class="form-control" id="wifiPW">
889-
<p id="wifiPWError" class="inlineError"></p>
889+
<input type="text" class="form-control" id="ntripServer_wifiPW">
890+
<p id="ntripServer_wifiPWError" class="inlineError"></p>
890891
</div>
891892
</div>
892893

893894
<div class="form-group row">
894-
<label for="casterHost" class="box-margin20 col-sm-3 col-5 col-form-label">Caster
895+
<label for="ntripServer_CasterHost" class="box-margin20 col-sm-3 col-5 col-form-label">Caster
895896
Host:</label>
896897
<div class="col-sm-8 col-6">
897-
<input type="text" class="form-control" id="casterHost">
898-
<p id="casterHostError" class="inlineError"></p>
898+
<input type="text" class="form-control" id="ntripServer_CasterHost">
899+
<p id="ntripServer_CasterHostError" class="inlineError"></p>
899900
</div>
900901
</div>
901902

902903
<div class="form-group row">
903-
<label for="casterPort" class="box-margin20 col-sm-3 col-5 col-form-label">Caster
904+
<label for="ntripServer_CasterPort" class="box-margin20 col-sm-3 col-5 col-form-label">Caster
904905
Port:</label>
905906
<div class="col-sm-8 col-6">
906-
<input type="text" class="form-control" id="casterPort">
907-
<p id="casterPortError" class="inlineError"></p>
907+
<input type="text" class="form-control" id="ntripServer_CasterPort">
908+
<p id="ntripServer_CasterPortError" class="inlineError"></p>
908909
</div>
909910
</div>
910911

911912
<div class="form-group row">
912-
<label for="mountPointUpload" class="box-margin20 col-sm-3 col-5 col-form-label">Mount
913+
<label for="ntripServer_MountPoint" class="box-margin20 col-sm-3 col-5 col-form-label">Mount
913914
Point:</label>
914915
<div class="col-sm-8 col-6">
915-
<input type="text" class="form-control" id="mountPointUpload">
916-
<p id="mountPointUploadError" class="inlineError"></p>
916+
<input type="text" class="form-control" id="ntripServer_MountPoint">
917+
<p id="ntripServer_MountPointError" class="inlineError"></p>
917918
</div>
918919
</div>
919920

920921
<div class="form-group row">
921-
<label for="mountPointUploadPW" class="box-margin20 col-sm-4 col-6 col-form-label">Mount Point
922+
<label for="ntripServer_MountPointPW" class="box-margin20 col-sm-4 col-6 col-form-label">Mount
923+
Point
922924
PW:</label>
923925
<div class="col-sm-7 col-5">
924-
<input type="text" class="form-control" id="mountPointUploadPW">
925-
<p id="mountPointUploadPWError" class="inlineError"></p>
926+
<input type="text" class="form-control" id="ntripServer_MountPointPW">
927+
<p id="ntripServer_MountPointPWError" class="inlineError"></p>
926928
</div>
927929
</div>
928930
</div>

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ function validateFields() {
293293
checkElementValue("fixedLong", -180, 180, "Must be -180 to 180", "collapseBaseConfig");
294294
checkElementValue("fixedAltitude", 0, 8849, "Must be 0 to 8849", "collapseBaseConfig");
295295

296-
checkElementString("wifiSSID", 1, 30, "Must be 1 to 30 characters", "collapseBaseConfig");
297-
checkElementString("wifiPW", 0, 30, "Must be 0 to 30 characters", "collapseBaseConfig");
298-
checkElementString("casterHost", 1, 30, "Must be 1 to 30 characters", "collapseBaseConfig");
299-
checkElementValue("casterPort", 1, 99999, "Must be 1 to 99999", "collapseBaseConfig");
300-
checkElementString("mountPointUpload", 1, 30, "Must be 1 to 30 characters", "collapseBaseConfig");
301-
checkElementString("mountPointUploadPW", 1, 30, "Must be 1 to 30 characters", "collapseBaseConfig");
296+
checkElementString("ntripServer_wifiSSID", 1, 30, "Must be 1 to 30 characters", "collapseBaseConfig");
297+
checkElementString("ntripServer_wifiPW", 0, 30, "Must be 0 to 30 characters", "collapseBaseConfig");
298+
checkElementString("ntripServer_CasterHost", 1, 30, "Must be 1 to 30 characters", "collapseBaseConfig");
299+
checkElementValue("ntripServer_CasterPort", 1, 99999, "Must be 1 to 99999", "collapseBaseConfig");
300+
checkElementString("ntripServer_MountPoint", 1, 30, "Must be 1 to 30 characters", "collapseBaseConfig");
301+
checkElementString("ntripServer_MountPointPW", 1, 30, "Must be 1 to 30 characters", "collapseBaseConfig");
302302

303303
//System Config
304304
checkElementValue("maxLogTime_minutes", 1, 2880, "Must be 1 to 2880", "collapseSystemConfig");
@@ -610,21 +610,21 @@ document.addEventListener("DOMContentLoaded", (event) => {
610610
ge("enableNtripServer").addEventListener("change", function () {
611611
if (ge("enableNtripServer").checked) {
612612
//Enable NTRIP inputs
613-
ge("wifiSSID").disabled = false;
614-
ge("wifiPW").disabled = false;
615-
ge("casterHost").disabled = false;
616-
ge("casterPort").disabled = false;
617-
ge("mountPointUpload").disabled = false;
618-
ge("mountPointUploadPW").disabled = false;
613+
ge("ntripServer_wifiSSID").disabled = false;
614+
ge("ntripServer_wifiPW").disabled = false;
615+
ge("ntripServer_CasterHost").disabled = false;
616+
ge("ntripServer_CasterPort").disabled = false;
617+
ge("ntripServer_MountPoint").disabled = false;
618+
ge("ntripServer_MountPointPW").disabled = false;
619619
}
620620
else {
621621
//Disable NTRIP inputs
622-
ge("wifiSSID").disabled = true;
623-
ge("wifiPW").disabled = true;
624-
ge("casterHost").disabled = true;
625-
ge("casterPort").disabled = true;
626-
ge("mountPointUpload").disabled = true;
627-
ge("mountPointUploadPW").disabled = true;
622+
ge("ntripServer_wifiSSID").disabled = true;
623+
ge("ntripServer_wifiPW").disabled = true;
624+
ge("ntripServer_CasterHost").disabled = true;
625+
ge("ntripServer_CasterPort").disabled = true;
626+
ge("ntripServer_MountPoint").disabled = true;
627+
ge("ntripServer_MountPointPW").disabled = true;
628628
}
629629
});
630630

Firmware/RTK_Surveyor/Base.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ bool configureUbloxModuleBase()
2626

2727
i2cGNSS.checkUblox(); //Regularly poll to get latest data and any RTCM
2828

29+
i2cGNSS.setNMEAGPGGAcallbackPtr(NULL); // Disable GPGGA call back that may have been set during Rover Client mode
30+
i2cGNSS.disableNMEAMessage(UBX_NMEA_GGA, COM_PORT_I2C); // Disable NMEA message
31+
2932
if (i2cGNSS.getSurveyInActive() == true)
3033
{
3134
log_d("Disabling survey");
@@ -250,9 +253,9 @@ void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming)
250253
}
251254

252255
#ifdef COMPILE_WIFI
253-
if (caster.connected() == true)
256+
if (ntripServer.connected() == true)
254257
{
255-
caster.write(incoming); //Send this byte to socket
258+
ntripServer.write(incoming); //Send this byte to socket
256259
casterBytesSent++;
257260
lastServerSent_ms = millis();
258261
}

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,20 @@ void beginSD()
168168

169169
if (settings.enableSD == true)
170170
{
171-
//Max power up time is 250ms: https://www.kingston.com/datasheets/SDCIT-specsheet-64gb_en.pdf
172-
//Max current is 200mA average across 1s, peak 300mA
173-
delay(10);
174-
175171
//Do a quick test to see if a card is present
176-
if (sdPresent() == false)
172+
int tries = 0;
173+
int maxTries = 5;
174+
while (tries++ < maxTries)
177175
{
178-
log_d("SD card not detected");
179-
return;
176+
if (sdPresent() == true) break;
177+
log_d("SD present failed. Trying again %d out of %d", tries + 1, maxTries);
178+
179+
//Max power up time is 250ms: https://www.kingston.com/datasheets/SDCIT-specsheet-64gb_en.pdf
180+
//Max current is 200mA average across 1s, peak 300mA
181+
delay(10);
180182
}
183+
if (tries == maxTries) return;
184+
181185
//If an SD card is present, allow SdFat to take over
182186
log_d("SD card detected");
183187

@@ -189,8 +193,8 @@ void beginSD()
189193

190194
if (sd.begin(SdSpiConfig(pin_microSD_CS, SHARED_SPI, SD_SCK_MHZ(settings.spiFrequency))) == false)
191195
{
192-
int tries = 0;
193-
int maxTries = 1;
196+
tries = 0;
197+
maxTries = 1;
194198
for ( ; tries < maxTries ; tries++)
195199
{
196200
log_d("SD init failed. Trying again %d out of %d", tries + 1, maxTries);
@@ -315,6 +319,8 @@ void stopUART2Tasks()
315319

316320
void beginFS()
317321
{
322+
#define FORMAT_LITTLEFS_IF_FAILED true
323+
318324
if (online.fs == false)
319325
{
320326
Serial.println("Starting FS");

Firmware/RTK_Surveyor/Display.ino

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ void updateDisplay()
3030
case (STATE_ROVER_RTK_FIX):
3131
paintRoverRTKFix();
3232
break;
33+
34+
case (STATE_ROVER_CLIENT_WIFI_STARTED):
35+
paintRoverWiFiStarted();
36+
break;
37+
case (STATE_ROVER_CLIENT_WIFI_CONNECTED):
38+
paintRoverWiFiStarted();
39+
break;
40+
case (STATE_ROVER_CLIENT_STARTED):
41+
paintRoverWiFiStarted();
42+
break;
43+
3344
case (STATE_BASE_NOT_STARTED):
3445
//Do nothing. Static display shown during state change.
3546
break;
@@ -230,7 +241,7 @@ void paintWirelessIcon()
230241
wifiIconDisplayed = true;
231242

232243
//Draw the icon
233-
displayBitmap(6, 1, WiFi_Symbol_Width, WiFi_Symbol_Height, WiFi_Symbol);
244+
displayBitmap(0, 1, WiFi_Symbol_Width, WiFi_Symbol_Height, WiFi_Symbol);
234245
}
235246
else
236247
wifiIconDisplayed = false;
@@ -239,7 +250,14 @@ void paintWirelessIcon()
239250
else if (radioState == WIFI_CONNECTED)
240251
{
241252
//Solid WiFi icon
242-
displayBitmap(6, 1, WiFi_Symbol_Width, WiFi_Symbol_Height, WiFi_Symbol);
253+
displayBitmap(0, 1, WiFi_Symbol_Width, WiFi_Symbol_Height, WiFi_Symbol);
254+
255+
//If we are connected to NTRIP Client, show download arrow
256+
if(online.ntripClient == true)
257+
displayBitmap(18, 1, DownloadArrow_Width, DownloadArrow_Height, DownloadArrow);
258+
259+
oled.line(0, 11, 16, 11);
260+
243261
}
244262
else
245263
{
@@ -480,7 +498,6 @@ void paintSIV()
480498
if (online.display == true && online.gnss == true)
481499
{
482500
//Blink satellite dish icon if we don't have a fix
483-
uint8_t fixType = fixType;
484501
if (fixType == 3 || fixType == 4 || fixType == 5) //3D, 3D+DR, or Time
485502
{
486503
//Fix, turn on icon
@@ -509,13 +526,9 @@ void paintSIV()
509526
oled.print(":");
510527

511528
if (fixType == 0) //0 = No Fix
512-
{
513529
oled.print("0");
514-
}
515530
else
516-
{
517531
oled.print(numSV);
518-
}
519532

520533
paintResets();
521534
} //End gnss online
@@ -672,6 +685,25 @@ void paintRoverRTKFix()
672685
}
673686
}
674687

688+
//Display Blinking WiFi
689+
void paintRoverWiFiStarted()
690+
{
691+
if (online.display == true)
692+
{
693+
paintBatteryLevel(); //Top right corner
694+
695+
paintWirelessIcon(); //Top left corner
696+
697+
paintBaseState(); //Top center
698+
699+
paintHorizontalAccuracy();
700+
701+
paintSIV();
702+
703+
paintLogging();
704+
}
705+
}
706+
675707
//Start of base / survey in / NTRIP mode
676708
//Screen is displayed while we are waiting for horz accuracy to drop to appropriate level
677709
//Blink crosshair icon until we have we have horz accuracy < user defined level

0 commit comments

Comments
 (0)