Skip to content

Merge v1.1 release candidate #3

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 33 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b384fe7
Add fixed base entry with either ECEF or Geographic.
nseidle Dec 7, 2020
3feab9e
Add GNSS config menu: measurement rate and unit reset.
nseidle Dec 7, 2020
1113eab
Add slide switch to optionally route PPS to Data port
nseidle Dec 8, 2020
2dcd19b
Add internal Qwiic connector
nseidle Dec 9, 2020
d812971
Add support for Qwiic OLED display
nseidle Dec 9, 2020
8514674
Add config for port baud rates
nseidle Dec 9, 2020
11fff83
Add SBAS configure. Remove ZED module reset.
nseidle Dec 9, 2020
8c08094
2x2 Panel
nseidle Dec 10, 2020
466fff4
1x3 panel
Dec 10, 2020
26ffb82
Move fiducials on production panel
Dec 10, 2020
77365a0
Add NTRIP Server example using UART for harvesting
nseidle Dec 14, 2020
b3e554d
Add ability to enter settings for NTRIP Server
nseidle Dec 17, 2020
27057af
Add WiFi to Bluetooth switching test sketches
Dec 17, 2020
5688707
Prelim NTRIP server support. Reduced serial buffers. Reduced task sta…
Dec 17, 2020
d132e48
Adding Ticker and xTask demos
nseidle Dec 18, 2020
8e7b7ad
Add firmware update from SD example
nseidle Dec 19, 2020
1c1ac09
Add firmware upgrade detection and menu. Change GPS to auto PVT and H…
nseidle Dec 19, 2020
ffbe95f
Add progress bar
nseidle Dec 20, 2020
a213409
Add logging and RTCM antenna icons
nseidle Dec 20, 2020
0c8c6ab
Move begin functions to separate tab.
nseidle Dec 20, 2020
d3b8332
Move prints to F()
nseidle Dec 20, 2020
da552c9
Change the way statemachine times are updated
nseidle Dec 21, 2020
e83896e
Add Ticker task for BT LED.
nseidle Dec 21, 2020
575d7f0
Set handles to null after deleting task. Avoid Strings in batt check.
nseidle Dec 21, 2020
163b8fb
Move beginFuelGauge to begin tab. Change how bluetooth begins.
nseidle Dec 21, 2020
299a5cf
Correct timeout on base menu.
nseidle Dec 21, 2020
16a63c5
Add delay to begin datalogging
nseidle Dec 21, 2020
a7864e6
Change the way updates are timed
nseidle Dec 21, 2020
18d7e1f
Remove uncecessary dir structure from header location
nseidle Dec 21, 2020
09378c8
Gracefully exit base data entry with timeout or 'x'
nseidle Dec 21, 2020
edbb88c
Combine bluetooth start functions. Remove BT radio start/stop for WiFi.
nseidle Dec 21, 2020
a57d429
Update RTK_Surveyor.ino
nseidle Dec 21, 2020
f71cef4
Remove force firmware after loading
nseidle Dec 22, 2020
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
321 changes: 264 additions & 57 deletions Firmware/RTK_Surveyor/Base.ino

Large diffs are not rendered by default.

399 changes: 152 additions & 247 deletions Firmware/RTK_Surveyor/RTK_Surveyor.ino

Large diffs are not rendered by default.

