Server API - continueJob action

I've got a python script that is monitoring the UPS that the server and printers are plugged into. If the power fails, I send @pause to all printers that are currently printing. That works well. Where I am running into issues is that when sending the continueJob command. My pause handling is set up on each printer on the sever to pause and disable heated bed and extruders after x (90) seconds. When the continueJob command fires after the bed and extruders have been disabled, it seems like it is essentially doing the same as hitting "preheat" on the server. This means I must sent the continueJob command (?) again to actually restart the print?


Is there any way to trigger the preheat followed by the job continuation in an automated fashion within Server?

Thanks!

Comments

  • Yes, after a time temperatures can be disabled and server remembers. Job state variable then changesto preheat and you need to send 2 continueJob commands. It should also not hurt to always send 2 continueJob commands. If no preheat is required the secondwill be ignored i think.

    Not so sure what mean with automated fashion as you already seem to use the api to automate.
  • I suppose by "automate" I meant using one command that preheats then resumes job once temps are reached. I thought maybe M601 could be used in this way, but it doesn't seem to.

    Will sending two back-to-back continueJob commands (with no time to allow for preheating) do this, or will it essentially cause it to ignore the preheat? I will experiment on hardware here shortly but was curious if there was a known answer.

    Thanks!
  • It seems the back-to-back continueJob messages don't have the effect I was hoping, and that the second was essentially sent with the preheat button greyed out, and therefore ignored (I think). I can change and add some lines to my logic to suss out what needs to happen, but still hope there's some built-in functionality that I'm just missing.
  • This logic is handled by server so there is no gcode to handle it. Have to check how this is exactly handled when i‘m back.
  • Looks like it sets pauseState to 2 after the extruder and bed have been disabled, pauseState 3 while reheating, pauseState 4 when reheating is complete. Can you confirm this?

    Thanks!
  • Sounds like me, but can only confirm next week when I‘m at my computer.
  • I got this working using the pauseState flag and some extra logic, thanks for the help!
  • Ok, I'm back. It is right that you must wait. Here the pauseState meanings:

    0 = unpaused, 1 = paused, waiting cooldown, 2 = cooleddown (if enabled), 3 = heating, 4 = heated, waiting for continue, continue.

    So only on state 1 and 4 it will really continue. On 2 it will start heating and hold 3 during heating.


Sign In or Register to comment.