From e9c9e40624881c8be7ef83d972e2cf002bf823c3 Mon Sep 17 00:00:00 2001 From: Jm Date: Mon, 4 Jan 2021 22:15:19 -0800 Subject: [PATCH 1/2] Include instrusctions for real time backtrace decoding. --- docs/software/build-instructions.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/software/build-instructions.md b/docs/software/build-instructions.md index 31008fda0..55ec8d7ad 100644 --- a/docs/software/build-instructions.md +++ b/docs/software/build-instructions.md @@ -39,9 +39,20 @@ cd Meshtastic-device ## Decoding stack traces +### Option 1 + If you get a crash, you can decode the addresses from the `Backtrace:` line: 1. Save the `Backtrace: 0x....` line to a file, e.g., `backtrace.txt`. 2. Run `bin/exception_decoder.py backtrace.txt` (this uses symbols from the last `firmware.elf`, so you must be running the same binary that's still in your `.pio/build` directory). + +### Option 2 + +You can run the exception decoder to monitor the serial output and decode backtraces in real time. + +1. From within PlatformIO, open a new terminal. +2. At the the terminal, enter: + `pio device monitor --port /dev/cu.SLAB_USBtoUART -f esp32_exception_decoder` + Replace the value of port with the location of your serial port. From 84e3d7c27631e937deca2c9faa2afea8d3355f83 Mon Sep 17 00:00:00 2001 From: Jm Date: Tue, 5 Jan 2021 18:57:03 -0800 Subject: [PATCH 2/2] Test fixes for Tobiases --- proto | 2 +- src/meshwifi/meshhttp.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/proto b/proto index dfe7bc121..75078afe4 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit dfe7bc1217a00c23eecb9dfcf1d56fe95ebddc3b +Subproject commit 75078afe43934f4ce15ef86ebc6950658a170145 diff --git a/src/meshwifi/meshhttp.cpp b/src/meshwifi/meshhttp.cpp index 7dab845f2..f4051dd45 100644 --- a/src/meshwifi/meshhttp.cpp +++ b/src/meshwifi/meshhttp.cpp @@ -494,6 +494,9 @@ void handleStaticBrowse(HTTPRequest *req, HTTPResponse *res) std::string paramValDelete; std::string paramValEdit; + DEBUG_MSG("Static Browse - Disabling keep-alive\n"); + res->setHeader("Connection", "close"); + // Set a default content type res->setHeader("Content-Type", "text/html"); @@ -700,6 +703,11 @@ void handleStatic(HTTPRequest *req, HTTPResponse *res) void handleFormUpload(HTTPRequest *req, HTTPResponse *res) { + + DEBUG_MSG("Form Upload - Disabling keep-alive\n"); + res->setHeader("Connection", "close"); + + DEBUG_MSG("Form Upload - Set frequency to 240mhz\n"); // The upload process is very CPU intensive. Let's speed things up a bit. setCpuFrequencyMhz(240); @@ -708,6 +716,7 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res) // Then we select the body parser based on the encoding. // Actually we do this only for documentary purposes, we know the form is going // to be multipart/form-data. + DEBUG_MSG("Form Upload - Creating body parser reference\n"); HTTPBodyParser *parser; std::string contentType = req->getHeader("Content-Type"); @@ -723,6 +732,7 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res) // Now, we can decide based on the content type: if (contentType == "multipart/form-data") { + DEBUG_MSG("Form Upload - multipart/form-data\n"); parser = new HTTPMultipartBodyParser(req); } else { Serial.printf("Unknown POST Content-Type: %s\n", contentType.c_str()); @@ -757,21 +767,21 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res) // Double check that it is what we expect if (name != "file") { - DEBUG_MSG("Skipping unexpected field"); + DEBUG_MSG("Skipping unexpected field\n"); res->println("

No file found.

"); return; } // Double check that it is what we expect if (filename == "") { - DEBUG_MSG("Skipping unexpected field"); + DEBUG_MSG("Skipping unexpected field\n"); res->println("

No file found.

"); return; } // SPIFFS limits the total lenth of a path + file to 31 characters. if (filename.length() + 8 > 31) { - DEBUG_MSG("Uploaded filename too long!"); + DEBUG_MSG("Uploaded filename too long!\n"); res->println("

Uploaded filename too long! Limit of 23 characters.

"); delete parser; return;