116 changes: 61 additions & 55 deletions Firmware/RTK_Surveyor/Rover.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bool updateRoverStatus()
//Update the horizontal accuracy LEDs only every second or so
if (millis() - lastRoverUpdate > 2000)
{
lastRoverUpdate += 2000;
lastRoverUpdate = millis();

uint32_t accuracy = myGPS.getHorizontalAccuracy(250);

Expand All @@ -14,33 +14,33 @@ bool updateRoverStatus()
float f_accuracy = accuracy;
f_accuracy = f_accuracy / 10000.0; // Convert from mm * 10^-1 to m

Serial.print("Rover Accuracy (m): ");
Serial.print(F("Rover Accuracy (m): "));
Serial.print(f_accuracy, 4); // Print the accuracy with 4 decimal places

if (f_accuracy <= 0.02)
{
Serial.print(" 0.01m LED");
Serial.print(F(" 0.01m LED"));
digitalWrite(positionAccuracyLED_1cm, HIGH);
digitalWrite(positionAccuracyLED_10cm, HIGH);
digitalWrite(positionAccuracyLED_100cm, HIGH);
}
else if (f_accuracy <= 0.100)
{
Serial.print(" 0.1m LED");
Serial.print(F(" 0.1m LED"));
digitalWrite(positionAccuracyLED_1cm, LOW);
digitalWrite(positionAccuracyLED_10cm, HIGH);
digitalWrite(positionAccuracyLED_100cm, HIGH);
}
else if (f_accuracy <= 1.0000)
{
Serial.print(" 1m LED");
Serial.print(F(" 1m LED"));
digitalWrite(positionAccuracyLED_1cm, LOW);
digitalWrite(positionAccuracyLED_10cm, LOW);
digitalWrite(positionAccuracyLED_100cm, HIGH);
}
else if (f_accuracy > 1.0)
{
Serial.print(" No LEDs");
Serial.print(F(" No LEDs"));
digitalWrite(positionAccuracyLED_1cm, LOW);
digitalWrite(positionAccuracyLED_10cm, LOW);
digitalWrite(positionAccuracyLED_100cm, LOW);
Expand All @@ -49,10 +49,10 @@ bool updateRoverStatus()
}
else
{
Serial.print("Rover Accuracy: ");
Serial.print(F("Rover Accuracy: "));
Serial.print(accuracy);
Serial.print(" ");
Serial.print("No lock. SIV: ");
Serial.print(F("No lock. SIV: "));
Serial.print(myGPS.getSIV());
Serial.println();
}
Expand All @@ -64,51 +64,35 @@ bool configureUbloxModuleRover()
{
bool response = myGPS.disableSurveyMode(); //Disable survey

//Set output rate
if (myGPS.getNavigationFrequency() != settings.gnssMeasurementFrequency)
{
response &= myGPS.setNavigationFrequency(settings.gnssMeasurementFrequency); //Set output in Hz
}

// Set dynamic model
if (myGPS.getDynamicModel() != DYN_MODEL_PORTABLE)
{
response &= myGPS.setDynamicModel(DYN_MODEL_PORTABLE);
if (response == false)
Serial.println(F("setDynamicModel failed!"));
}

//Disable RTCM sentences
if (getRTCMSettings(UBX_RTCM_1005, COM_PORT_UART2) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_UART2, 0);
if (getRTCMSettings(UBX_RTCM_1074, COM_PORT_UART2) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1074, COM_PORT_UART2, 0);
if (getRTCMSettings(UBX_RTCM_1084, COM_PORT_UART2) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1084, COM_PORT_UART2, 0);
if (getRTCMSettings(UBX_RTCM_1094, COM_PORT_UART2) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1094, COM_PORT_UART2, 0);
if (getRTCMSettings(UBX_RTCM_1124, COM_PORT_UART2) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1124, COM_PORT_UART2, 0);
if (getRTCMSettings(UBX_RTCM_1230, COM_PORT_UART2) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_UART2, 0);

if (getRTCMSettings(UBX_RTCM_1005, COM_PORT_UART1) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_UART1, 0);
if (getRTCMSettings(UBX_RTCM_1074, COM_PORT_UART1) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1074, COM_PORT_UART1, 0);
if (getRTCMSettings(UBX_RTCM_1084, COM_PORT_UART1) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1084, COM_PORT_UART1, 0);
if (getRTCMSettings(UBX_RTCM_1094, COM_PORT_UART1) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1094, COM_PORT_UART1, 0);
if (getRTCMSettings(UBX_RTCM_1124, COM_PORT_UART1) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1124, COM_PORT_UART1, 0);
if (getRTCMSettings(UBX_RTCM_1230, COM_PORT_UART1) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_UART1, 0);

if (getRTCMSettings(UBX_RTCM_1005, COM_PORT_USB) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_USB, 0);
if (getRTCMSettings(UBX_RTCM_1074, COM_PORT_USB) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1074, COM_PORT_USB, 0);
if (getRTCMSettings(UBX_RTCM_1084, COM_PORT_USB) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1084, COM_PORT_USB, 0);
if (getRTCMSettings(UBX_RTCM_1094, COM_PORT_USB) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1094, COM_PORT_USB, 0);
if (getRTCMSettings(UBX_RTCM_1124, COM_PORT_USB) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1124, COM_PORT_USB, 0);
if (getRTCMSettings(UBX_RTCM_1230, COM_PORT_USB) != 0)
response &= myGPS.enableRTCMmessage(UBX_RTCM_1230, COM_PORT_USB, 0);
response &= disableRTCMSentences(COM_PORT_I2C);
response &= disableRTCMSentences(COM_PORT_UART2);
response &= disableRTCMSentences(COM_PORT_UART1);
response &= disableRTCMSentences(COM_PORT_USB);
if (response == false)
Serial.println(F("Disable RTCM failed"));

response &= setNMEASettings(); //Enable high precision NMEA and extended sentences

//Is SBAS causing weird NMEA failures once we are in RTK mode?
//response &= setSBAS(false); //Disable SBAS. Work around for RTK LED not working in v1.13 firmware.

if (settings.enableSBAS == true)
response &= setSBAS(true); //Enable SBAS
else
response &= setSBAS(false); //Disable SBAS. Work around for RTK LED not working in v1.13 firmware.

return (response);
}

Expand Down Expand Up @@ -145,6 +129,30 @@ bool setNMEASettings()
return (true);
}

