diff --git a/Firmware/RTK_Surveyor/Form.ino b/Firmware/RTK_Surveyor/Form.ino index f878db459..e8497ff02 100644 --- a/Firmware/RTK_Surveyor/Form.ino +++ b/Firmware/RTK_Surveyor/Form.ino @@ -651,10 +651,6 @@ void createSettingsString(char *newSettings) stringRecord(newSettings, "ntripClient_MountPointPW", settings.ntripClient_MountPointPW); stringRecord(newSettings, "ntripClient_TransmitGGA", settings.ntripClient_TransmitGGA); - // stringRecord(newSettings, "ntripServerUseWiFiNotEthernet", settings.ntripServerUseWiFiNotEthernet); //For future - // expansion stringRecord(newSettings, "ntripClientUseWiFiNotEthernet", settings.ntripClientUseWiFiNotEthernet); - // //For future expansion - // Sensor Fusion Config stringRecord(newSettings, "enableSensorFusion", settings.enableSensorFusion); stringRecord(newSettings, "autoIMUmountAlignment", settings.autoIMUmountAlignment); @@ -1162,12 +1158,6 @@ void updateSettingWithValue(const char *settingName, const char *settingValueStr else if (strcmp(settingName, "ntripClient_TransmitGGA") == 0) settings.ntripClient_TransmitGGA = settingValueBool; - // For future expansion - // else if (strcmp(settingName, "ntripServerUseWiFiNotEthernet") == 0) - // settings.ntripServerUseWiFiNotEthernet = settingValueBool; - // else if (strcmp(settingName, "ntripClientUseWiFiNotEthernet") == 0) - // settings.ntripClientUseWiFiNotEthernet = settingValueBool; - else if (strcmp(settingName, "serialTimeoutGNSS") == 0) settings.serialTimeoutGNSS = settingValue; else if (strcmp(settingName, "pointPerfectDeviceProfileToken") == 0) diff --git a/Firmware/RTK_Surveyor/NVM.ino b/Firmware/RTK_Surveyor/NVM.ino index fc99f056f..29293cd05 100644 --- a/Firmware/RTK_Surveyor/NVM.ino +++ b/Firmware/RTK_Surveyor/NVM.ino @@ -250,8 +250,6 @@ void recordSystemSettingsToFile(File *settingsFile) settingsFile->printf("%s=%s\r\n", "ntripServer_CasterUserPW", settings.ntripServer_CasterUserPW); settingsFile->printf("%s=%s\r\n", "ntripServer_MountPoint", settings.ntripServer_MountPoint); settingsFile->printf("%s=%s\r\n", "ntripServer_MountPointPW", settings.ntripServer_MountPointPW); - // settingsFile->printf("%s=%d\r\n", "ntripServerUseWiFiNotEthernet", settings.ntripServerUseWiFiNotEthernet); //For - // future expansion settingsFile->printf("%s=%d\r\n", "enableNtripClient", settings.enableNtripClient); settingsFile->printf("%s=%s\r\n", "ntripClient_CasterHost", settings.ntripClient_CasterHost); settingsFile->printf("%s=%d\r\n", "ntripClient_CasterPort", settings.ntripClient_CasterPort); @@ -260,8 +258,6 @@ void recordSystemSettingsToFile(File *settingsFile) settingsFile->printf("%s=%s\r\n", "ntripClient_MountPoint", settings.ntripClient_MountPoint); settingsFile->printf("%s=%s\r\n", "ntripClient_MountPointPW", settings.ntripClient_MountPointPW); settingsFile->printf("%s=%d\r\n", "ntripClient_TransmitGGA", settings.ntripClient_TransmitGGA); - // settingsFile->printf("%s=%d\r\n", "ntripClientUseWiFiNotEthernet", settings.ntripClientUseWiFiNotEthernet); //For - // future expansion settingsFile->printf("%s=%d\r\n", "serialTimeoutGNSS", settings.serialTimeoutGNSS); settingsFile->printf("%s=%s\r\n", "pointPerfectDeviceProfileToken", settings.pointPerfectDeviceProfileToken); settingsFile->printf("%s=%d\r\n", "enablePointPerfectCorrections", settings.enablePointPerfectCorrections); @@ -1006,9 +1002,6 @@ bool parseLine(char *str, Settings *settings) strcpy(settings->ntripServer_MountPoint, settingValue); else if (strcmp(settingName, "ntripServer_MountPointPW") == 0) strcpy(settings->ntripServer_MountPointPW, settingValue); - // For future expansion - // else if (strcmp(settingName, "ntripServerUseWiFiNotEthernet") == 0) - // settings->ntripServerUseWiFiNotEthernet = d; else if (strcmp(settingName, "enableNtripClient") == 0) settings->enableNtripClient = d; else if (strcmp(settingName, "ntripClient_CasterHost") == 0) @@ -1025,9 +1018,6 @@ bool parseLine(char *str, Settings *settings) strcpy(settings->ntripClient_MountPointPW, settingValue); else if (strcmp(settingName, "ntripClient_TransmitGGA") == 0) settings->ntripClient_TransmitGGA = d; - // For future expansion - // else if (strcmp(settingName, "ntripClientUseWiFiNotEthernet") == 0) - // settings->ntripClientUseWiFiNotEthernet = d; else if (strcmp(settingName, "serialTimeoutGNSS") == 0) settings->serialTimeoutGNSS = d; else if (strcmp(settingName, "pointPerfectDeviceProfileToken") == 0) diff --git a/Firmware/RTK_Surveyor/NtripClient.ino b/Firmware/RTK_Surveyor/NtripClient.ino index cfbd03096..6042ca42c 100644 --- a/Firmware/RTK_Surveyor/NtripClient.ino +++ b/Firmware/RTK_Surveyor/NtripClient.ino @@ -374,7 +374,7 @@ void ntripClientUpdate() // Start the network case NTRIP_CLIENT_ON: { - if (HAS_ETHERNET) // && !settings.ntripClientUseWiFiNotEthernet) //For future expansion + if (HAS_ETHERNET) { if (online.ethernetStatus == ETH_NOT_STARTED) { @@ -425,7 +425,7 @@ void ntripClientUpdate() if ((millis() - ntripClientTimer) > (1 * 60 * 1000)) // Failed to connect to to the network, attempt to restart the network ntripClientStop(false); - else if (HAS_ETHERNET) // && !settings.ntripClientUseWiFiNotEthernet) //For future expansion + else if (HAS_ETHERNET) { if (online.ethernetStatus == ETH_CONNECTED) ntripClientSetState(NTRIP_CLIENT_NETWORK_CONNECTED); diff --git a/Firmware/RTK_Surveyor/NtripServer.ino b/Firmware/RTK_Surveyor/NtripServer.ino index 3d7b38e22..e79c8b747 100644 --- a/Firmware/RTK_Surveyor/NtripServer.ino +++ b/Firmware/RTK_Surveyor/NtripServer.ino @@ -373,7 +373,7 @@ void ntripServerUpdate() // Start the network case NTRIP_SERVER_ON: - if (HAS_ETHERNET) // && !settings.ntripServerUseWiFiNotEthernet) //For future expansion + if (HAS_ETHERNET) { if (online.ethernetStatus == ETH_NOT_STARTED) { @@ -424,7 +424,7 @@ void ntripServerUpdate() if ((millis() - ntripServerTimer) > (1 * 60 * 1000)) // Failed to connect to to the network, attempt to restart the network ntripServerStop(false); - else if (HAS_ETHERNET) // && !settings.ntripServerUseWiFiNotEthernet) //For future expansion + else if (HAS_ETHERNET) { if (online.ethernetStatus == ETH_CONNECTED) ntripServerSetState(NTRIP_SERVER_NETWORK_CONNECTED); diff --git a/Firmware/RTK_Surveyor/menuBase.ino b/Firmware/RTK_Surveyor/menuBase.ino index 97cb046fa..1c50267aa 100644 --- a/Firmware/RTK_Surveyor/menuBase.ino +++ b/Firmware/RTK_Surveyor/menuBase.ino @@ -109,14 +109,6 @@ void menuBase() systemPrint("13) Select survey-in radio: "); systemPrintf("%s\r\n", settings.ntripServer_StartAtSurveyIn ? "WiFi" : "Bluetooth"); } - - // For future expansion - // if (HAS_ETHERNET) - //{ - // systemPrintf("14) Use WiFi (not Ethernet) for NTRIP Server: ", menuEntry++); - // if (settings.ntripServerUseWiFiNotEthernet == true) systemPrintln("Enabled"); - // else systemPrintln("Disabled"); - // } } else { @@ -333,12 +325,6 @@ void menuBase() settings.ntripServer_StartAtSurveyIn ^= 1; restartBase = true; } - // For future expansion - // else if (incoming == 14 && settings.enableNtripServer == true && HAS_ETHERNET) - //{ - // settings.ntripServerUseWiFiNotEthernet ^= 1; - // restartBase = true; - // } else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT) break; else if (incoming == INPUT_RESPONSE_GETNUMBER_TIMEOUT) diff --git a/Firmware/RTK_Surveyor/menuEthernet.ino b/Firmware/RTK_Surveyor/menuEthernet.ino index 1f1d8b8b1..4cff44f14 100644 --- a/Firmware/RTK_Surveyor/menuEthernet.ino +++ b/Firmware/RTK_Surveyor/menuEthernet.ino @@ -10,14 +10,12 @@ bool ethernetIsNeeded() // Does Base mode NTRIP Server need Ethernet? if (HAS_ETHERNET && settings.enableNtripServer == true && (systemState >= STATE_BASE_NOT_STARTED && systemState <= STATE_BASE_FIXED_TRANSMITTING) - //&& !settings.ntripServerUseWiFiNotEthernet //For future expansion ) return true; // Does Rover mode NTRIP Client need Ethernet? if (HAS_ETHERNET && settings.enableNtripClient == true && (systemState >= STATE_ROVER_NOT_STARTED && systemState <= STATE_ROVER_RTK_FIX) - //&& !settings.ntripClientUseWiFiNotEthernet //For future expansion ) return true; @@ -65,7 +63,7 @@ void beginEthernet() online.ethernetStatus = ETH_STARTED_CHECK_CABLE; lastEthernetCheck = millis(); // Wait a full second before checking the cable - + break; case (ETH_STARTED_CHECK_CABLE): diff --git a/Firmware/RTK_Surveyor/menuGNSS.ino b/Firmware/RTK_Surveyor/menuGNSS.ino index ff4068ea9..189bc0478 100644 --- a/Firmware/RTK_Surveyor/menuGNSS.ino +++ b/Firmware/RTK_Surveyor/menuGNSS.ino @@ -107,14 +107,6 @@ void menuGNSS() settings.minElev); systemPrintf("14) Minimum satellite signal level for navigation (dBHz): %d\r\n", minCNO); - - // For future expansion - // if (HAS_ETHERNET) - //{ - // systemPrintf("15) Use WiFi (not Ethernet) for NTRIP Client: ", menuEntry++); - // if (settings.ntripClientUseWiFiNotEthernet == true) systemPrintln("Enabled"); - // else systemPrintln("Disabled"); - // } } else { @@ -307,12 +299,6 @@ void menuGNSS() restartRover = true; } } - // For future expansion - // else if (incoming == 15 && settings.enableNtripClient == true && HAS_ETHERNET) - //{ - // settings.ntripClientUseWiFiNotEthernet ^= 1; - // restartRover = true; - // } else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT) break; else if (incoming == INPUT_RESPONSE_GETNUMBER_TIMEOUT) diff --git a/Firmware/RTK_Surveyor/settings.h b/Firmware/RTK_Surveyor/settings.h index c37596206..3d3627421 100644 --- a/Firmware/RTK_Surveyor/settings.h +++ b/Firmware/RTK_Surveyor/settings.h @@ -786,34 +786,6 @@ typedef struct int maxLogLength_minutes = 60 * 24; // Default to 24 hours char profileName[50] = ""; - // NTRIP Server - bool enableNtripServer = false; - bool ntripServer_StartAtSurveyIn = false; // true = Start WiFi instead of Bluetooth at Survey-In - char ntripServer_CasterHost[50] = "rtk2go.com"; // It's free... - uint16_t ntripServer_CasterPort = 2101; - char ntripServer_CasterUser[50] = - "test@test.com"; // Some free casters require auth. User must provide their own email address to use RTK2Go - char ntripServer_CasterUserPW[50] = ""; - char ntripServer_MountPoint[50] = "bldr_dwntwn2"; // NTRIP Server - char ntripServer_MountPointPW[50] = "WR5wRo4H"; - // Products that have Ethernet will always use Ethernet for NTRIP Server and Client, unless - // ntripServerUseWiFiNotEthernet is set to true. Setting ntripServerUseWiFiNotEthernet to true will make - // Ethernet-enabled products use WiFi for NTRIP Server instead. bool ntripServerUseWiFiNotEthernet = false; //For - // future expansion - - // NTRIP Client - bool enableNtripClient = false; - char ntripClient_CasterHost[50] = "rtk2go.com"; // It's free... - uint16_t ntripClient_CasterPort = 2101; - char ntripClient_CasterUser[50] = - "test@test.com"; // Some free casters require auth. User must provide their own email address to use RTK2Go - char ntripClient_CasterUserPW[50] = ""; - char ntripClient_MountPoint[50] = "bldr_SparkFun1"; - char ntripClient_MountPointPW[50] = ""; - bool ntripClient_TransmitGGA = true; - // Setting ntripClientUseWiFiNotEthernet to true will make Ethernet-enabled products use WiFi for NTRIP Client - // instead. bool ntripClientUseWiFiNotEthernet = false; //For future expansion - int16_t serialTimeoutGNSS = 1; // In ms - used during SerialGNSS.begin. Number of ms to pass of no data before // hardware serial reports data available. @@ -842,11 +814,7 @@ typedef struct int8_t timeZoneSeconds = 0; // Debug settings - bool enablePrintWifiIpAddress = true; bool enablePrintState = false; - bool enablePrintWifiState = false; - bool enablePrintNtripClientState = false; - bool enablePrintNtripServerState = false; bool enablePrintPosition = false; bool enablePrintIdleTime = false; bool enablePrintBatteryMessages = true; @@ -855,22 +823,15 @@ typedef struct bool enablePrintLogFileMessages = false; bool enablePrintLogFileStatus = true; bool enablePrintRingBufferOffsets = false; - bool enablePrintNtripServerRtcm = false; - bool enablePrintNtripClientRtcm = false; bool enablePrintStates = true; bool enablePrintDuplicateStates = false; bool enablePrintRtcSync = false; - bool enablePrintNTPDiag = false; - bool enablePrintEthernetDiag = false; RadioType_e radioType = RADIO_EXTERNAL; uint8_t espnowPeers[5][6]; // Max of 5 peers. Contains the MAC addresses (6 bytes) of paired units uint8_t espnowPeerCount = 0; bool enableRtcmMessageChecking = false; BluetoothRadioType_e bluetoothRadioType = BLUETOOTH_RADIO_SPP; bool runLogTest = false; // When set to true, device will create a series of test logs - bool enableTcpClient = false; - bool enableTcpServer = false; - bool enablePrintTcpStatus = false; bool espnowBroadcast = true; // When true, overrides peers and sends all data via broadcast int16_t antennaHeight = 0; // in mm float antennaReferencePoint = 0.0; // in mm @@ -883,16 +844,6 @@ typedef struct bool enablePrintSDBuffers = false; bool forceResetOnSDFail = false; // Set to true to reset system if SD is detected but fails to start. - WiFiNetwork wifiNetworks[MAX_WIFI_NETWORKS] = { - {"", ""}, - {"", ""}, - {"", ""}, - {"", ""}, - }; - - bool wifiConfigOverAP = true; // Configure device over Access Point or have it connect to WiFi - uint16_t wifiTcpPort = - 2947; // TCP port to use in Client/Server mode. 2947 is GPS Daemon: http://tcp-udp-ports.com/port-2947.htm uint8_t minElev = 10; // Minimum elevation (in deg) for a GNSS satellite to be used in NAV uint8_t ubxMessageRatesBase[MAX_UBX_MSG_RTCM] = { 254}; // Mark first record with key so defaults will be applied. Int value for each supported message - Report @@ -906,21 +857,52 @@ typedef struct // CFG-SFIMU-AUTO_MNTALG_ENA 0 = autoIMUmountAlignment bool sfUseSpeed = false; // CFG-SFODO-USE_SPEED + CoordinateInputType coordinateInputType = COORDINATE_INPUT_TYPE_DD; // Default DD.ddddddddd + uint16_t lbandFixTimeout_seconds = 180; // Number of seconds of no L-Band fix before resetting ZED + int16_t minCNO_F9P = 6; // Minimum satellite signal level for navigation. ZED-F9P default is 6 dBHz + int16_t minCNO_F9R = 20; // Minimum satellite signal level for navigation. ZED-F9R default is 20 dBHz + uint16_t serialGNSSRxFullThreshold = 50; // RX FIFO full interrupt. Max of ~128. See pinUART2Task(). + uint8_t btReadTaskPriority = 1; // Read from BT SPP and Write to GNSS. 3 being the highest, and 0 being the lowest + uint8_t gnssReadTaskPriority = + 1; // Read from ZED-F9x and Write to circular buffer (SD, TCP, BT). 3 being the highest, and 0 being the lowest + uint8_t handleGnssDataTaskPriority = 1; // Read from the cicular buffer and dole out to end points (SD, TCP, BT). + uint8_t btReadTaskCore = 1; // Core where task should run, 0=core, 1=Arduino + uint8_t gnssReadTaskCore = 1; // Core where task should run, 0=core, 1=Arduino + uint8_t handleGnssDataTaskCore = 1; // Core where task should run, 0=core, 1=Arduino + uint8_t gnssUartInterruptsCore = + 1; // Core where hardware is started and interrupts are assigned to, 0=core, 1=Arduino + uint8_t bluetoothInterruptsCore = 1; // Core where hardware is started and interrupts are assigned to, 0=core, 1=Arduino + uint8_t i2cInterruptsCore = 1; // Core where hardware is started and interrupts are assigned to, 0=core, 1=Arduino + // Ethernet + bool enablePrintEthernetDiag = false; + bool ethernetDHCP = true; IPAddress ethernetIP = {192, 168, 0, 123}; IPAddress ethernetDNS = {194, 168, 4, 100}; IPAddress ethernetGateway = {192, 168, 0, 1}; IPAddress ethernetSubnet = {255, 255, 255, 0}; uint16_t ethernetHttpPort = 80; - uint16_t ethernetNtpPort = 123; - bool ethernetDHCP = true; - bool enableNTPFile = false; // Log NTP requests to file - bool enableTcpClientEthernet = false; - uint16_t ethernetTcpPort = - 2947; // TCP port to use in Client mode. 2947 is GPS Daemon: http://tcp-udp-ports.com/port-2947.htm - char hostForTCPClient[50] = ""; + + // WiFi + bool enablePrintWifiIpAddress = true; + bool enablePrintWifiState = false; + bool wifiConfigOverAP = true; // Configure device over Access Point or have it connect to WiFi + uint16_t wifiTcpPort = + 2947; // TCP port to use in Client/Server mode. 2947 is GPS Daemon: http://tcp-udp-ports.com/port-2947.htm + WiFiNetwork wifiNetworks[MAX_WIFI_NETWORKS] = { + {"", ""}, + {"", ""}, + {"", ""}, + {"", ""}, + }; + + // Multicast DNS Server + bool mdnsEnable = true; // Allows locating of device from browser address 'rtk.local' // NTP + uint16_t ethernetNtpPort = 123; + bool enableNTPFile = false; // Log NTP requests to file + bool enablePrintNTPDiag = false; uint8_t ntpPollExponent = 6; // NTPpacket::defaultPollExponent 2^6 = 64 seconds int8_t ntpPrecision = -20; // NTPpacket::defaultPrecision 2^-20 = 0.95us uint32_t ntpRootDelay = 0; // NTPpacket::defaultRootDelay = 0. ntpRootDelay is defined in microseconds. @@ -931,24 +913,42 @@ typedef struct char ntpReferenceId[5] = {'G', 'P', 'S', 0, 0}; // NTPpacket::defaultReferenceId. Ref ID is 4 chars. Add one extra for a NULL. - CoordinateInputType coordinateInputType = COORDINATE_INPUT_TYPE_DD; // Default DD.ddddddddd - uint16_t lbandFixTimeout_seconds = 180; // Number of seconds of no L-Band fix before resetting ZED - int16_t minCNO_F9P = 6; // Minimum satellite signal level for navigation. ZED-F9P default is 6 dBHz - int16_t minCNO_F9R = 20; // Minimum satellite signal level for navigation. ZED-F9R default is 20 dBHz - bool mdnsEnable = true; // Allows locating of device from browser address 'rtk.local' - uint16_t serialGNSSRxFullThreshold = 50; // RX FIFO full interrupt. Max of ~128. See pinUART2Task(). - uint8_t btReadTaskPriority = 1; // Read from BT SPP and Write to GNSS. 3 being the highest, and 0 being the lowest - uint8_t gnssReadTaskPriority = - 1; // Read from ZED-F9x and Write to circular buffer (SD, TCP, BT). 3 being the highest, and 0 being the lowest - uint8_t handleGnssDataTaskPriority = 1; // Read from the cicular buffer and dole out to end points (SD, TCP, BT). - uint8_t btReadTaskCore = 1; // Core where task should run, 0=core, 1=Arduino - uint8_t gnssReadTaskCore = 1; // Core where task should run, 0=core, 1=Arduino - uint8_t handleGnssDataTaskCore = 1; // Core where task should run, 0=core, 1=Arduino - uint8_t gnssUartInterruptsCore = - 1; // Core where hardware is started and interrupts are assigned to, 0=core, 1=Arduino - uint8_t bluetoothInterruptsCore = 1; // Core where hardware is started and interrupts are assigned to, 0=core, 1=Arduino - uint8_t i2cInterruptsCore = 1; // Core where hardware is started and interrupts are assigned to, 0=core, 1=Arduino + // NTRIP Client + bool enablePrintNtripClientRtcm = false; + bool enablePrintNtripClientState = false; + bool enableNtripClient = false; + char ntripClient_CasterHost[50] = "rtk2go.com"; // It's free... + uint16_t ntripClient_CasterPort = 2101; + char ntripClient_CasterUser[50] = + "test@test.com"; // Some free casters require auth. User must provide their own email address to use RTK2Go + char ntripClient_CasterUserPW[50] = ""; + char ntripClient_MountPoint[50] = "bldr_SparkFun1"; + char ntripClient_MountPointPW[50] = ""; + bool ntripClient_TransmitGGA = true; + // NTRIP Server + bool enablePrintNtripServerRtcm = false; + bool enablePrintNtripServerState = false; + bool enableNtripServer = false; + bool ntripServer_StartAtSurveyIn = false; // true = Start WiFi instead of Bluetooth at Survey-In + char ntripServer_CasterHost[50] = "rtk2go.com"; // It's free... + uint16_t ntripServer_CasterPort = 2101; + char ntripServer_CasterUser[50] = + "test@test.com"; // Some free casters require auth. User must provide their own email address to use RTK2Go + char ntripServer_CasterUserPW[50] = ""; + char ntripServer_MountPoint[50] = "bldr_dwntwn2"; // NTRIP Server + char ntripServer_MountPointPW[50] = "WR5wRo4H"; + + // TCP Client + bool enablePrintTcpStatus = false; + bool enableTcpClient = false; + bool enableTcpClientEthernet = false; + uint16_t ethernetTcpPort = + 2947; // TCP port to use in Client mode. 2947 is GPS Daemon: http://tcp-udp-ports.com/port-2947.htm + char hostForTCPClient[50] = ""; + + // TCP Server + bool enableTcpServer = false; } Settings; Settings settings;