Skip to content

Commit 8c9a1b0

Browse files
committed
Add debug to the caller of wifiStart()
1 parent d1b6202 commit 8c9a1b0

File tree

8 files changed

+17
-8
lines changed

8 files changed

+17
-8
lines changed

Firmware/RTK_Surveyor/ESPNOW.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void espnowStart()
9696
esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_LR); //Stops WiFi Station.
9797

9898
WiFi.mode(WIFI_STA);
99-
99+
100100
log_d("WiFi off, ESP-Now added to protocols");
101101
}
102102
//If WiFi is on but ESP NOW is off, then enable LR protocol
@@ -211,6 +211,7 @@ void espnowStop()
211211
//If WiFi is on, then restart WiFi
212212
else if (wifiState > WIFI_OFF)
213213
{
214+
log_d("ESP-Now starting WiFi");
214215
wifiStart(); //Force WiFi to restart
215216
}
216217

Firmware/RTK_Surveyor/Form.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ void startWebServer()
88
#ifdef COMPILE_AP
99

1010
ntripClientStop(true); //Do not allocate new wifiClient
11-
wifiStartAP(); //Exits calling wifiConnect()
11+
ntripServerStop(true); //Do not allocate new wifiClient
12+
13+
if (wifiStartAP() == false) //Exits calling wifiConnect()
14+
return;
1215

1316
incomingSettings = (char*)malloc(AP_CONFIG_SETTING_SIZE);
1417

@@ -147,7 +150,6 @@ void startWebServer()
147150

148151
#endif //COMPILE_AP
149152
#endif //COMPILE_WIFI
150-
151153
}
152154

153155
void stopWebServer()

Firmware/RTK_Surveyor/NtripClient.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ void ntripClientUpdate()
345345
if (millis() - ntripClientLastConnectionAttempt > ntripClientConnectionAttemptTimeout)
346346
{
347347
ntripClientLastConnectionAttempt = millis();
348+
log_d("NTRIP Client starting WiFi");
348349
wifiStart();
349350
ntripClientSetState(NTRIP_CLIENT_WIFI_STARTED);
350351
}

Firmware/RTK_Surveyor/NtripServer.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ void ntripServerUpdate()
364364
if (millis() - ntripServerLastConnectionAttempt > ntripServerConnectionAttemptTimeout)
365365
{
366366
ntripServerLastConnectionAttempt = millis();
367+
log_d("NTRIP Server starting WiFi");
367368
wifiStart();
368369
ntripServerSetState(NTRIP_SERVER_WIFI_STARTED);
369370
}

Firmware/RTK_Surveyor/States.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ void updateSystemState()
693693
//If we don't have keys, begin zero touch provisioning
694694
else if (strlen(settings.pointPerfectCurrentKey) == 0 || strlen(settings.pointPerfectNextKey) == 0)
695695
{
696+
log_d("L_Band Keys starting WiFi");
696697
wifiStart();
697698
changeState(STATE_KEYS_PROVISION_WIFI_STARTED);
698699
}
@@ -727,6 +728,7 @@ void updateSystemState()
727728

728729
if (online.rtc == false)
729730
{
731+
log_d("Keys Needed RTC off starting WiFi");
730732
wifiStart();
731733
changeState(STATE_KEYS_WIFI_STARTED); //If we can't check the RTC, continue
732734
}
@@ -737,6 +739,7 @@ void updateSystemState()
737739
settings.lastKeyAttempt = rtc.getEpoch(); //Mark it
738740
recordSystemSettings(); //Record these settings to unit
739741

742+
log_d("Keys Needed starting WiFi");
740743
wifiStart(); //Starts WiFi state machine
741744
changeState(STATE_KEYS_WIFI_STARTED);
742745
}

Firmware/RTK_Surveyor/WiFi.ino

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ bool wifiStartAP()
159159
else
160160
{
161161
//Start webserver on local WiFi instead of AP
162+
log_d("WiFi Config starting WiFi");
162163
wifiStart(); //Makes sure any ESP-Now settings have been cleared
163164

164165
//Attempt to connect to local WiFi with increasing timeouts
@@ -583,11 +584,6 @@ bool wifiConnectLimitReached()
583584
{
584585
wifiConnectionAttemptTimeout = wifiConnectionAttempts * 15 * 1000L; //Wait 15, 30, 45, etc seconds between attempts
585586

586-
if (wifiConnectionAttemptTimeout / 1000 < 120)
587-
systemPrintf("WiFi failed to connect. Trying again in %d seconds.\r\n", wifiConnectionAttemptTimeout / 1000);
588-
else
589-
systemPrintf("WiFi failed to connect. Trying again in %d minutes.\r\n", wifiConnectionAttemptTimeout / 1000 / 60);
590-
591587
reportHeapNow();
592588
}
593589
else
@@ -614,6 +610,7 @@ void tcpUpdate()
614610
while (true) ; //Freeze
615611
}
616612

613+
log_d("tpcUpdate starting WiFi");
617614
wifiStart();
618615
}
619616

Firmware/RTK_Surveyor/menuFirmware.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ void menuFirmware()
4747
{
4848
bool previouslyConnected = wifiIsConnected();
4949

50+
log_d("Firmware version Check starting WiFi");
5051
wifiStart(); //Makes sure any ESP-Now settings have been cleared
5152

5253
//Attempt to connect to local WiFi
@@ -348,6 +349,7 @@ bool otaCheckVersion(char *versionAvailable, uint8_t versionAvailableLength)
348349
#ifdef COMPILE_WIFI
349350
bool previouslyConnected = wifiIsConnected();
350351

352+
log_d("OTA Check Version starting WiFi");
351353
wifiStart(); //Makes sure any ESP-Now settings have been cleared
352354

353355
if (wifiConnect(10000) == true)
@@ -420,6 +422,7 @@ void otaUpdate()
420422
#ifdef COMPILE_WIFI
421423
bool previouslyConnected = wifiIsConnected();
422424

425+
log_d("OTA Update starting WiFi");
423426
wifiStart(); //Makes sure any ESP-Now settings have been cleared
424427

425428
if (wifiConnect(10000) == true)

Firmware/RTK_Surveyor/menuPP.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ void menuPointPerfect()
979979
}
980980
else
981981
{
982+
log_d("L-Band Keys update starting WiFi");
982983
wifiStart();
983984

984985
if (wifiConnect(10000) == true)

0 commit comments

Comments
 (0)