From cd60a81b90081d288b84101c28cf22b7337dc180 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Wed, 13 Oct 2021 07:38:56 -0400 Subject: [PATCH 1/6] Increased the size of the file name buffer. --- ESPixelStick/src/FileMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ESPixelStick/src/FileMgr.cpp b/ESPixelStick/src/FileMgr.cpp index ec8c66059..9c1cbd01f 100644 --- a/ESPixelStick/src/FileMgr.cpp +++ b/ESPixelStick/src/FileMgr.cpp @@ -589,7 +589,7 @@ void c_FileMgr::GetListOfSdFiles (String & Response) { // DEBUG_START; - DynamicJsonDocument ResponseJsonDoc (2048); + DynamicJsonDocument ResponseJsonDoc (3 * 1024); do // once { From a62210311d1e764bc2de1a97d4b9300cda3ad07f Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Wed, 13 Oct 2021 11:11:51 -0400 Subject: [PATCH 2/6] Added handler for SD file transfer to the browser. --- ESPixelStick/src/WebMgr.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ESPixelStick/src/WebMgr.cpp b/ESPixelStick/src/WebMgr.cpp index 4a7e828cf..353b85933 100644 --- a/ESPixelStick/src/WebMgr.cpp +++ b/ESPixelStick/src/WebMgr.cpp @@ -262,6 +262,18 @@ void c_WebMgr::init () } ); + webServer.on ("/download", HTTP_GET, [](AsyncWebServerRequest* request) + { + // DEBUG_V (String ("url: ") + String (request->url ())); + String filename = request->url ().substring (String ("/download").length ()); + // DEBUG_V (String ("filename: ") + String (filename)); + + AsyncWebServerResponse* response = new AsyncFileResponse (SDFS, filename, "application/octet-stream", true); + request->send (response); + + // DEBUG_V ("Send File Done"); + }); + webServer.onNotFound ([this](AsyncWebServerRequest* request) { // DEBUG_V ("onNotFound"); From 6da174f3bb9b6df154db21caaada22d154c61229 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Wed, 13 Oct 2021 16:47:48 -0400 Subject: [PATCH 3/6] Made FPP Remote input processing honor blanking --- ESPixelStick/src/input/InputFPPRemote.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ESPixelStick/src/input/InputFPPRemote.cpp b/ESPixelStick/src/input/InputFPPRemote.cpp index 8c8719554..2b678bc57 100644 --- a/ESPixelStick/src/input/InputFPPRemote.cpp +++ b/ESPixelStick/src/input/InputFPPRemote.cpp @@ -106,8 +106,11 @@ void c_InputFPPRemote::GetStatus (JsonObject & jsonStatus) void c_InputFPPRemote::Process () { // DEBUG_START; - - if (PlayingFile ()) + if (!IsInputChannelActive) + { + // dont do anything if the channel is not active + } + else if (PlayingFile ()) { pInputFPPRemotePlayItem->Poll (InputDataBuffer, InputDataBufferSize); From b3153db1d6c085d9b14ebbba16496ad9e8fc8735 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Wed, 13 Oct 2021 16:48:28 -0400 Subject: [PATCH 4/6] Moved FPP Remote processing to channel 2 --- ESPixelStick/src/input/InputMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ESPixelStick/src/input/InputMgr.cpp b/ESPixelStick/src/input/InputMgr.cpp index 2c8656313..e0abdc889 100644 --- a/ESPixelStick/src/input/InputMgr.cpp +++ b/ESPixelStick/src/input/InputMgr.cpp @@ -52,7 +52,7 @@ static const InputTypeXlateMap_t InputTypeXlateMap[c_InputMgr::e_InputType::Inpu { {c_InputMgr::e_InputType::InputType_E1_31, "E1.31", c_InputMgr::e_InputChannelIds::InputPrimaryChannelId}, {c_InputMgr::e_InputType::InputType_DDP, "DDP", c_InputMgr::e_InputChannelIds::InputPrimaryChannelId}, - {c_InputMgr::e_InputType::InputType_FPP, "FPP Remote", c_InputMgr::e_InputChannelIds::InputPrimaryChannelId}, + {c_InputMgr::e_InputType::InputType_FPP, "FPP Remote", c_InputMgr::e_InputChannelIds::InputSecondaryChannelId}, {c_InputMgr::e_InputType::InputType_Artnet, "Artnet", c_InputMgr::e_InputChannelIds::InputPrimaryChannelId}, {c_InputMgr::e_InputType::InputType_Effects, "Effects", c_InputMgr::e_InputChannelIds::InputSecondaryChannelId}, {c_InputMgr::e_InputType::InputType_MQTT, "MQTT", c_InputMgr::e_InputChannelIds::InputSecondaryChannelId}, From 053a13b7a8f84a683c2643e272ffe146e1a7f3f7 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Wed, 13 Oct 2021 17:06:50 -0400 Subject: [PATCH 5/6] Cleaned up potential memory leak while forcing a file to stop playing. --- ESPixelStick/src/input/InputFPPRemote.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/ESPixelStick/src/input/InputFPPRemote.cpp b/ESPixelStick/src/input/InputFPPRemote.cpp index 2b678bc57..e02db30a6 100644 --- a/ESPixelStick/src/input/InputFPPRemote.cpp +++ b/ESPixelStick/src/input/InputFPPRemote.cpp @@ -109,6 +109,7 @@ void c_InputFPPRemote::Process () if (!IsInputChannelActive) { // dont do anything if the channel is not active + StopPlaying (); } else if (PlayingFile ()) { @@ -164,13 +165,28 @@ bool c_InputFPPRemote::SetConfig (JsonObject & jsonConfig) void c_InputFPPRemote::StopPlaying () { // DEBUG_START; - - if (PlayingFile ()) + do // once { + if (!PlayingFile ()) + { + DEBUG_V ("Not currently playing a file"); + break; + } + + DEBUG_V (); + pInputFPPRemotePlayItem->Stop (); + + while (!pInputFPPRemotePlayItem->IsIdle ()) + { + pInputFPPRemotePlayItem->Poll (InputDataBuffer, InputDataBufferSize); + pInputFPPRemotePlayItem->Stop (); + } + delete pInputFPPRemotePlayItem; pInputFPPRemotePlayItem = nullptr; - } + + } while (false); // DEBUG_END; From b599bf64314c5f3633198bcbce29c721496899d7 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Wed, 13 Oct 2021 17:11:43 -0400 Subject: [PATCH 6/6] Turned off debug messages --- ESPixelStick/src/input/InputFPPRemote.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ESPixelStick/src/input/InputFPPRemote.cpp b/ESPixelStick/src/input/InputFPPRemote.cpp index e02db30a6..65efd6e37 100644 --- a/ESPixelStick/src/input/InputFPPRemote.cpp +++ b/ESPixelStick/src/input/InputFPPRemote.cpp @@ -169,11 +169,11 @@ void c_InputFPPRemote::StopPlaying () { if (!PlayingFile ()) { - DEBUG_V ("Not currently playing a file"); + // DEBUG_ ("Not currently playing a file"); break; } - DEBUG_V (); + // DEBUG_ (); pInputFPPRemotePlayItem->Stop ();