diff --git a/ESP32/.cproject b/ESP32/.cproject
index 0d4d3cc..3f927c8 100644
--- a/ESP32/.cproject
+++ b/ESP32/.cproject
@@ -19,6 +19,7 @@
Hello world! This file is served from the SPIFFS
+ diff --git a/ESP32/vehicle-monitor.cpp b/ESP32/vehicle-monitor.cpp index cf79120..799d27e 100644 --- a/ESP32/vehicle-monitor.cpp +++ b/ESP32/vehicle-monitor.cpp @@ -1,28 +1,23 @@ #includeHello world!
- - -)rawliteral"; - void setup() { Serial.begin(115200); + if(!SPIFFS.begin(false)){ + Serial.println("SPIFFS Mount Failed"); + return; + } + // Connect to Wi-Fi WiFi.begin(wifi_ssid, wifi_password); while (WiFi.status() != WL_CONNECTED) @@ -35,10 +30,7 @@ void setup() Serial.print("Wifi connected, ip="); Serial.println(WiFi.localIP()); - server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) - { - request->send(200, "text/html", index_html); - }); + server.serveStatic("/", SPIFFS, "/www/").setDefaultFile("index.html"); server.begin(); Serial.println("HTTP server started");