Skip to content

Commit

Permalink
Merge pull request #492 from sparkfun/release_candidate
Browse files Browse the repository at this point in the history
Merge v3.4
  • Loading branch information
nseidle authored Jun 6, 2023
2 parents a6ed3a6 + a650a52 commit 070e61a
Show file tree
Hide file tree
Showing 48 changed files with 27,988 additions and 22,167 deletions.
38 changes: 35 additions & 3 deletions .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: 3
FIRMWARE_VERSION_MINOR: 3
FIRMWARE_VERSION_MINOR: 4
POINTPERFECT_TOKEN: ${{ secrets.POINTPERFECT_TOKEN }}

jobs:
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
"SdFat"@2.1.1
"SparkFun LIS2DH12 Arduino Library"@1.0.3
"SparkFun MAX1704x Fuel Gauge Arduino Library"@1.0.4
"SparkFun u-blox GNSS v3"@3.0.9
"SparkFun u-blox GNSS v3"@3.0.14
[email protected]

- name: Enable external libs
Expand All @@ -100,9 +100,41 @@ jobs:
cd Firmware/RTK_Surveyor/Patch/
cp Server.h /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.2/cores/esp32/Server.h
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

# Configure Python - now we have Python installed, we need to provide everything needed by esptool otherwise the compile fails
- name: Configure Python
run: |
pip3 install pyserial
- name: Update index_html
run: |
cd Firmware/Tools
python index_html_zipper.py ../RTK_Surveyor/AP-Config/index.html ../RTK_Surveyor/form.h
- name: Update main_js
run: |
cd Firmware/Tools
python main_js_zipper.py ../RTK_Surveyor/AP-Config/src/main.js ../RTK_Surveyor/form.h
- name: Commit and push form.h
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: ./Firmware/RTK_Surveyor
branch: ${{ env.BRANCH }}
message: 'Update form.h via Python ${date}'

- name: Copy custom app3M_fat9M_16MB.csv
run:
cp Firmware/app3M_fat9M_16MB.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.2/tools/partitions/app3M_fat9M_16MB.csv

- name: Compile Sketch
run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }} ./Firmware/RTK_Surveyor/RTK_Surveyor.ino
--build-property build.partitions=partitions
--build-property build.partitions=app3M_fat9M_16MB
--build-property upload.maximum_size=3145728
--build-property "compiler.cpp.extra_flags=\"-DPOINTPERFECT_TOKEN=$POINTPERFECT_TOKEN\" \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\" \"-DENABLE_DEVELOPER=${{ env.ENABLE_DEVELOPER }}\""
--export-binaries
Expand Down
222 changes: 163 additions & 59 deletions Firmware/RTK_Surveyor/AP-Config/index.html

Large diffs are not rendered by default.

124 changes: 116 additions & 8 deletions Firmware/RTK_Surveyor/AP-Config/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ const CoordinateTypes = {
COORDINATE_INPUT_TYPE_DD_MM_SS: 6, //DD MM SS.ssssss
COORDINATE_INPUT_TYPE_DD_MM_SS_DASH: 7, //DD-MM-SS.ssssss
COORDINATE_INPUT_TYPE_DD_MM_SS_SYMBOL: 8, //DD°MM'SS.ssssss"
COORDINATE_INPUT_TYPE_INVALID_UNKNOWN: 9,
COORDINATE_INPUT_TYPE_DDMMSS_NO_DECIMAL: 9, //DDMMSS - No decimal
COORDINATE_INPUT_TYPE_DD_MM_SS_NO_DECIMAL: 10, //DD MM SS - No decimal
COORDINATE_INPUT_TYPE_DD_MM_SS_DASH_NO_DECIMAL: 11, //DD-MM-SS - No decimal
COORDINATE_INPUT_TYPE_INVALID_UNKNOWN: 12,
}

