Skip to content
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

More changes - primarily for the Reference Station on Ethernet #471

Merged
merged 36 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e33ca33
Fix silly bug in ethernetRestart
PaulZC May 9, 2023
4e6ede7
Add Antenna Reference Position logging
PaulZC May 10, 2023
a5b1d78
Fix gremlins in menuMessagesBaseRTCM
PaulZC May 11, 2023
b4a62c8
Correct menuMessagesSubtype
PaulZC May 11, 2023
d86a7e4
Avoid using String as a return type:
PaulZC May 11, 2023
d9e47d1
Add missing dispatchEvent for enableARPLogging
PaulZC May 11, 2023
b065c3b
Fake the ZED firmware version for when Ref Stn is in configViaEtherne…
PaulZC May 11, 2023
845a6f5
Update form.h
PaulZC May 11, 2023
bf1ef7b
Update index.html
PaulZC May 11, 2023
0e9663b
Update form.h
PaulZC May 11, 2023
ad75f33
Include SD size and free space in getFileList
PaulZC May 11, 2023
497ccf3
Update box sizes
PaulZC May 11, 2023
5490480
Turn LEDs off at powerDown. Stop Ethernet Web Server at powerDown.
PaulZC May 12, 2023
96512b0
Revert to a simple bool GNSS lock
PaulZC May 12, 2023
2c8c144
Update RTK_Surveyor.ino
PaulZC May 12, 2023
117accd
Increase size of logFileName
PaulZC May 12, 2023
67ba51c
Fix mythical SFE file: pass the size of lastLogName into findLastLog
PaulZC May 12, 2023
f5a744d
Initialize stateName in bluetoothStart
PaulZC May 12, 2023
afef69a
Tweaks. Nothing significant...
PaulZC May 13, 2023
d2e8887
Battery level fix
PaulZC May 13, 2023
ef98c83
Remove defaultSettings
PaulZC May 13, 2023
b41cd70
Make ubxMessages const
PaulZC May 13, 2023
7a45072
More tweaks
PaulZC May 13, 2023
af26a2b
Merge branch 'release_candidate' into Add_Ref_Stn_Ethernet
PaulZC May 15, 2023
8669bf0
Compile everything
PaulZC May 15, 2023
f1daa96
Update compile-rtk-firmware.yml
PaulZC May 16, 2023
4d2310d
Comment out NTRIP UseWiFiNotEthernet
PaulZC May 18, 2023
59499c2
Fix sizeof bug in strncpy in MQTT
PaulZC May 18, 2023
5cd6b3a
Merge branch 'release_candidate' into Add_Ref_Stn_Ethernet
PaulZC May 19, 2023
48a7050
Restart RTK when changing the Buffer Size
PaulZC May 19, 2023
3d6e1c3
Restructure handleGNSSDataTask, wifiSendTcpData and tcpUpdate - NOT Y…
PaulZC May 19, 2023
18f9901
Add mutex errors for enableTcpServer and enableTcpClient
PaulZC May 19, 2023
7ba75b4
Add individual errors
PaulZC May 19, 2023
2f4cd71
Comment allowWiFiOverEthernet in index and js
PaulZC May 19, 2023
0d6f990
Merge branch 'release_candidate' into Add_Ref_Stn_Ethernet
PaulZC May 22, 2023
3b105ff
Increase GNSS Handler limit to 64kB
PaulZC May 23, 2023
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
28 changes: 27 additions & 1 deletion .github/workflows/compile-rtk-firmware.yml
Original file line number Diff line number Diff line change
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.12
[email protected]

- name: Enable external libs
Expand All @@ -100,6 +100,32 @@ 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

- 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
Expand Down
53 changes: 41 additions & 12 deletions Firmware/RTK_Surveyor/AP-Config/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@
</span>
</div>

<!-- For future expansion
<div id="allowWiFiOverEthernetClient">
<div class="form-check mt-1 box-margin20">
<label class="form-check-label" for="ntripClientUseWiFiNotEthernet">Use WiFi for NTRIP Client - not Ethernet</label>
Expand All @@ -434,7 +435,7 @@
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</div>
</div>
</div> -->
</div>

<div id="messageRateButton">
Expand Down Expand Up @@ -510,7 +511,7 @@
<div id="surveyInConfig" class="collapse mb-2">
<div class="form-group row">
<label for="observationSeconds" class="box-margin20 col-sm-12 col-form-label">Minimum
observation time(s):</label>
observation time (s):</label>
<div class="col-sm-4 col-5 ms-3 mb-2">
<input type="number" class="form-control" id="observationSeconds">
<p id="observationSecondsError" class="inlineError"></p>
Expand Down Expand Up @@ -887,6 +888,7 @@
</div>
</div>

