Commit Graph
4 Commits
Author SHA1 Message Date
Kris Austin e2db7e5ef1 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
2026-11-09 08:54:21 -06:00
Kris Austin 0b1d825142 Fix the freeze before the Creality send dialog opens on a printer without a CFS (#17177)
Fixes #17128

Clicking Print on a Creality printer asked it for its CFS slots on the UI thread, with the 10 s command timeout. A K1C without a CFS never answers that query, so OrcaSlicer froze for 10 s on every click.

The send dialog now opens right away and reads the printer on a background thread. Upload works at once, and Upload and Print turns on when the read ends. The slot query waits 5 s, or the full 10 s once the printer reports `"cfsConnect": 1`, and stops as soon as it reports `"cfsConnect": 0`. When there is no filament mapping, the dialog says whether the printer reports no CFS, lists no slots, or can't be reached.
2026-11-04 07:40:11 -06:00
HanifKoh fbc50d3d3a Start a Creality Print Job From the Spool Holder When No CFS Slot Is Mapped (#16794)
CrealityPrint::start_print() chose between the plain opGcodeFile start and the
colorMatch + multiColorPrint pair by the model id alone, and inside the
multi-colour branch it fell back to the plain start only when a filament was
mapped onto box 0. A K1-family printer reports the same model id with and
without a CFS, and without one it never answers the boxsInfo query, so the send
dialog had no slots to map and the printer received a colorMatch with an empty
list followed by multiColorPrint. The job printed, but the firmware flagged
"no material" (materialStatus 1) for its whole duration. The same happened on
any CFS-capable model whenever the boxsInfo query failed.

Treat an empty mapping like a mapping onto the spool holder and send the plain
start with enableSelfTest, which is what Creality Print does when the printer
lists no colours. The command building moves into start_print_commands(), a
pure function, so the decision is unit-tested. Every plain start now reads the
printer's answer best-effort before closing, as the non-CFS start already did,
so the close frame never follows the command in the same burst.

Fixes #16695.
2026-10-26 15:27:20 +08:00
Kris Austin 2054242884 Fix Creality print host hanging on a printer that stops answering (#16772)
ws_connect(), query_boxes_info() and start_print() set expires_after()
deadlines, then made synchronous Beast calls. Beast only applies those
deadlines to async operations, so none of them fired. A printer that
accepted the websocket and then stopped answering blocked the caller
forever. That froze the GUI thread when the Creality send dialog opened
or the sidebar synced filaments, and left uploads stuck after the file
arrived.

Run every websocket call as an async operation on the local io_context,
so the deadlines apply. run_until_done() and the per-address connect
loop move from MoonrakerPrinterAgent.cpp into AsioUtils.hpp, and both
files share them. Each resolved address gets its own connect deadline,
and start_print() gets a reply deadline for its commands. A start-print
timeout shows the translated timeout message that HTTP timeouts already
use, now shared through PrintHost::timed_out_message(), and other
websocket errors drop Boost's source location.

The websocket port and deadlines move into a protected ws_settings
member, so the tests can use a local port and short deadlines. The new
tests run CrealityPrint against a fake printer that goes silent before
or after the handshake.
2026-10-24 22:01:15 -05:00