Skip to content

Fix UART1 incorrect baud rate #106

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 7 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
63 changes: 33 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

#Eagle Backup files
*.s#?
*.b#?
*.l#?
*.lck

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# =========================
# Operating System Files
# =========================

# OSX
# =========================

tokens.h

# Windows image file caches
Thumbs.db
ehthumbs.db

#Eagle Backup files
*.s#?
*.b#?
*.l#?
*.lck

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Icon must ends with two \r.
Icon
Icon


# Thumbnails
._*
Expand Down
Binary file added Binaries/RTK_Surveyor_Firmware_v1_12.bin
Binary file not shown.
7 changes: 3 additions & 4 deletions Firmware/RTK_Surveyor/AP-Config/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,9 @@ function validateFields() {
//Base Config
checkElementValue("observationSeconds", 60, 600, "Must be between 60 to 600", "collapseBaseConfig");
checkElementValue("observationPositionAccuracy", 1, 5.1, "Must be between 1.0 to 5.0", "collapseBaseConfig");
checkElementValue("fixedEcefX", -5000000, 5000000, "Must be -5000000 to 5000000", "collapseBaseConfig");
checkElementValue("fixedEcefY", -5000000, 5000000, "Must be -5000000 to 5000000", "collapseBaseConfig");
if (ge("fixedEcefZ").value == 0.0) ge("fixedEcefZ").value = 4084500;
checkElementValue("fixedEcefZ", 3300000, 5000000, "Must be 3300000 to 5000000", "collapseBaseConfig");
checkElementValue("fixedEcefX", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
checkElementValue("fixedEcefY", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
checkElementValue("fixedEcefZ", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
checkElementValue("fixedLat", -180, 180, "Must be -180 to 180", "collapseBaseConfig");
checkElementValue("fixedLong", -180, 180, "Must be -180 to 180", "collapseBaseConfig");
checkElementValue("fixedAltitude", -11034, 8849, "Must be -11034 to 8849", "collapseBaseConfig");
Expand Down
2 changes: 1 addition & 1 deletion Firmware/RTK_Surveyor/Begin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void beginUART2()
void pinUART2Task( void *pvParameters )
{
serialGNSS.setRxBufferSize(SERIAL_SIZE_RX);
serialGNSS.setTimeout(0);
serialGNSS.setTimeout(settings.serialTimeoutGNSS);
serialGNSS.begin(settings.dataPortBaud); //UART2 on pins 16/17 for SPP. The ZED-F9P will be configured to output NMEA over its UART1 at the same rate.

uart2pinned = true;
Expand Down
3 changes: 3 additions & 0 deletions Firmware/RTK_Surveyor/Form.ino
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ void createSettingsString(char* settingsCSV)
stringRecord(settingsCSV, "externalPulsePolarity", settings.externalPulsePolarity);
stringRecord(settingsCSV, "enableExternalHardwareEventLogging", settings.enableExternalHardwareEventLogging);
stringRecord(settingsCSV, "profileName", settings.profileName);
stringRecord(settingsCSV, "serialTimeoutGNSS", settings.serialTimeoutGNSS);

strcat(settingsCSV, "\0");
Serial.printf("settingsCSV len: %d\n\r", strlen(settingsCSV));
Expand Down Expand Up @@ -511,6 +512,8 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
strcpy(settings.ntripClient_wifiPW, settingValueStr);
else if (strcmp(settingName, "ntripClient_TransmitGGA") == 0)
settings.ntripClient_TransmitGGA = settingValueBool;
else if (strcmp(settingName, "serialTimeoutGNSS") == 0)
settings.serialTimeoutGNSS = settingValue;

//Unused variables - read to avoid errors
else if (strcmp(settingName, "measurementRateSec") == 0) {}
Expand Down
22 changes: 18 additions & 4 deletions Firmware/RTK_Surveyor/NVM.ino
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ uint8_t getProfileNumber()
else
{
profileNumber = fileProfileNumber.read();
updateZEDSettings = fileProfileNumber.read();
fileProfileNumber.close();
}

Expand Down Expand Up @@ -217,7 +216,7 @@ void recordProfileNumber(uint8_t profileNumber, bool markForUpdate)
return;
}
fileProfileNumber.write(profileNumber);
fileProfileNumber.write(markForUpdate); //If true, ZED will be config'd next POR
fileProfileNumber.write(markForUpdate); //If true, ZED will be config'd next POR
fileProfileNumber.close();
}

Expand Down Expand Up @@ -357,6 +356,7 @@ void recordSystemSettingsToFile()
settingsFile.println("ntripClient_wifiSSID=" + (String)settings.ntripClient_wifiSSID);
settingsFile.println("ntripClient_wifiPW=" + (String)settings.ntripClient_wifiPW);
settingsFile.println("ntripClient_TransmitGGA=" + (String)settings.ntripClient_TransmitGGA);
settingsFile.println("serialTimeoutGNSS=" + (String)settings.serialTimeoutGNSS);

//Record constellation settings
for (int x = 0 ; x < MAX_CONSTELLATIONS ; x++)
Expand Down Expand Up @@ -633,9 +633,21 @@ bool parseLine(char* str) {
}
}
else if (strcmp(settingName, "dataPortBaud") == 0)
settings.dataPortBaud = d;
{
if (settings.dataPortBaud != d)
{
settings.dataPortBaud = d;
updateZEDSettings = true;
}
}
else if (strcmp(settingName, "radioPortBaud") == 0)
settings.radioPortBaud = d;
{
if (settings.radioPortBaud != d)
{
settings.radioPortBaud = d;
updateZEDSettings = true;
}
}
else if (strcmp(settingName, "surveyInStartingAccuracy") == 0)
settings.surveyInStartingAccuracy = d;
else if (strcmp(settingName, "measurementRate") == 0)
Expand Down Expand Up @@ -786,6 +798,8 @@ bool parseLine(char* str) {
strcpy(settings.ntripClient_wifiPW, settingValue);
else if (strcmp(settingName, "ntripClient_TransmitGGA") == 0)
settings.ntripClient_TransmitGGA = d;
else if (strcmp(settingName, "serialTimeoutGNSS") == 0)
settings.serialTimeoutGNSS = d;

//Check for bulk settings (constellations and message rates)
//Must be last on else list
Expand Down
2 changes: 1 addition & 1 deletion Firmware/RTK_Surveyor/RTK_Surveyor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*/

const int FIRMWARE_VERSION_MAJOR = 1;
const int FIRMWARE_VERSION_MINOR = 11;
const int FIRMWARE_VERSION_MINOR = 12;

#define COMPILE_WIFI //Comment out to remove all WiFi functionality
#define COMPILE_BT //Comment out to disable all Bluetooth
Expand Down
7 changes: 3 additions & 4 deletions Firmware/RTK_Surveyor/form.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,9 @@ function validateFields() {
//Base Config
checkElementValue("observationSeconds", 60, 600, "Must be between 60 to 600", "collapseBaseConfig");
checkElementValue("observationPositionAccuracy", 1, 5.1, "Must be between 1.0 to 5.0", "collapseBaseConfig");
checkElementValue("fixedEcefX", -5000000, 5000000, "Must be -5000000 to 5000000", "collapseBaseConfig");
checkElementValue("fixedEcefY", -5000000, 5000000, "Must be -5000000 to 5000000", "collapseBaseConfig");
if (ge("fixedEcefZ").value == 0.0) ge("fixedEcefZ").value = 4084500;
checkElementValue("fixedEcefZ", 3300000, 5000000, "Must be 3300000 to 5000000", "collapseBaseConfig");
checkElementValue("fixedEcefX", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
checkElementValue("fixedEcefY", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
checkElementValue("fixedEcefZ", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
checkElementValue("fixedLat", -180, 180, "Must be -180 to 180", "collapseBaseConfig");
checkElementValue("fixedLong", -180, 180, "Must be -180 to 180", "collapseBaseConfig");
checkElementValue("fixedAltitude", -11034, 8849, "Must be -11034 to 8849", "collapseBaseConfig");
Expand Down
16 changes: 16 additions & 0 deletions Firmware/RTK_Surveyor/menuSystem.ino
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ void menuDebug()
if (settings.enableResetDisplay == true) Serial.println(F("Enabled"));
else Serial.println(F("Disabled"));

Serial.print(F("9) GNSS Serial Timeout: "));
Serial.println(settings.serialTimeoutGNSS);

Serial.println(F("e) Erase LittleFS"));

Serial.println(F("r) Force system reset"));
Expand Down Expand Up @@ -249,6 +252,19 @@ void menuDebug()
recordSystemSettings(); //Record to NVM
}
}
else if (incoming == '9')
{
Serial.print(F("Enter GNSS Serial Timeout in milliseconds (0 to 1000): "));
uint16_t serialTimeoutGNSS = getNumber(menuTimeout); //Timeout after x seconds
if (serialTimeoutGNSS < 0 || serialTimeoutGNSS > 1000) //Arbitrary 1s limit
{
Serial.println(F("Error: Timeout is out of range"));
}
else
{
settings.serialTimeoutGNSS = serialTimeoutGNSS; //Recorded to NVM and file at main menu exit
}
}
else if (incoming == 'e')
{
Serial.println("Erasing LittleFS and resetting");
Expand Down
2 changes: 2 additions & 0 deletions Firmware/RTK_Surveyor/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ typedef struct struct_settings {
char ntripClient_wifiPW[50] = "parachutes";
bool ntripClient_TransmitGGA = true;

int16_t serialTimeoutGNSS = 1; //In ms - used during SerialGNSS.begin. Number of ms to pass of no data before hardware serial reports data available.

} Settings;
Settings settings;

Expand Down
8 changes: 6 additions & 2 deletions Firmware/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@ Note: The COMPILE_WIFI and COMPILE_BT defines at the top of RTK_Surveyor.ino can
----
### A note about ZED-F9P firmware

The firmware loaded onto the ZED-F9P receiver is currently one of two versions: v1.12 or v1.13. All field testing and device specific performance parameters were obtained with v1.12.
The firmware loaded onto the ZED-F9P receiver can vary depending on manufacture date. Currently one of three versions: v1.12, v1.13, and v1.30. All field testing and device specific performance parameters were obtained with v1.30.

v1.12 has the benefit of working with SBAS and an operational RTK status signal (the LED illuminates correctly).

v1.13 has a few RTK and receiver performance improvements but introduces a bug that causes the RTK Status LED to fail when SBAS is enabled.

v1.30 has a few RTK and receiver performance improvements, I<sup>2</sup>C communication improvements, and most importantly support for Spartan PMP packets.

The RTK Firmware is designed to work with any ZED-F9x firmware. Upgrading the ZED-F9x is a good thing to consider but is not crucial to the use of the RTK products.

A tutorial with step-by-step instructions for locating the firmware version as well as changing the firmware can be found [here](https://learn.sparkfun.com/tutorials/how-to-upgrade-firmware-of-a-u-blox-gnss-receiver).

More information about the differences can be found [here](https://www.u-blox.com/sites/default/files/ZED-F9P-FW100-HPG113_RN_%28UBX-20019211%29.pdf).
More information about the differences can be found [here](https://content.u-blox.com/sites/default/files/ZED-F9P-FW100-HPG130_RN_UBX-21047459.pdf).