Skip to content

Commit 7251e91

Browse files
committed
Fix web config tcpClient and tcpServer. Delete httpPort from Ethernet config
1 parent 0bb0c5e commit 7251e91

File tree

5 files changed

+1800
-1747
lines changed

5 files changed

+1800
-1747
lines changed

Firmware/RTK_Everywhere/AP-Config/index.html

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,33 +1387,55 @@
13871387
<div class="form-check mt-3">
13881388
<label class="form-check-label" for="enableTcpClient">TCP Client</label>
13891389
<input class="form-check-input" type="checkbox" value="" id="enableTcpClient"
1390-
onClick="tcpBoxes()">
1390+
onClick="tcpClientBoxes()">
13911391
<span class="tt" data-bs-placement="right"
1392-
title="If enabled, device will connect to WiFi and push NMEA over the given TCP port.">
1392+
title="If enabled, device will connect to WiFi and push NMEA to the given TCP server over the given port.">
13931393
<span class="icon-info-circle text-primary ms-2"></span>
13941394
</span>
13951395
</div>
1396+
<div id="tcpClientConfig">
1397+
<div class="form-group row">
1398+
<label for="tcpClientPort" class="box-margin20 col-sm-3 col-4 col-form-label">Port:
1399+
<span class="tt" data-bs-placement="right" title="TCP port to use. Default: 2948">
1400+
<span class="icon-info-circle text-primary ms-2"></span>
1401+
</span>
1402+
</label>
1403+
<div class="col-sm-8 col-7">
1404+
<input type="text" class="form-control" id="tcpClientPort">
1405+
<p id="tcpClientPortError" class="inlineError"></p>
1406+
</div>
1407+
</div>
1408+
<div class="form-group row">
1409+
<label for="tcpClientHost" class="box-margin20 col-sm-3 col-4 col-form-label">Host for
1410+
TCP Client:
1411+
<span class="tt" data-bs-placement="right"
1412+
title="The name or address of the host which the TCP client data will be pushed to.">
1413+
<span class="icon-info-circle text-primary ms-2"></span>
1414+
</span>
1415+
</label>
1416+
<div class="col-sm-5">
1417+
<input type="text" class="form-control" id="tcpClientHost" value="test">
1418+
<p id="tcpClientHostError" class="inlineError"></p>
1419+
</div>
1420+
</div>
1421+
</div>
13961422
<div class="form-group row">
13971423
<p id="enableTcpClientError" class="inlineError"></p>
13981424
</div>
13991425

14001426
<div class="form-check mt-3">
14011427
<label class="form-check-label" for="enableTcpServer">TCP Server</label>
14021428
<input class="form-check-input" type="checkbox" value="" id="enableTcpServer"
1403-
onClick="tcpBoxes()">
1429+
onClick="tcpServerBoxes()">
14041430
<span class="tt" data-bs-placement="right"
1405-
title="If enabled, device will allow inbound TCP connections and push NMEA when a client is connected.">
1431+
title="If enabled, device will allow inbound TCP connections and push NMEA over the given port when a client is connected.">
14061432
<span class="icon-info-circle text-primary ms-2"></span>
14071433
</span>
14081434
</div>
1409-
<div class="form-group row">
1410-
<p id="enableTcpServerError" class="inlineError"></p>
1411-
</div>
1412-
1413-
<div id="tcpSettingsConfig">
1435+
<div id="tcpServerConfig">
14141436
<div class="form-group row">
14151437
<label for="tcpServerPort" class="box-margin20 col-sm-3 col-4 col-form-label">Port:
1416-
<span class="tt" data-bs-placement="right" title="TCP port to use. Default: 2947">
1438+
<span class="tt" data-bs-placement="right" title="TCP port to use. Default: 2948">
14171439
<span class="icon-info-circle text-primary ms-2"></span>
14181440
</span>
14191441
</label>
@@ -1423,20 +1445,19 @@
14231445
</div>
14241446
</div>
14251447
</div>
1448+
<div class="form-group row">
1449+
<p id="enableTcpServerError" class="inlineError"></p>
1450+
</div>
14261451

14271452
<div class="form-check mt-3">
14281453
<label class="form-check-label" for="enableUdpServer">UDP Server</label>
14291454
<input class="form-check-input" type="checkbox" value="" id="enableUdpServer"
14301455
onClick="udpBoxes()">
14311456
<span class="tt" data-bs-placement="right"
1432-
title="If enabled, device will broadcast NMEA sentences over UPD">
1457+
title="If enabled, device will broadcast NMEA sentences over UDP">
14331458
<span class="icon-info-circle text-primary ms-2"></span>
14341459
</span>
14351460
</div>
1436-
<div class="form-group row">
1437-
<p id="enableUdpServerError" class="inlineError"></p>
1438-
</div>
1439-
14401461
<div id="udpSettingsConfig">
14411462
<div class="form-group row">
14421463
<label for="udpServerPort" class="box-margin20 col-sm-3 col-4 col-form-label">Port:
@@ -1450,6 +1471,10 @@
14501471
</div>
14511472
</div>
14521473
</div>
1474+
<div class="form-group row">
1475+
<p id="enableUdpServerError" class="inlineError"></p>
1476+
</div>
1477+
14531478

14541479
<div id="wifiConfigTypeDropdown" class="mt-3">
14551480
<label for="wifiConfigOverAP">Configure Mode: </label>
@@ -1876,17 +1901,6 @@
18761901

18771902
<br>
18781903

