AllMyPrinters
Alle onderwerpen
IdeeKlaar in Agent 0.24.10

Feature request: power on a Klipper/Moonraker printer when a print is sent (Moonraker power devices)

Burnie

Hi Chris,

Thanks for 0.24.9: "Files on the printer", timelapses and deleting files are nice additions for my Klipper printer. I have one more request for Klipper/Moonraker printers.

Setup
- Agent 0.24.9 (Docker, self-hosted), Android app (latest)
- Tronxy X5S with Klipper v0.13.0 and Moonraker
- The Raspberry Pi is always on. The printer itself (PSU and mainboard) is on a smart plug, which Moonraker controls as a power device ([power x5s], type homeassistant, restart_klipper_when_powered: True).

What happens today
When the printer is switched off, the agent shows it as offline (Klipper is in "shutdown" without the mainboard). If I send a print anyway, the upload to /server/files/upload works, because Moonraker is running on the Pi, but /printer/print/start fails because Klipper is not ready. So I first have to switch the printer on in Mainsail or Home Assistant, wait about 15 seconds and then send the print from the app.

Request
Support Moonraker power devices (/machine/device_power/devices, /machine/device_power/device?device=...&action=on|off):
1. Show the power state of the printer and an on/off button on the printer card, for the devices Moonraker lists.
2. When a print is sent to a printer that is powered off: switch the power device on, wait until Klipper reports "ready" (/printer/info, state ready), and then start the print. If Klipper is not ready within a time limit (for example 60 s), show an error instead.
3. Optional: a setting "Power off after print" that switches the device off when the print is finished and the hotend has cooled below about 50 °C.

Alternative
Upload with print=true and let Moonraker's job queue start the print. With on_when_job_queued: True, Moonraker then powers the printer on and starts the job itself when Klipper is ready. This requires [job_queue] in moonraker.conf, so it would probably need to be an option per printer.

Thanks also for "Files of this model" / "All on one plate" (0.24.6). What I still miss from my last message: more than one plate in "Edit plate", and plates created automatically when the parts do not fit on one plate.

Thanks!
/Burnie

Wil ik ook0

2 reacties

Chris Team

Hi Burnie,

thanks for the detailed request. Your description of the setup makes this easy to build. Plan for the next agent update:

Power switch on the printer card: If Moonraker lists power devices, the card shows the power state and a switch, also while the printer is off. Switching off asks first and is blocked while a print is running or paused.
Sending to a printer that is off: The agent switches the power device on, uploads the file in the meantime, waits until Klipper reports "ready" (up to 90 s) and then starts the print. If Klipper doesn't get ready in time, you get an error message.
"Power off after print" as an option per printer (off by default): when the print has ended, the agent waits until the hotend is below 50 °C and then switches the device off. This needs the agent to be running.

If Moonraker lists more than one device, you choose in the printer settings which one powers the printer. We went for this instead of the job queue because it works without changes to moonraker.conf.

Several plates in "Edit plate" and automatic plates are still planned (#55), not forgotten.

br Chris

Chris Team

Update: this is now in Agent 0.24.10 (Docker latest; Windows and the Home Assistant app update themselves).

Where to find it:
- A printer that is off shows "Powered off" with a "Switch on" button on its card. When it's on, the switch is under "Controls".
- Printer menu (⋯) → "Power switch": switch the devices, choose which one powers the printer if Moonraker lists several, and turn on "Power off after print".

Two details: without restart_klipper_when_powered the agent sends one FIRMWARE_RESTART 10 s after switching on, and a cancelled print leaves the printer on. Starting a file from "Files on the printer" switches the printer on too.

Several plates are in Agent 0.24.11 as well – see #55.

br Chris

Log in om te reageren

Inhoud melden