preflight_check
Verify printer readiness before starting a print. Checks connection, idle state, error flags, and temperatures, with optional material and file validation to catch issues early.
Instructions
Run pre-print safety checks to verify the printer is ready.
Checks performed:
- Printer is connected and operational
- Printer is not currently printing
- No error flags are set
- Temperatures are within safe limits
- (Optional) Material loaded matches expected material
- (Optional) Local G-code file is valid and readable
- (Optional) Remote file exists on the printer
Args:
file_path: Optional path to a local G-code file to validate before
upload. If omitted, only printer-state checks are performed.
expected_material: Optional material type (e.g. "PLA", "ABS", "PETG").
If provided and a material is loaded, checks for a mismatch.
remote_file: Optional filename to verify exists on the printer.
If provided, checks the printer's file list for a matching file.
accept_paused: When ``True``, the ``printer_idle`` check accepts
the ``paused`` state in addition to ``idle``. Used by
``start_print(resume_from_paused=True)`` for mid-print
resume 3MFs (which start from a paused-state printer).
Default ``False`` — only ``idle`` is accepted.
printer_name: Which printer to check. Omit to check the default
printer, which is what this did before it could be aimed.
The state, the temperature ceilings and the material profile
all follow the named machine — a readiness verdict is about
one printer, and it has to be the printer that will print.
Call this before ``start_print()`` to catch problems early. The result
includes a ``ready`` boolean and detailed per-check breakdowns.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | No | ||
| remote_file | No | ||
| printer_name | No | ||
| accept_paused | No | ||
| expected_material | No |