@mikeabuilder said in Add a trigger for a user gcode file after print header is read:
@t3p3tony has the gist of my objective. I think the initial implementation using daemon.g looks like this:
in start.g:
Set a variable called "stop_print = true"
In daemon.g:
Check the value of "stop_print". If true, abort the print, if not true, continue.
In the slicer, I put a line in the custom gcode for this printer type (PrusaSlicer has this capability, I assume others do too):
Set "stop_print = false"
With this setup, any slicer that does not incorporate the "stop_print =false" line will result in a print aborted within one second.
It will be possible for anyone to maliciously edit their gcode file, but I'm not worried about that user. I'm worried about the user that sliced for some other printer by accident.
Basically that will do what you seek.
A couple of things:
I think the variable will have to be
global
You will need to create the variable in
config.g OR have code in
start.g that creates or sets the variable as needed
The
daemon.g file runs every
10 seconds - unless there has been a recent change I am not aware of
Just FYI it is quite possible to run the same sliced code on different printers. It all depends on how much in the way of printer specific elements are included in the generated code. I use at different times Simplifi3D, Cura, Prusa or ideaMaker and generally I can run any of the sliced code on any of my printers.
Best of luck!
Frederick