var convertedCoordinate = 0.0;
Expand Down Expand Up @@ -95,6 +98,8 @@ function parseIncoming(msg) {
hide("ppConfig");
hide("ethernetConfig");
hide("ntpConfig");
//hide("allowWiFiOverEthernetClient"); //For future expansion
//hide("allowWiFiOverEthernetServer"); //For future expansion

hide("dataPortChannelDropdown");
}
Expand All @@ -104,13 +109,17 @@ function parseIncoming(msg) {
hide("ppConfig");
hide("ethernetConfig");
hide("ntpConfig");
//hide("allowWiFiOverEthernetClient"); //For future expansion
//hide("allowWiFiOverEthernetServer"); //For future expansion
}
else if (platformPrefix == "Express Plus") {
hide("baseConfig");
show("sensorConfig");
hide("ppConfig");
hide("ethernetConfig");
hide("ntpConfig");
//hide("allowWiFiOverEthernetClient"); //For future expansion
//hide("allowWiFiOverEthernetServer"); //For future expansion

ge("muxChannel2").innerHTML = "Wheel/Dir Encoder";
}
Expand All @@ -120,13 +129,17 @@ function parseIncoming(msg) {
show("ppConfig");
hide("ethernetConfig");
hide("ntpConfig");
//hide("allowWiFiOverEthernetClient"); //For future expansion
//hide("allowWiFiOverEthernetServer"); //For future expansion
}
else if (platformPrefix == "Reference Station") {
show("baseConfig");
hide("sensorConfig");
hide("ppConfig");
show("ethernetConfig");
show("ntpConfig");
//hide("allowWiFiOverEthernetClient"); //For future expansion
//hide("allowWiFiOverEthernetServer"); //For future expansion
}
}
else if (id.includes("zedFirmwareVersionInt")) {
Expand Down Expand Up @@ -335,10 +348,13 @@ function parseIncoming(msg) {
ge("radioType").dispatchEvent(new CustomEvent('change'));
ge("antennaReferencePoint").dispatchEvent(new CustomEvent('change'));
ge("autoIMUmountAlignment").dispatchEvent(new CustomEvent('change'));
ge("enableARPLogging").dispatchEvent(new CustomEvent('change'));

updateECEFList();
updateGeodeticList();
tcpBoxes();
tcpBoxesEthernet();
dhcpEthernet();
updateLatLong();
}

Expand Down Expand Up @@ -579,6 +595,7 @@ function validateFields() {
if (ge("enableTcpClient").checked || ge("enableTcpServer").checked) {
checkElementString("wifiTcpPort", 1, 65535, "Must be 1 to 65535", "collapseWiFiConfig");
}
checkCheckboxMutex("enableTcpClient", "enableTcpServer", "TCP Client and Server can not be enabled at the same time", "collapseWiFiConfig");

//System Config
if (ge("enableLogging").checked) {
Expand All @@ -590,6 +607,13 @@ function validateFields() {
clearElement("maxLogLength_minutes", 60 * 24);
}

if (ge("enableARPLogging").checked) {
checkElementValue("ARPLoggingInterval", 1, 600, "Must be 1 to 600", "collapseSystemConfig");
}
else {
clearElement("ARPLoggingInterval", 10);
}

//Ethernet
if (platformPrefix == "Reference Station") {
//if (ge("ethernetDHCP").checked == false) {
Expand All @@ -599,6 +623,10 @@ function validateFields() {
checkElementIPAddress("ethernetSubnet", "Must be nnn.nnn.nnn.nnn", "collapseEthernetConfig");
checkElementValue("ethernetHttpPort", 0, 65535, "Must be 0 to 65535", "collapseEthernetConfig");
checkElementValue("ethernetNtpPort", 0, 65535, "Must be 0 to 65535", "collapseEthernetConfig");
if (ge("enableTcpClientEthernet").checked) {
checkElementString("ethernetTcpPort", 1, 65535, "Must be 1 to 65535", "collapseEthernetConfig");
checkElementString("hostForTCPClient", 0, 50, "Must be 0 to 50 characters", "collapseEthernetConfig");
}
//}
//else {
// clearElement("ethernetIP", "192.168.0.123");
Expand Down Expand Up @@ -822,6 +850,19 @@ function checkElementCasterUser(id, badUserName, errorText, collapseID) {
clearError(id);
}

function checkCheckboxMutex(id1, id2, errorText, collapseID) {
if ((ge(id1).checked) && (ge(id2).checked)) {
ge(id1 + 'Error').innerHTML = 'Error: ' + errorText;
ge(id2 + 'Error').innerHTML = 'Error: ' + errorText;
ge(collapseID).classList.add('show');
errorCount++;
}
else {
clearError(id1);
clearError(id2);
}
}

function clearElement(id, value) {
ge(id).value = value;
clearError(id);
Expand Down Expand Up @@ -1135,6 +1176,15 @@ document.addEventListener("DOMContentLoaded", (event) => {
}
});

ge("enableARPLogging").addEventListener("change", function () {
if (ge("enableARPLogging").checked) {
show("enableARPLoggingDetails");
}
else {
hide("enableARPLoggingDetails");
}
});

ge("fixedAltitude").addEventListener("change", function () {
adjustHAE();
});
Expand Down Expand Up @@ -1268,12 +1318,12 @@ function addGeodetic() {
for (; index < recordsGeodetic.length; ++index) {
var parts = recordsGeodetic[index].split(' ');
if (ge("nicknameGeodetic").value == parts[0]) {
recordsGeodetic[index] = nicknameGeodetic.value + ' ' + fixedLat.value + ' ' + fixedLongText.value + ' ' + fixedAltitude.value + ' ' + antennaHeight.value + ' ' + antennaReferencePoint.value;
recordsGeodetic[index] = nicknameGeodetic.value + ' ' + fixedLatText.value + ' ' + fixedLongText.value + ' ' + fixedAltitude.value + ' ' + antennaHeight.value + ' ' + antennaReferencePoint.value;
break;
}
}
if (index == recordsGeodetic.length)
recordsGeodetic.push(nicknameGeodetic.value + ' ' + fixedLat.value + ' ' + fixedLongText.value + ' ' + fixedAltitude.value + ' ' + antennaHeight.value + ' ' + antennaReferencePoint.value);
recordsGeodetic.push(nicknameGeodetic.value + ' ' + fixedLatText.value + ' ' + fixedLongText.value + ' ' + fixedAltitude.value + ' ' + antennaHeight.value + ' ' + antennaReferencePoint.value);
}

updateGeodeticList();
Expand Down Expand Up @@ -1361,7 +1411,16 @@ function updateGeodeticList() {
$("#StationCoordinatesGeodetic option").each(function () {
var parts = $(this).text().split(' ');
var nickname = parts[0].substring(0, 15);
$(this).text(nickname + ': ' + parts[1] + ' ' + parts[2] + ' ' + parts[3]).text;

if (parts.length >= 7) {
$(this).text(nickname + ': ' + parts[1] + ' ' + parts[2] + ' ' + parts[3]
+ ' ' + parts[4] + ' ' + parts[5] + ' ' + parts[6]
+ ' ' + parts[7]).text;
}
else {
$(this).text(nickname + ': ' + parts[1] + ' ' + parts[2] + ' ' + parts[3]).text;
}

});
}

Expand Down Expand Up @@ -1517,6 +1576,25 @@ function tcpBoxes() {
}
}

function tcpBoxesEthernet() {
if (ge("enableTcpClientEthernet").checked) {
show("tcpSettingsConfigEthernet");
}
else {
hide("tcpSettingsConfigEthernet");
//ge("ethernetTcpPort").value = 2947;
}
}

function dhcpEthernet() {
if (ge("ethernetDHCP").checked) {
hide("fixedIPSettingsConfigEthernet");
}
else {
show("fixedIPSettingsConfigEthernet");
}
}

function networkCount() {
var count = 0;

Expand Down Expand Up @@ -1669,7 +1747,7 @@ function identifyInputType(userEntry) {
// DD MM SS.ssssss
// DD-MM-SS.ssssss

if (decimalCount != 1) return (CoordinateTypes.COORDINATE_INPUT_TYPE_INVALID_UNKNOWN); //Just no. 40.09033470 is valid.
if (decimalCount > 1) return (CoordinateTypes.COORDINATE_INPUT_TYPE_INVALID_UNKNOWN); //Just no. 40.09033470 is valid.
if (spaceCount > 2) return (CoordinateTypes.COORDINATE_INPUT_TYPE_INVALID_UNKNOWN); //Only 0, 1, or 2 allowed. 40 05 25.2049 is valid.
if (dashCount > 3) return (CoordinateTypes.COORDINATE_INPUT_TYPE_INVALID_UNKNOWN); //Only 0, 1, 2, or 3 allowed. -105-11-05.1629 is valid.
if (lengthOfLeadingNumber > 7) return (CoordinateTypes.COORDINATE_INPUT_TYPE_INVALID_UNKNOWN); //Only 7 or fewer. -1051105.188992 (DDDMMSS or DDMMSS) is valid
Expand All @@ -1689,6 +1767,11 @@ function identifyInputType(userEntry) {
var decimal = Math.trunc(intPortion / 10000); //Get DDD
intPortion -= (decimal * 10000);
var minutes = Math.trunc(intPortion / 100); //Get MM

//Find '.'
if (userEntry.indexOf('.') == -1)
coordinateInputType = CoordinateTypes.COORDINATE_INPUT_TYPE_DDMMSS_NO_DECIMAL;

var seconds = userEntry; //Get DDDMMSS.ssssss
seconds -= (decimal * 10000); //Remove DDD
seconds -= (minutes * 100); //Remove MM
Expand Down Expand Up @@ -1725,6 +1808,11 @@ function identifyInputType(userEntry) {
var data = userEntry.split('-');
var decimal = Number(data[0]); //Get DD
var minutes = Number(data[1]); //Get MM

//Find '.'
if (userEntry.indexOf('.') == -1)
coordinateInputType = CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_DASH_NO_DECIMAL;

var seconds = Number(data[2]); //Get SS.ssssss
convertedCoordinate = decimal + (minutes / 60.0) + (seconds / 3600.0);
if (negativeSign) convertedCoordinate *= -1;
Expand Down Expand Up @@ -1752,6 +1840,11 @@ function identifyInputType(userEntry) {
var data = userEntry.split(' ');
var decimal = Number(data[0]); //Get DD
var minutes = Number(data[1]); //Get MM

//Find '.'
if (userEntry.indexOf('.') == -1)
coordinateInputType = CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_NO_DECIMAL;

var seconds = Number(data[2]); //Get SS.ssssss
convertedCoordinate = decimal + (minutes / 60.0) + (seconds / 3600.0);
if (negativeSign) convertedCoordinate *= -1;
Expand Down Expand Up @@ -1796,6 +1889,9 @@ function convertInput(coordinate, coordinateInputType) {
|| coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DDMMSS
|| coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_DASH
|| coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_SYMBOL
|| coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DDMMSS_NO_DECIMAL
|| coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_NO_DECIMAL
|| coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_DASH_NO_DECIMAL
) {
var longitudeDegrees = Math.trunc(coordinate);
coordinate -= longitudeDegrees;
Expand All @@ -1815,8 +1911,14 @@ function convertInput(coordinate, coordinateInputType) {
coordinateString = longitudeDegrees + "-" + longitudeMinutes + "-" + coordinate;
else if (coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_SYMBOL)
coordinateString = longitudeDegrees + "°" + longitudeMinutes + "'" + coordinate + "\"";
else
else if (coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS)
coordinateString = longitudeDegrees + " " + longitudeMinutes + " " + coordinate;
else if (coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DDMMSS_NO_DECIMAL)
coordinateString = longitudeDegrees + "" + longitudeMinutes + "" + Math.round(coordinate);
else if (coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_NO_DECIMAL)
coordinateString = longitudeDegrees + " " + longitudeMinutes + " " + Math.round(coordinate);
else if (coordinateInputType == CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_DASH_NO_DECIMAL)
coordinateString = longitudeDegrees + "-" + longitudeMinutes + "-" + Math.round(coordinate);
}

return (coordinateString);
Expand Down Expand Up @@ -1853,8 +1955,14 @@ function printableInputType(coordinateInputType) {
case (CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS):
return ("DD MM SS.ssssss");
break;
case (CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_DASH):
return ("DD-MM-SS.ssssss");
case (CoordinateTypes.COORDINATE_INPUT_TYPE_DDMMSS_NO_DECIMAL):
return ("DDMMSS");
break;
case (CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_NO_DECIMAL):
return ("DD MM SS");
break;
case (CoordinateTypes.COORDINATE_INPUT_TYPE_DD_MM_SS_DASH_NO_DECIMAL):
return ("DD-MM-SS");
break;
}
return ("Unknown");
Expand Down
Loading

0 comments on commit 070e61a

Please sign in to comment.