Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds configuration option to exclude the webserver on esp32. #3369

Merged
merged 20 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c165a49
Adds configuration option to not build/include the webserver.
jimwhitelaw Mar 11, 2024
fa6dce3
Adds configuration option to not build/include the webserver.
jimwhitelaw Mar 11, 2024
f6ff3f2
Keep initApiServer when excluding webserver
jimwhitelaw Mar 12, 2024
663b137
Merge remote-tracking branch 'refs/remotes/origin/no-webserver' into …
jimwhitelaw Mar 12, 2024
8176750
fixes for failed formatting check
jimwhitelaw Mar 12, 2024
7e2f937
Once more with feeling! Fix for regression.
jimwhitelaw Mar 12, 2024
c2eef07
Merge branch 'meshtastic:master' into no-webserver
jimwhitelaw Mar 13, 2024
ab2532f
Merge branch 'meshtastic:master' into no-webserver
jimwhitelaw Mar 14, 2024
5cd0168
Fix includes for ARCH_ESP32
jimwhitelaw Mar 14, 2024
436e631
Format changes from trunk
jimwhitelaw Mar 14, 2024
f450aa8
Merge updates from origin
jimwhitelaw Mar 14, 2024
b4abdd3
Merge remote-tracking branch 'origin'
jimwhitelaw Mar 15, 2024
bc44ce6
Merge remote-tracking branch 'origin/master' into no-webserver
jimwhitelaw Mar 15, 2024
0ac8898
Merge branch 'meshtastic:master' into master
jimwhitelaw Mar 15, 2024
eb91a4c
Merge remote-tracking branch 'upstream/master' into no-webserver
jimwhitelaw Mar 16, 2024
4d9a5b8
Revert "Format changes from trunk"
caveman99 Mar 20, 2024
2de35a8
jeez!
caveman99 Mar 20, 2024
b612d9c
tryfix proto conflict
caveman99 Mar 20, 2024
e9a4889
Merge branch 'master' into no-webserver
caveman99 Mar 20, 2024
567676a
Merge branch 'master' into no-webserver
caveman99 Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
// #include <driver/rtc_io.h>

#ifdef ARCH_ESP32
#if !MESHTASTIC_EXCLUDE_WEBSERVER
#include "mesh/http/WebServer.h"
#endif
#include "nimble/NimbleBluetooth.h"
NimbleBluetooth *nimbleBluetooth;
#endif
Expand Down Expand Up @@ -859,7 +861,7 @@ void setup()
#endif
#endif

#ifdef ARCH_ESP32
#if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_WEBSERVER
// Start web server thread.
webServerThread = new WebServerThread();
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/mesh/http/ContentHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !MESHTASTIC_EXCLUDE_WEBSERVER
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RadioLibInterface.h"
Expand Down Expand Up @@ -855,3 +856,4 @@ void handleScanNetworks(HTTPRequest *req, HTTPResponse *res)
res->print(value->Stringify().c_str());
delete value;
}
#endif
6 changes: 3 additions & 3 deletions src/mesh/http/WebServer.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !MESHTASTIC_EXCLUDE_WEBSERVER
#include "mesh/http/WebServer.h"
#include "NodeDB.h"
#include "graphics/Screen.h"
Expand Down Expand Up @@ -92,7 +93,6 @@ static void taskCreateCert(void *parameter)

LOG_DEBUG("Retrieved Private Key: %d Bytes\n", cert->getPKLength());
LOG_DEBUG("Retrieved Certificate: %d Bytes\n", cert->getCertLength());

} else {

LOG_INFO("Creating the certificate. This may take a while. Please wait...\n");
Expand All @@ -105,7 +105,6 @@ static void taskCreateCert(void *parameter)

if (createCertResult != 0) {
LOG_ERROR("Creating the certificate failed\n");

} else {
LOG_INFO("Creating the certificate was successful\n");

Expand Down Expand Up @@ -210,4 +209,5 @@ void initWebServer()
} else {
LOG_ERROR("Web Servers Failed! ;-( \n");
}
}
}
#endif
13 changes: 10 additions & 3 deletions src/mesh/wifi/WiFiAPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
#include "concurrency/Periodic.h"
#include "configuration.h"
#include "main.h"
#if !MESHTASTIC_EXCLUDE_WEBSERVER
#include "mesh/api/WiFiServerAPI.h"
#endif
#include "mqtt/MQTT.h"
#include "target_specific.h"
#include <WiFi.h>
#include <WiFiUdp.h>
#ifdef ARCH_ESP32
#if !MESHTASTIC_EXCLUDE_WEBSERVER
#include "mesh/http/WebServer.h"
#endif
#include <ESPmDNS.h>
#include <esp_wifi.h>
static void WiFiEvent(WiFiEvent_t event);
Expand Down Expand Up @@ -92,11 +96,13 @@ static void onNetworkConnected()
syslog.enable();
}

#if !MESHTASTIC_EXCLUDE_WEBSERVER

#ifdef ARCH_ESP32
initWebServer();
#endif
initApiServer();

#endif
caveman99 marked this conversation as resolved.
Show resolved Hide resolved
APStartupComplete = true;
}

Expand Down Expand Up @@ -146,7 +152,6 @@ static int32_t reconnectWiFi()

perhapsSetRTC(RTCQualityNTP, &tv);
lastrun_ntp = millis();

} else {
LOG_DEBUG("NTP Update failed\n");
}
Expand Down Expand Up @@ -204,7 +209,9 @@ bool initWifi()
const char *wifiPsw = config.network.wifi_psk;

#ifndef ARCH_RP2040
createSSLCert(); // For WebServer
#if !MESHTASTIC_EXCLUDE_WEBSERVER
createSSLCert(); // For WebServer
#endif
esp_wifi_set_storage(WIFI_STORAGE_RAM); // Disable flash storage for WiFi credentials
#endif
if (!*wifiPsw) // Treat empty password as no password
Expand Down
Loading