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 { 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"); diff --git a/ESPixelStick/src/input/InputFPPRemote.cpp b/ESPixelStick/src/input/InputFPPRemote.cpp index 8c8719554..65efd6e37 100644 --- a/ESPixelStick/src/input/InputFPPRemote.cpp +++ b/ESPixelStick/src/input/InputFPPRemote.cpp @@ -106,8 +106,12 @@ 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 + StopPlaying (); + } + else if (PlayingFile ()) { pInputFPPRemotePlayItem->Poll (InputDataBuffer, InputDataBufferSize); @@ -161,13 +165,28 @@ bool c_InputFPPRemote::SetConfig (JsonObject & jsonConfig) void c_InputFPPRemote::StopPlaying () { // DEBUG_START; - - if (PlayingFile ()) + do // once { + if (!PlayingFile ()) + { + // DEBUG_ ("Not currently playing a file"); + break; + } + + // DEBUG_ (); + pInputFPPRemotePlayItem->Stop (); + + while (!pInputFPPRemotePlayItem->IsIdle ()) + { + pInputFPPRemotePlayItem->Poll (InputDataBuffer, InputDataBufferSize); + pInputFPPRemotePlayItem->Stop (); + } + delete pInputFPPRemotePlayItem; pInputFPPRemotePlayItem = nullptr; - } + + } while (false); // DEBUG_END; 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},