//Returns true if SBAS is enabled
bool getSBAS()
{
uint8_t customPayload[MAX_PAYLOAD_SIZE]; // This array holds the payload data bytes
ubxPacket customCfg = {0, 0, 0, 0, 0, customPayload, 0, 0, SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED, SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED};

customCfg.cls = UBX_CLASS_CFG; // This is the message Class
customCfg.id = UBX_CFG_GNSS; // This is the message ID
customCfg.len = 0; // Setting the len (length) to zero lets us poll the current settings
customCfg.startingSpot = 0; // Always set the startingSpot to zero (unless you really know what you are doing)

uint16_t maxWait = 250; // Wait for up to 250ms (Serial may need a lot longer e.g. 1100)

// Read the current setting. The results will be loaded into customCfg.
if (myGPS.sendCommand(&customCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK
{
Serial.println(F("Get SBAS failed!"));
return (false);
}

if (customPayload[8 + 8 * 1] & (1 << 0)) return true; //Check if bit 0 is set
return false;
}

//The u-blox library doesn't directly support SBAS control so let's do it manually
bool setSBAS(bool enableSBAS)
{
Expand All @@ -167,15 +175,13 @@ bool setSBAS(bool enableSBAS)

if (enableSBAS)
{
if (customPayload[8 + 1 * 8] & (1 << 0)) return true; //If we want the bit set, and it already is, simply return

customPayload[8 + 1 * 8] |= (1 << 0); //Set the enable bit
customPayload[8 + 8 * 1] |= (1 << 0); //Set the enable bit
//We must enable the gnssID as well
customPayload[8 + 8 * 1 + 2] |= (1 << 0); //Set the enable bit (16) for SBAS L1C/A
}
else
{
if (customPayload[8 + 1 * 8] & (1 << 0) == 0) return true; //If we want the bit cleared, and it already is, simply return

customPayload[8 + 1 * 8] &= ~(1 << 0); //Clear the enable bit
customPayload[8 + 8 * 1] &= ~(1 << 0); //Clear the enable bit
}

// Now we write the custom packet back again to change the setting
Expand Down
Loading