Skip to content

Commit 7aa111d

Browse files
committed
Merge branch 'release_candidate' of https://github.com/sparkfun/SparkFun_RTK_Everywhere_Firmware into release_candidate
2 parents 0357942 + 75c6983 commit 7aa111d

File tree

7 files changed

+1834
-1798
lines changed

7 files changed

+1834
-1798
lines changed

Firmware/RTK_Everywhere/AP-Config/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@
806806
<button class="btn btn-md btn-outline-primary mt-3 toggle-btn"
807807
type="button" data-toggle="collapse" data-target="#ntripServerConfig0"
808808
aria-expanded="false" aria-controls="ntripServerConfig0">
809-
NTRIP Server 0 <i class="caret-icon bi icon-caret-down"></i>
809+
NTRIP Server 1 <i class="caret-icon bi icon-caret-down"></i>
810810
</button>
811811
</div>
812812

@@ -879,7 +879,7 @@
879879
<button class="btn btn-md btn-outline-primary mt-3 toggle-btn"
880880
type="button" data-toggle="collapse" data-target="#ntripServerConfig1"
881881
aria-expanded="false" aria-controls="ntripServerConfig1">
882-
NTRIP Server 1 <i class="caret-icon bi icon-caret-down"></i>
882+
NTRIP Server 2 <i class="caret-icon bi icon-caret-down"></i>
883883
</button>
884884
</div>
885885

@@ -952,7 +952,7 @@
952952
<button class="btn btn-md btn-outline-primary mt-3 toggle-btn"
953953
type="button" data-toggle="collapse" data-target="#ntripServerConfig2"
954954
aria-expanded="false" aria-controls="ntripServerConfig2">
955-
NTRIP Server 2 <i class="caret-icon bi icon-caret-down"></i>
955+
NTRIP Server 3 <i class="caret-icon bi icon-caret-down"></i>
956956
</button>
957957
</div>
958958

@@ -1025,7 +1025,7 @@
10251025
<button class="btn btn-md btn-outline-primary mt-3 toggle-btn"
10261026
type="button" data-toggle="collapse" data-target="#ntripServerConfig3"
10271027
aria-expanded="false" aria-controls="ntripServerConfig3">
1028-
NTRIP Server 3 <i class="caret-icon bi icon-caret-down"></i>
1028+
NTRIP Server 4 <i class="caret-icon bi icon-caret-down"></i>
10291029
</button>
10301030
</div>
10311031

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ function sendData() {
481481
//Check boxes, radio buttons
482482
//Remove file manager files
483483
clsElements = document.querySelectorAll(".form-check-input:not(.fileManagerCheck), .form-radio");
484-
485484
for (let x = 0; x < clsElements.length; x++) {
486485
settingCSV += clsElements[x].id + "," + clsElements[x].checked + ",";
487486
}

Firmware/RTK_Everywhere/Display.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2060,6 +2060,10 @@ void displayWiFiConfig()
20602060
else if (WiFi.getMode() == WIFI_AP)
20612061
snprintf(mySSID, sizeof(mySSID), "%s", "RTK Config");
20622062

2063+
// If we are in AP+STA mode, still display RTK Config
2064+
else if (WiFi.getMode() == WIFI_AP_STA)
2065+
snprintf(mySSID, sizeof(mySSID), "%s", "RTK Config");
2066+
20632067
else
20642068
snprintf(mySSID, sizeof(mySSID), "%s", "Error");
20652069
}
@@ -2093,7 +2097,7 @@ void displayWiFiConfig()
20932097

20942098
#ifdef COMPILE_AP
20952099
IPAddress myIpAddress;
2096-
if (WiFi.getMode() == WIFI_AP)
2100+
if ((WiFi.getMode() == WIFI_AP) || (WiFi.getMode() == WIFI_AP_STA))
20972101
myIpAddress = WiFi.softAPIP();
20982102
else
20992103
myIpAddress = WiFi.localIP();

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ void wifiUpdate()
388388
break;
389389
}
390390

391-
// Process DNS when we are in AP mode for captive portal
392-
if (WiFi.getMode() == WIFI_AP && settings.enableCaptivePortal)
391+
// Process DNS when we are in AP mode or AP+STA mode for captive portal
392+
if (((WiFi.getMode() == WIFI_AP) || (WiFi.getMode() == WIFI_AP_STA)) && settings.enableCaptivePortal)
393393
{
394394
dnsServer.processNextRequest();
395395
}
@@ -435,7 +435,7 @@ void wifiStop()
435435
MDNS.end();
436436

437437
// Stop the DNS server if we were using the captive portal
438-
if (WiFi.getMode() == WIFI_AP && settings.enableCaptivePortal)
438+
if (((WiFi.getMode() == WIFI_AP) || (WiFi.getMode() == WIFI_AP_STA)) && settings.enableCaptivePortal)
439439
dnsServer.stop();
440440

441441
// Stop the other network clients and then WiFi
@@ -486,16 +486,40 @@ bool wifiIsConnected()
486486
// Attempts a connection to all provided SSIDs
487487
// Returns true if successful
488488
// Gives up if no SSID detected or connection times out
489+
// If useAPSTAMode is true, do an extra check and go from WIFI_AP mode to WIFI_AP_STA mode
489490
bool wifiConnect(unsigned long timeout)
491+
{
492+
return wifiConnect(timeout, false, nullptr);
493+
}
494+
bool wifiConnect(unsigned long timeout, bool useAPSTAMode, bool *wasInAPmode)
490495
{
491496
if (wifiIsConnected())
492497
return (true); // Nothing to do
493498

494499
displayWiFiConnect();
495500

496-
// Before we can issue esp_wifi_() commands WiFi must be started
497-
if (WiFi.getMode() != WIFI_STA)
498-
WiFi.mode(WIFI_STA);
501+
// If otaUpdate or otaCheckVersion wants to use WIFI_AP_STA mode
502+
if (useAPSTAMode && (wasInAPmode != nullptr))
503+
{
504+
*wasInAPmode = (WiFi.getMode() == WIFI_AP);
505+
506+
if (*wasInAPmode)
507+
{
508+
systemPrintln("wifiConnect: changing from WIFI_AP to WIFI_AP_STA");
509+
WiFi.mode(WIFI_AP_STA); // Change mode from WIFI_AP to WIFI_AP_STA
510+
}
511+
else
512+
{
513+
systemPrintln("wifiConnect: was not in WIFI_AP mode. Going to WIFI_STA");
514+
WiFi.mode(WIFI_STA); // Must have been off - or already in STA mode?
515+
}
516+
}
517+
else
518+
{
519+
// Before we can issue esp_wifi_() commands WiFi must be started
520+
if (WiFi.getMode() != WIFI_STA)
521+
WiFi.mode(WIFI_STA);
522+
}
499523

500524
// Verify that the necessary protocols are set
501525
uint8_t protocols = 0;

0 commit comments

Comments
 (0)