1879-
<div class="form-group row">
1880-
<label for="httpPort" class="col-5 col-form-label">Ethernet HTTP Port:
1881-
<span class="tt" data-bs-placement="right" title="Ethernet HTTP Port. Default is 80">
1882-
<span class="icon-info-circle text-primary ms-2"></span>
1883-
</span>
1884-
</label>
1885-
<div class="col-sm-5">
1886-
<input type="number" class="form-control" id="httpPort">
1887-
<p id="httpPortError" class="inlineError"></p>
1888-
</div>
1889-
</div>
18901904
<div class="form-group row">
18911905
<label for="ethernetNtpPort" class="col-5 col-form-label">Ethernet NTP Port:
18921906
<span class="tt" data-bs-placement="right" title="Ethernet NTP Port. Default is 123">

Firmware/RTK_Everywhere/AP-Config/src/main.js

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ function parseIncoming(msg) {
438438

439439
updateECEFList();
440440
updateGeodeticList();
441-
tcpBoxes();
441+
tcpClientBoxes();
442+
tcpServerBoxes();
442443
udpBoxes();
443444
dhcpEthernet();
444445
updateLatLong();
@@ -688,13 +689,18 @@ function validateFields() {
688689
checkElementString("wifiNetwork_2Password", 0, 50, "Must be 0 to 50 characters", "collapseWiFiConfig");
689690
checkElementString("wifiNetwork_3SSID", 0, 50, "Must be 0 to 50 characters", "collapseWiFiConfig");
690691
checkElementString("wifiNetwork_3Password", 0, 50, "Must be 0 to 50 characters", "collapseWiFiConfig");
691-
if ((ge("enableTcpClient").checked == true) || (ge("enableTcpServer").checked == true)) {
692+
if (ge("enableTcpClient").checked == true) {
693+
checkElementString("tcpClientPort", 1, 65535, "Must be 1 to 65535", "collapseWiFiConfig");
694+
}
695+
if (ge("enableTcpServer").checked == true) {
692696
checkElementString("tcpServerPort", 1, 65535, "Must be 1 to 65535", "collapseWiFiConfig");
693697
}
694698
if (ge("enableUdpServer").checked == true) {
695699
checkElementString("udpServerPort", 1, 65535, "Must be 1 to 65535", "collapseWiFiConfig");
696700
}
697-
checkCheckboxMutex("enableTcpClient", "enableTcpServer", "TCP Client and Server can not be enabled at the same time", "collapseWiFiConfig");
701+
//On Ethernet, TCP Client and Server can not be enabled at the same time
702+
//But, on WiFi, they can be...
703+
//checkCheckboxMutex("enableTcpClient", "enableTcpServer", "TCP Client and Server can not be enabled at the same time", "collapseWiFiConfig");
698704

699705
//System Config
700706
if (ge("enableLogging").checked == true) {
@@ -715,22 +721,11 @@ function validateFields() {
715721

716722
//Ethernet
717723
if (platformPrefix == "EVK") {
718-
//if (ge("ethernetDHCP").checked == false) {
719724
checkElementIPAddress("ethernetIP", "Must be nnn.nnn.nnn.nnn", "collapseEthernetConfig");
720725
checkElementIPAddress("ethernetDNS", "Must be nnn.nnn.nnn.nnn", "collapseEthernetConfig");
721726
checkElementIPAddress("ethernetGateway", "Must be nnn.nnn.nnn.nnn", "collapseEthernetConfig");
722727
checkElementIPAddress("ethernetSubnet", "Must be nnn.nnn.nnn.nnn", "collapseEthernetConfig");
723-
checkElementValue("httpPort", 0, 65535, "Must be 0 to 65535", "collapseEthernetConfig");
724728
checkElementValue("ethernetNtpPort", 0, 65535, "Must be 0 to 65535", "collapseEthernetConfig");
725-
//}
726-
//else {
727-
// clearElement("ethernetIP", "192.168.0.123");
728-
// clearElement("ethernetDNS", "192.168.4.100");
729-
// clearElement("ethernetGateway", "192.168.0.1");
730-
// clearElement("ethernetSubnet", "255.255.255.0");
731-
// clearElement("httpPort", 80);
732-
// clearElement("ethernetNtpPort", 123);
733-
//}
734729
}
735730

736731
//NTP
@@ -1789,13 +1784,23 @@ function abortHandler(event) {
17891784
ge("uploadStatus").innerHTML = "Upload Aborted";
17901785
}
17911786

1792-
function tcpBoxes() {
1793-
if ((ge("enableTcpServer").checked == true) || (ge("enableTcpClient").checked == true)) {
1794-
show("tcpSettingsConfig");
1787+
function tcpClientBoxes() {
1788+
if (ge("enableTcpClient").checked == true) {
1789+
show("tcpClientConfig");
1790+
}
1791+
else {
1792+
hide("tcpClientConfig");
1793+
ge("tcpClientPort").value = 2948;
1794+
}
1795+
}
1796+
1797+
function tcpServerBoxes() {
1798+
if (ge("enableTcpServer").checked == true) {
1799+
show("tcpServerConfig");
17951800
}
17961801
else {
1797-
hide("tcpSettingsConfig");
1798-
ge("tcpServerPort").value = 2947;
1802+
hide("tcpServerConfig");
1803+
ge("tcpServerPort").value = 2948;
17991804
}
18001805
}
18011806

Firmware/RTK_Everywhere/Network.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void menuTcpUdp()
214214
systemPrintf("1) TCP Client: %s\r\n", settings.enableTcpClient ? "Enabled" : "Disabled");
215215
if (settings.enableTcpClient)
216216
{
217-
systemPrintf("2) TCP Client Host: %s\r\n", settings.tcpClientHost);
217+
systemPrintf("2) Host for TCP Client: %s\r\n", settings.tcpClientHost);
218218
systemPrintf("3) TCP Client Port: %ld\r\n", settings.tcpClientPort);
219219
}
220220

0 commit comments

Comments
 (0)