From d5f76b16b9ec7a62ac7d9c72b4a2f57453b75edf Mon Sep 17 00:00:00 2001
From: Jm Casler
Date: Wed, 30 Dec 2020 14:52:39 -0800
Subject: [PATCH 1/4] write readLength to debug console
---
src/meshwifi/meshhttp.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/meshwifi/meshhttp.cpp b/src/meshwifi/meshhttp.cpp
index d6d2e22b..678c89de 100644
--- a/src/meshwifi/meshhttp.cpp
+++ b/src/meshwifi/meshhttp.cpp
@@ -791,10 +791,12 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res)
file.write(buf, readLength);
fileLength += readLength;
+ DEBUG_MSG("readLength - %i", readLength);
+
// Abort the transfer if there is less than 50k space left on the filesystem.
if (SPIFFS.totalBytes() - SPIFFS.usedBytes() < 51200) {
file.close();
- res->println("Write aborted! File is won't fit!
");
+ res->println("Write aborted! Reserving 50k on filesystem.
");
delete parser;
return;
From 7716d6201816d5b62085c7c5d79836091ef557ae Mon Sep 17 00:00:00 2001
From: Jm
Date: Wed, 30 Dec 2020 15:16:04 -0800
Subject: [PATCH 2/4] Remove old comment
---
src/plugins/TextMessagePlugin.cpp | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/plugins/TextMessagePlugin.cpp b/src/plugins/TextMessagePlugin.cpp
index 31d98fee..1e742454 100644
--- a/src/plugins/TextMessagePlugin.cpp
+++ b/src/plugins/TextMessagePlugin.cpp
@@ -18,11 +18,5 @@ bool TextMessagePlugin::handleReceived(const MeshPacket &mp)
powerFSM.trigger(EVENT_RECEIVED_TEXT_MSG);
notifyObservers(&mp);
- // This is going into the wifidev feature branch
- // Only update the WebUI if WiFi is enabled
- //#if WiFi_MODE != 0
- // notifyWebUI();
- //#endif
-
return false; // Let others look at this message also if they want
}
From 2867f8fd5378011b98e5df37d8e734f09de50799 Mon Sep 17 00:00:00 2001
From: Jm
Date: Wed, 30 Dec 2020 18:10:35 -0800
Subject: [PATCH 3/4] Fix for #606 and #597
Upload interface randomly crashes #606
watchdog timer exception while building https certificate #597
---
src/esp32/main-esp32.cpp | 3 ++-
src/meshwifi/meshhttp.cpp | 43 ++++++++++++++++++++++++---------------
2 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/src/esp32/main-esp32.cpp b/src/esp32/main-esp32.cpp
index 25e7e1a3..0e60fba8 100644
--- a/src/esp32/main-esp32.cpp
+++ b/src/esp32/main-esp32.cpp
@@ -49,7 +49,8 @@ void esp32Setup()
// Since we are turning on watchdogs rather late in the release schedule, we really don't want to catch any
// false positives. The wait-to-sleep timeout for shutting down radios is 30 secs, so pick 45 for now.
-#define APP_WATCHDOG_SECS 45
+// #define APP_WATCHDOG_SECS 45
+#define APP_WATCHDOG_SECS 90
res = esp_task_wdt_init(APP_WATCHDOG_SECS, true);
assert(res == ESP_OK);
diff --git a/src/meshwifi/meshhttp.cpp b/src/meshwifi/meshhttp.cpp
index 678c89de..319a70d7 100644
--- a/src/meshwifi/meshhttp.cpp
+++ b/src/meshwifi/meshhttp.cpp
@@ -3,6 +3,7 @@
#include "PowerFSM.h"
#include "airtime.h"
#include "configuration.h"
+#include "esp_task_wdt.h"
#include "main.h"
#include "meshhttpStatic.h"
#include "meshwifi/meshwifi.h"
@@ -190,6 +191,7 @@ void createSSLCert()
DEBUG_MSG(".");
delay(1000);
yield();
+ esp_task_wdt_reset();
}
DEBUG_MSG("SSL Cert Ready!\n");
}
@@ -341,7 +343,7 @@ void middlewareSpeedUp160(HTTPRequest *req, HTTPResponse *res, std::functionprintln("File Editedprintln("File EditedFile Edited
");
// The form is submitted with the x-www-form-urlencoded content type, so we need the
@@ -499,15 +501,15 @@ void handleStaticBrowse(HTTPRequest *req, HTTPResponse *res)
std::string pathDelete = "/" + paramValDelete;
if (SPIFFS.remove(pathDelete.c_str())) {
Serial.println(pathDelete.c_str());
- res->println("File "
+ res->println("File "
"deleted!File deleted!
");
- res->println("\n");
+ res->println("\n");
res->println("");
return;
} else {
Serial.println(pathDelete.c_str());
- res->println("Error deleteing "
+ res->println("Error deleteing "
"file!Error deleteing file!
");
res->println("Error deleteing file!
");
@@ -559,7 +561,7 @@ void handleStaticBrowse(HTTPRequest *req, HTTPResponse *res)
res->println("Upload new file
");
res->println("*** This interface is experimental ***
");
res->println("This form allows you to upload files. Keep your filenames very short and files small. Big filenames and big "
- "files are a known problem.
");
+ "files (>200k) are a known problem.
");
res->println("