<!-- For future expansion
<div id="allowWiFiOverEthernetServer">
<div class="form-check mt-1 box-margin20">
<label class="form-check-label" for="ntripUseWiFiNotEthernet">Use WiFi for NTRIP Server - not Ethernet</label>
Expand All @@ -896,7 +898,7 @@
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</div>
</div>
</div> -->
</div>

<div>
Expand Down Expand Up @@ -1300,6 +1302,9 @@
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</div>
<div class="form-group row">
<p id="enableTcpClientError" class="inlineError"></p>
</div>

<div class="form-check mt-3">
<label class="form-check-label" for="enableTcpServer">TCP Server</label>
Expand All @@ -1310,6 +1315,9 @@
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</div>
<div class="form-group row">
<p id="enableTcpServerError" class="inlineError"></p>
</div>

<div id="tcpSettingsConfig">
<div class="form-group row">
Expand Down Expand Up @@ -1545,6 +1553,27 @@
</div>
</div>

<div class="form-check mt-1 box-margin20">
<label class="form-check-label" for="enableARPLogging">Enable ARP Logging</label>
<input class="form-check-input" type="checkbox" value="" id="enableARPLogging" unchecked>
<span class="tt" data-bs-placement="right"
title="If enabled, the Antenna Reference Position from RTCM 1005/1006 will be added to the log.">
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</div>

<div id="enableARPLoggingDetails" class="collapse mb-2">
<div class="form-group row">
<label for="ARPLoggingInterval" class="box-margin40 col-sm-3 col-7 col-form-label">ARP Logging Interval (s):
<span class="tt" data-bs-placement="right"
title="If ARP logging is enabled, the Antenna Reference Position will be logged at intervals of this many seconds.">
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</label>
<input type="number" class="form-control box-small" id="ARPLoggingInterval">
<p id="ARPLoggingIntervalError" class="inlineError"></p>
</div>
</div>
</div>

