@@ -104,7 +104,7 @@ bool startWebServer(bool startWiFi = true, int httpPort = 80)
104104 break ;
105105 }
106106
107- if (settings.enableCaptivePortal == true )
107+ if (settings.enableCaptivePortal == true )
108108 webserver->addHandler (new CaptiveRequestHandler ()).setFilter (ON_AP_FILTER); // only when requested from AP
109109
110110 websocket->onEvent (onWsEvent);
@@ -322,7 +322,8 @@ bool startWebServer(bool startWiFi = true, int httpPort = 80)
322322
323323 webserver->begin ();
324324
325- log_d (" Web Server Started" );
325+ if (settings.debugWiFiConfig == true )
326+ systemPrintln (" Web Server Started" );
326327 reportHeapNow (false );
327328 return true ;
328329 } while (0 );
@@ -359,7 +360,8 @@ void stopWebServer()
359360 incomingSettings = nullptr ;
360361 }
361362
362- log_d (" Web Server Stopped" );
363+ if (settings.debugWiFiConfig == true )
364+ systemPrintln (" Web Server Stopped" );
363365 reportHeapNow (false );
364366}
365367
@@ -585,14 +587,16 @@ void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventTyp
585587{
586588 if (type == WS_EVT_CONNECT)
587589 {
588- log_d (" Websocket client connected" );
590+ if (settings.debugWiFiConfig == true )
591+ systemPrintln (" Websocket client connected" );
589592 client->text (settingsCSV);
590593 lastDynamicDataUpdate = millis ();
591594 websocketConnected = true ;
592595 }
593596 else if (type == WS_EVT_DISCONNECT)
594597 {
595- log_d (" Websocket client disconnected" );
598+ if (settings.debugWiFiConfig == true )
599+ systemPrintln (" Websocket client disconnected" );
596600
597601 // User has either refreshed the page or disconnected. Recompile the current settings.
598602 createSettingsString (settingsCSV);
@@ -611,7 +615,10 @@ void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventTyp
611615 }
612616 }
613617 else
614- log_d (" onWsEvent: unrecognised AwsEventType %d" , type);
618+ {
619+ if (settings.debugWiFiConfig == true )
620+ systemPrintf (" onWsEvent: unrecognised AwsEventType %d\r\n " , type);
621+ }
615622}
616623// Create a csv string with current settings
617624void createSettingsString (char *newSettings)
@@ -944,7 +951,10 @@ void createSettingsString(char *newSettings)
944951 true ) // fileName, lineNumber, array, arraySize
945952 {
946953 trim (stationInfo); // Remove trailing whitespace
947- // log_d("ECEF SD station %d - found: %s", index, stationInfo);
954+
955+ if (settings.debugWiFiConfig == true )
956+ systemPrintf (" ECEF SD station %d - found: %s\r\n " , index, stationInfo);
957+
948958 replaceCharacter (stationInfo, ' ,' , ' ' ); // Change all , to ' ' for easier parsing on the JS side
949959 snprintf (tagText, sizeof (tagText), " stationECEF%d" , index);
950960 stringRecord (newSettings, tagText, stationInfo);
@@ -953,7 +963,10 @@ void createSettingsString(char *newSettings)
953963 true ) // fileName, lineNumber, array, arraySize
954964 {
955965 trim (stationInfo); // Remove trailing whitespace
956- // log_d("ECEF LFS station %d - found: %s", index, stationInfo);
966+
967+ if (settings.debugWiFiConfig == true )
968+ systemPrintf (" ECEF LFS station %d - found: %s\r\n " , index, stationInfo);
969+
957970 replaceCharacter (stationInfo, ' ,' , ' ' ); // Change all , to ' ' for easier parsing on the JS side
958971 snprintf (tagText, sizeof (tagText), " stationECEF%d" , index);
959972 stringRecord (newSettings, tagText, stationInfo);
@@ -975,7 +988,10 @@ void createSettingsString(char *newSettings)
975988 true ) // fileName, lineNumber, array, arraySize
976989 {
977990 trim (stationInfo); // Remove trailing whitespace
978- // log_d("Geo SD station %d - found: %s", index, stationInfo);
991+
992+ if (settings.debugWiFiConfig == true )
993+ systemPrintf (" Geo SD station %d - found: %s\r\n " , index, stationInfo);
994+
979995 replaceCharacter (stationInfo, ' ,' , ' ' ); // Change all , to ' ' for easier parsing on the JS side
980996 snprintf (tagText, sizeof (tagText), " stationGeodetic%d" , index);
981997 stringRecord (newSettings, tagText, stationInfo);
@@ -984,7 +1000,10 @@ void createSettingsString(char *newSettings)
9841000 true ) // fileName, lineNumber, array, arraySize
9851001 {
9861002 trim (stationInfo); // Remove trailing whitespace
987- // log_d("Geo LFS station %d - found: %s", index, stationInfo);
1003+
1004+ if (settings.debugWiFiConfig == true )
1005+ systemPrintf (" Geo LFS station %d - found: %s\r\n " , index, stationInfo);
1006+
9881007 replaceCharacter (stationInfo, ' ,' , ' ' ); // Change all , to ' ' for easier parsing on the JS side
9891008 snprintf (tagText, sizeof (tagText), " stationGeodetic%d" , index);
9901009 stringRecord (newSettings, tagText, stationInfo);
@@ -1107,7 +1126,8 @@ void updateSettingWithValue(const char *settingName, const char *settingValueStr
11071126 // This is one of the first settings to be received. If seen, remove the station files.
11081127 removeFile (stationCoordinateECEFFileName);
11091128 removeFile (stationCoordinateGeodeticFileName);
1110- log_d (" Station coordinate files removed" );
1129+ if (settings.debugWiFiConfig == true )
1130+ systemPrintln (" Station coordinate files removed" );
11111131 }
11121132 else if (strcmp (settingName, " dynamicModel" ) == 0 )
11131133 settings.dynamicModel = settingValue;
@@ -1251,14 +1271,16 @@ void updateSettingWithValue(const char *settingName, const char *settingValueStr
12511271 replaceCharacter ((char *)settingValueStr, ' ' , ' ,' ); // Replace all ' ' with ',' before recording to file
12521272 recordLineToSD (stationCoordinateECEFFileName, settingValueStr);
12531273 recordLineToLFS (stationCoordinateECEFFileName, settingValueStr);
1254- log_d (" %s recorded" , settingValueStr);
1274+ if (settings.debugWiFiConfig == true )
1275+ systemPrintf (" %s recorded\r\n " , settingValueStr);
12551276 }
12561277 else if (strstr (settingName, " stationGeodetic" ) != nullptr )
12571278 {
12581279 replaceCharacter ((char *)settingValueStr, ' ' , ' ,' ); // Replace all ' ' with ',' before recording to file
12591280 recordLineToSD (stationCoordinateGeodeticFileName, settingValueStr);
12601281 recordLineToLFS (stationCoordinateGeodeticFileName, settingValueStr);
1261- log_d (" %s recorded" , settingValueStr);
1282+ if (settings.debugWiFiConfig == true )
1283+ systemPrintf (" %s recorded\r\n " , settingValueStr);
12621284 }
12631285 else if (strcmp (settingName, " pvtServerPort" ) == 0 )
12641286 settings.pvtServerPort = settingValue;
@@ -1418,7 +1440,9 @@ void updateSettingWithValue(const char *settingName, const char *settingValueStr
14181440 else if (strcmp (settingName, " exitAndReset" ) == 0 )
14191441 {
14201442 // Confirm receipt
1421- log_d (" Sending reset confirmation" );
1443+ if (settings.debugWiFiConfig == true )
1444+ systemPrintln (" Sending reset confirmation" );
1445+
14221446 websocket->textAll (" confirmReset,1," );
14231447 delay (500 ); // Allow for delivery
14241448
@@ -1448,7 +1472,8 @@ void updateSettingWithValue(const char *settingName, const char *settingValueStr
14481472 else if (strcmp (settingName, " setProfile" ) == 0 )
14491473 {
14501474 // Change to new profile
1451- log_d (" Changing to profile number %d\r\n " , settingValue);
1475+ if (settings.debugWiFiConfig == true )
1476+ systemPrintf (" Changing to profile number %d\r\n " , settingValue);
14521477 changeProfileNumber (settingValue);
14531478
14541479 // Load new profile into system
@@ -1459,8 +1484,11 @@ void updateSettingWithValue(const char *settingName, const char *settingValueStr
14591484
14601485 createSettingsString (settingsCSV);
14611486
1462- log_d (" Sending profile %d\r\n " , settingValue);
1463- log_d (" Profile contents: %s" , settingsCSV);
1487+ if (settings.debugWiFiConfig == true )
1488+ {
1489+ systemPrintf (" Sending profile %d\r\n " , settingValue);
1490+ systemPrintf (" Profile contents: %s\r\n " , settingsCSV);
1491+ }
14641492 websocket->textAll (settingsCSV);
14651493 }
14661494 else if (strcmp (settingName, " resetProfile" ) == 0 )
@@ -1477,8 +1505,11 @@ void updateSettingWithValue(const char *settingName, const char *settingValueStr
14771505
14781506 createSettingsString (settingsCSV);
14791507
1480- log_d (" Sending reset profile %d\r\n " , settingValue);
1481- log_d (" Profile contents: %s" , settingsCSV);
1508+ if (settings.debugWiFiConfig == true )
1509+ {
1510+ systemPrintf (" Sending reset profile %d\r\n " , settingValue);
1511+ systemPrintf (" Profile contents: %s\r\n " , settingsCSV);
1512+ }
14821513 websocket->textAll (settingsCSV);
14831514 }
14841515 else if (strcmp (settingName, " forgetEspNowPeers" ) == 0 )
@@ -1504,7 +1535,8 @@ void updateSettingWithValue(const char *settingName, const char *settingValueStr
15041535 }
15051536 else if (strcmp (settingName, " checkNewFirmware" ) == 0 )
15061537 {
1507- log_d (" Checking for new OTA Pull firmware" );
1538+ if (settings.debugWiFiConfig == true )
1539+ systemPrintln (" Checking for new OTA Pull firmware" );
15081540
15091541 websocket->textAll (" checkingNewFirmware,1," ); // Tell the config page we received their request
15101542
@@ -1519,27 +1551,31 @@ void updateSettingWithValue(const char *settingName, const char *settingValueStr
15191551 getFirmwareVersion (currentVersion, sizeof (currentVersion), enableRCFirmware);
15201552 if (isReportedVersionNewer (reportedVersion, currentVersion) == true )
15211553 {
1522- log_d (" New version detected" );
1554+ if (settings.debugWiFiConfig == true )
1555+ systemPrintln (" New version detected" );
15231556 snprintf (newVersionCSV, sizeof (newVersionCSV), " newFirmwareVersion,%s," , reportedVersion);
15241557 }
15251558 else
15261559 {
1527- log_d (" No new firmware available" );
1560+ if (settings.debugWiFiConfig == true )
1561+ systemPrintln (" No new firmware available" );
15281562 snprintf (newVersionCSV, sizeof (newVersionCSV), " newFirmwareVersion,CURRENT," );
15291563 }
15301564 }
15311565 else
15321566 {
15331567 // Failed to get version number
1534- log_d (" Sending error to AP config page" );
1568+ if (settings.debugWiFiConfig == true )
1569+ systemPrintln (" Sending error to AP config page" );
15351570 snprintf (newVersionCSV, sizeof (newVersionCSV), " newFirmwareVersion,ERROR," );
15361571 }
15371572
15381573 websocket->textAll (newVersionCSV);
15391574 }
15401575 else if (strcmp (settingName, " getNewFirmware" ) == 0 )
15411576 {
1542- log_d (" Getting new OTA Pull firmware" );
1577+ if (settings.debugWiFiConfig == true )
1578+ systemPrintln (" Getting new OTA Pull firmware" );
15431579
15441580 websocket->textAll (" gettingNewFirmware,1," ); // Tell the config page we received their request
15451581
@@ -1750,7 +1786,8 @@ bool parseIncomingSettings()
17501786 if (counter < maxAttempts)
17511787 {
17521788 // Confirm receipt
1753- log_d (" Sending receipt confirmation of settings" );
1789+ if (settings.debugWiFiConfig == true )
1790+ systemPrintln (" Sending receipt confirmation of settings" );
17541791 websocket->textAll (" confirmDataReceipt,1," );
17551792 }
17561793
@@ -1843,7 +1880,8 @@ void getFileList(String &returnText)
18431880 systemPrintf (" sdCardSemaphore failed to yield, held by %s, Form.ino line %d\r\n " , semaphoreHolder, __LINE__);
18441881 }
18451882
1846- log_d (" returnText (%d bytes): %s\r\n " , returnText.length (), returnText.c_str ());
1883+ if (settings.debugWiFiConfig == true )
1884+ systemPrintf (" returnText (%d bytes): %s\r\n " , returnText.length (), returnText.c_str ());
18471885}
18481886
18491887// When called, responds with the messages supported on this platform
@@ -1859,7 +1897,8 @@ void createMessageList(String &returnText)
18591897 String (settings.ubxMessageRates [messageNumber]) + " ," ; // UBX_RTCM_1074,4,
18601898 }
18611899
1862- log_d (" returnText (%d bytes): %s\r\n " , returnText.length (), returnText.c_str ());
1900+ if (settings.debugWiFiConfig == true )
1901+ systemPrintf (" returnText (%d bytes): %s\r\n " , returnText.length (), returnText.c_str ());
18631902}
18641903
18651904// When called, responds with the RTCM/Base messages supported on this platform
@@ -1877,7 +1916,8 @@ void createMessageListBase(String &returnText)
18771916 String (settings.ubxMessageRatesBase [messageNumber]) + " ," ; // UBX_RTCM_1074Base,4,
18781917 }
18791918
1880- log_d (" returnText (%d bytes): %s\r\n " , returnText.length (), returnText.c_str ());
1919+ if (settings.debugWiFiConfig == true )
1920+ systemPrintf (" returnText (%d bytes): %s\r\n " , returnText.length (), returnText.c_str ());
18811921}
18821922
18831923// Handles uploading of user files to SD
0 commit comments