Fix Upload and Print not starting on the Ender-3 V3 KE (#17365)

Since 2.5.0 the CrealityPrint host starts a print with a /mnt/UDISK path
on every model outside the K1 family. The Ender-3 V3 KE (F005) keeps its
gcodes under /usr/data like the K1, so the firmware ignores the start
command and the uploaded file never prints. The Ender-3 V3 series (F001),
Ender-3 V3 Plus (F002), CR-10 SE (F003) and Ender-5 Max (F004) also keep
their gcodes under /usr/data and get the same wrong path.

The K2 SE (F016) keeps its gcodes under /usr/data too, unlike the other
K2 models. OrcaSlicer sent its CFS start commands with a /mnt/UDISK path,
so the printer ignored them.

Add those models to the /usr/data list, and rename the list since it
isn't only K1-family models anymore. Every other model still uses
/mnt/UDISK.

Fixes #17363
Fixes #8735
Fixes #17078
Fixes #17364
This commit is contained in:
Kris Austin authored and GitHub committed 2026-11-09 08:54:21 -06:00
1 parent b4bd9c8492
commit e2db7e5ef1
2 files changed
+15 -9

No files matched your search

+11 -7
View File
@@ -331,12 +331,16 @@ static void ws_close(net::io_context& ioc, websocket::stream<beast::tcp_stream>&
run_until_done(ioc, [&](auto&& handler) { ws.async_close(websocket::close_code::normal, handler); });
}
// K1-family firmware stores gcodes under /usr/data and uses a stricter WebSocket
// protocol (TEXT frames, heartbeat acks). The /info model is the literal name on
// K1-family, including the *_CFS-C bundle variants. Add verified model IDs here.
static bool is_k1_family(const std::string& model)
// Add a model by its /info value once its firmware is known to keep gcodes under /usr/data; every other model uses /mnt/UDISK.
static bool stores_gcode_in_usr_data(const std::string& model)
{
static const std::unordered_set<std::string> k1_models = {
static const std::unordered_set<std::string> usr_data_models = {
"F001", // Ender-3 V3 series
"F002", // Ender-3 V3 Plus
"F003", // CR-10 SE
"F004", // Ender-5 Max
"F005", // Ender-3 V3 KE
"F016", // K2 SE
"K1",
"K1 Max",
"K1 Max_CFS-C",
@@ -346,7 +350,7 @@ static bool is_k1_family(const std::string& model)
"K1C_CFS-C",
"K1_CFS-C",
};
return k1_models.count(model) > 0;
return usr_data_models.count(model) > 0;
}
void CrealityPrint::query_model() const
@@ -520,7 +524,7 @@ bool CrealityPrint::start_print(wxString &msg, const std::string &filename, cons
// Runs before the WebSocket opens and its reply deadline starts, since it can query the
// printer over HTTP. It also fills m_model.
const bool multi_color = supports_multi_color_print();
const std::string data_root = is_k1_family(m_model) ? "/usr/data" : "/mnt/UDISK";
const std::string data_root = stores_gcode_in_usr_data(m_model) ? "/usr/data" : "/mnt/UDISK";
const std::string gcode_path = data_root + "/printer_data/gcodes/" + filename;
net::io_context ioc;
+4 -2
View File
@@ -495,13 +495,15 @@ TEST_CASE("Starting a print gives a silent printer no more than its deadlines",
TEST_CASE("Starting a print sends each command with the G-code path in a text frame", "[CrealityPrint]")
{
// F008 is a multi-color model and F001 a plain one. K1-family models keep their G-code under /usr/data.
// F008 is a multi-color model and F018 a plain one. K1C, F005 (Ender-3 V3 KE) and F016 (K2 SE) keep their G-code under /usr/data.
// Only a mapping onto CFS slots starts a multi-color print; a printer that listed no slots starts plainly.
const std::map<std::string, std::string> cfs_mapping = {{"enableSelfTest", "0"}, {"colorMatch_0", "T1A\tPLA\t#FF0000\t1\t0"}};
const auto [model, extended_info, commands, gcode] = GENERATE_REF(table<std::string, std::map<std::string, std::string>, std::vector<std::string>, std::string>({
{"F008", cfs_mapping, {"colorMatch", "multiColorPrint"}, "/mnt/UDISK/printer_data/gcodes/test.gcode"},
{"F008", {}, {"opGcodeFile"}, "printprt:/mnt/UDISK/printer_data/gcodes/test.gcode"},
{"F001", {}, {"opGcodeFile"}, "printprt:/mnt/UDISK/printer_data/gcodes/test.gcode"},
{"F018", {}, {"opGcodeFile"}, "printprt:/mnt/UDISK/printer_data/gcodes/test.gcode"},
{"F005", {}, {"opGcodeFile"}, "printprt:/usr/data/printer_data/gcodes/test.gcode"},
{"F016", cfs_mapping, {"colorMatch", "multiColorPrint"}, "/usr/data/printer_data/gcodes/test.gcode"},
{"K1C", cfs_mapping, {"colorMatch", "multiColorPrint"}, "/usr/data/printer_data/gcodes/test.gcode"},
{"K1C", {}, {"opGcodeFile"}, "printprt:/usr/data/printer_data/gcodes/test.gcode"},
}));