<div id="bluetoothRadioTypeDropdown" class="mb-2 mt-3">
Expand Down Expand Up @@ -1669,7 +1698,7 @@
</span>
</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="ethernetHttpPort">
<input type="number" class="form-control" id="ethernetHttpPort">
<p id="ethernetHttpPortError" class="inlineError"></p>
</div>
</div>
Expand All @@ -1680,7 +1709,7 @@
</span>
</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="ethernetNtpPort">
<input type="number" class="form-control" id="ethernetNtpPort">
<p id="ethernetNtpPortError" class="inlineError"></p>
</div>
</div>
Expand All @@ -1704,8 +1733,8 @@
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</label>
<div class="col-sm-8 col-7">
<input type="text" class="form-control" id="ethernetTcpPort">
<div class="col-sm-5">
<input type="number" class="form-control" id="ethernetTcpPort">
<p id="ethernetTcpPortError" class="inlineError"></p>
</div>
</div>
Expand All @@ -1716,7 +1745,7 @@
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</label>
<div class="col-sm-8 col-7">
<div class="col-sm-5">
<input type="text" class="form-control" id="hostForTCPClient" value="test">
<p id="hostForTCPClientError" class="inlineError"></p>
</div>
Expand Down Expand Up @@ -1744,7 +1773,7 @@
</span>
</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="ntpPollExponent">
<input type="number" class="form-control" id="ntpPollExponent">
<p id="ntpPollExponentError" class="inlineError"></p>
</div>
</div>
Expand All @@ -1756,7 +1785,7 @@
</span>
</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="ntpPrecision">
<input type="number" class="form-control" id="ntpPrecision">
<p id="ntpPrecisionError" class="inlineError"></p>
</div>
</div>
Expand All @@ -1768,7 +1797,7 @@
</span>
</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="ntpRootDelay">
<input type="number" class="form-control" id="ntpRootDelay">
<p id="ntpRootDelayError" class="inlineError"></p>
</div>
</div>
Expand All @@ -1780,7 +1809,7 @@
</span>
</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="ntpRootDispersion">
<input type="number" class="form-control" id="ntpRootDispersion">
<p id="ntpRootDispersionError" class="inlineError"></p>
</div>
</div>
Expand Down
51 changes: 41 additions & 10 deletions Firmware/RTK_Surveyor/AP-Config/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ function parseIncoming(msg) {
hide("ppConfig");
hide("ethernetConfig");
hide("ntpConfig");
hide("allowWiFiOverEthernetClient")
hide("allowWiFiOverEthernetServer")
//hide("allowWiFiOverEthernetClient"); //For future expansion
//hide("allowWiFiOverEthernetServer"); //For future expansion

hide("dataPortChannelDropdown");
}
Expand All @@ -106,17 +106,17 @@ function parseIncoming(msg) {
hide("ppConfig");
hide("ethernetConfig");
hide("ntpConfig");
hide("allowWiFiOverEthernetClient")
hide("allowWiFiOverEthernetServer")
//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")
hide("allowWiFiOverEthernetServer")
//hide("allowWiFiOverEthernetClient"); //For future expansion
//hide("allowWiFiOverEthernetServer"); //For future expansion

ge("muxChannel2").innerHTML = "Wheel/Dir Encoder";
}
Expand All @@ -126,17 +126,17 @@ function parseIncoming(msg) {
show("ppConfig");
hide("ethernetConfig");
hide("ntpConfig");
hide("allowWiFiOverEthernetClient")
hide("allowWiFiOverEthernetServer")
//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");
show("allowWiFiOverEthernetClient")
show("allowWiFiOverEthernetServer")
//hide("allowWiFiOverEthernetClient"); //For future expansion
//hide("allowWiFiOverEthernetServer"); //For future expansion
}
}
else if (id.includes("zedFirmwareVersionInt")) {
Expand Down Expand Up @@ -345,6 +345,7 @@ 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();
Expand Down Expand Up @@ -591,6 +592,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 @@ -602,6 +604,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 Down Expand Up @@ -838,6 +847,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 @@ -1151,6 +1173,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
5 changes: 5 additions & 0 deletions Firmware/RTK_Surveyor/Begin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ void identifyBoard()
else if (idValue > (3300 * 1 / 3 * 0.9) && idValue < (3300 * 1 / 3 * 1.1))
{
productVariant = REFERENCE_STATION;
//We can't auto-detect the ZED version if the firmware is in configViaEthernet mode,
//so fake it here - otherwise messageSupported always returns false
zedFirmwareVersionInt = 112;
}
else
{
Expand Down Expand Up @@ -750,6 +753,8 @@ void configureGNSS()

theGNSS.setAutoPVTcallbackPtr(&storePVTdata); //Enable automatic NAV PVT messages with callback to storePVTdata
theGNSS.setAutoHPPOSLLHcallbackPtr(&storeHPdata); //Enable automatic NAV HPPOSLLH messages with callback to storeHPdata
theGNSS.setRTCM1005InputcallbackPtr(&storeRTCM1005data); //Configure a callback for RTCM 1005 - parsed from pushRawData
theGNSS.setRTCM1006InputcallbackPtr(&storeRTCM1006data); //Configure a callback for RTCM 1006 - parsed from pushRawData

if (HAS_GNSS_TP_INT)
theGNSS.setAutoTIMTPcallbackPtr(&storeTIMTPdata); //Enable automatic TIM TP messages with callback to storeTIMTPdata
Expand Down
4 changes: 2 additions & 2 deletions Firmware/RTK_Surveyor/Bluetooth.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#ifdef COMPILE_BT
BTSerialInterface *bluetoothSerial;
static volatile byte bluetoothState = BT_OFF;
static volatile BTState bluetoothState = BT_OFF;

//----------------------------------------
//Bluetooth Routines - compiled out
Expand Down Expand Up @@ -147,7 +147,7 @@ void bluetoothStart()
#ifdef COMPILE_BT
if (bluetoothState == BT_OFF)
{
char stateName[11];
char stateName[11] = { 0 };
if (systemState >= STATE_ROVER_NOT_STARTED && systemState <= STATE_ROVER_RTK_FIX)
strncpy(stateName, "Rover-", sizeof(stateName) - 1);
else if (systemState >= STATE_BASE_NOT_STARTED && systemState <= STATE_BASE_FIXED_TRANSMITTING)
Expand Down
7 changes: 7 additions & 0 deletions Firmware/RTK_Surveyor/Buttons.ino
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@ void powerDown(bool displayInfo)
//Prevent other tasks from logging, even if access to the microSD card was denied
online.logging = false;

//If we are in configureViaEthernet mode, we need to shut down the async web server
//otherwise it causes a core panic and badness at the restart
if (configureViaEthernet)
endEthernerWebServerESP32W5500();

if (displayInfo == true)
{
displayShutdown();
delay(2000);
}

beginLEDs(); //Turn LEDs off

if (pin_powerSenseAndControl >= 0)
{
pinMode(pin_powerSenseAndControl, OUTPUT);
Expand Down
Loading