diff --git a/MotionToPhotonMeter.ino b/MotionToPhotonMeter.ino index bf538428ed1e3a10678154231c36d3001f6f28c2..9073bbf90e412c5efa2f4daf1fc786e163e7d28b 100644 --- a/MotionToPhotonMeter.ino +++ b/MotionToPhotonMeter.ino @@ -41,6 +41,11 @@ MotionToPhotonServer server(result_buffer, result_buffer_length, getPhotoDiodeRe /* Multicore */ TaskHandle_t TaskCore0; TaskHandle_t TaskCore1; +const esp_task_wdt_config_t twdt_config = { + .timeout_ms = 6000, + .idle_core_mask = 0b00000011, // Disable on all cores + .trigger_panic = false, +}; void core1( void * pvParameters ){ while(true){ @@ -104,7 +109,7 @@ void setup() { server.setup(); - esp_task_wdt_init(6000,false); + esp_task_wdt_init(&twdt_config); xTaskCreatePinnedToCore( core0, // Task function. "Server", // name of task. @@ -123,8 +128,7 @@ void setup() { &TaskCore1, // Task handle to keep track of created task 1); // pin task to core 1 delay(500); - disableCore0WDT(); - disableCore1WDT(); + esp_task_wdt_deinit(); } void loop(){} //Still needed for arduino core to work diff --git a/MotionToPhotonServer.cpp b/MotionToPhotonServer.cpp index 10d44d2772f4bb6d209ea7de507cf71858c5eed0..a8b7cd18bc4b40d98fb1837b1ce065d4cde33b47 100644 --- a/MotionToPhotonServer.cpp +++ b/MotionToPhotonServer.cpp @@ -109,14 +109,14 @@ } void MotionToPhotonServer::pageResults(){ - Serial.println("Client wants index page."); + Serial.println("Client wants results page."); server.setContentLength(CONTENT_LENGTH_UNKNOWN); server.send(200, "text/plain", ""); unsigned int currentNumberOfResults = getCurrentNumberOfResults(); for(unsigned int i = 0; i < currentNumberOfResults; i++){ server.sendContent(String(result_buffer[i]) + ((i != currentNumberOfResults-1) ? ",\n":"")); } - server.client().stop(); + server.sendContent(""); } void MotionToPhotonServer::pageIndex(){ diff --git a/MotionToPhotonServer.h b/MotionToPhotonServer.h index 630a56c2f7a2e55a021d767c371b3ae0ff4467c4..2e418a1d26aeb8904c4fd06aae179445c477a71a 100644 --- a/MotionToPhotonServer.h +++ b/MotionToPhotonServer.h @@ -2,8 +2,10 @@ #define MotionToPhotonServer_h #include "Arduino.h" +#include <WiFi.h> #include <WebServer.h> #include "SPIFFS.h" +#include "FS.h" class MotionToPhotonServer { @@ -18,7 +20,7 @@ class MotionToPhotonServer void (* abortMeasurement)(); /* Put your SSID & Password */ - const char* ssid = "Calibratio"; // Enter SSID here + const char* ssid = "Calibratio2"; // Enter SSID here const char* password = ""; //Enter Password here /* Put IP Address details */ diff --git a/data/index.html b/data/index.html index 5c7c52ec642eda4edb6fcd0ece3d1ed6be635629..d14a4682cadf81a62cd725a78c7dc479f7ab0c7f 100644 --- a/data/index.html +++ b/data/index.html @@ -2,7 +2,7 @@ <html> <head> <meta charset="ISO-8859-1"> - <title>Calibratio V1.1</title> + <title>Calibratio V2</title> <!-- Hello you there, reading the code! This was coded by Sebastian Pape aka PapeCoding.de --> <style> * {