For power off I think it would be a good idea to move that in a @func like in start here and call it with a delay, so server can finish and after being finished storing everything etc. it gets shut down with a delay. Also helps head cooling faster when fan is on. Some printers control it by temperature to prevent heat rising when hot.
But I still wonder what @execute does different as I assume it just switches off power in a script and exits.
Yeah I really don't have a clue. All my @execute command did was send a GPIO pin high or low. Another quick question which is likely pertaining to what you had mentioned about shutting the printer off so quickly. After a print I have it shut printer off w/o any delay, would that likely be causing each time-lapse to say failed despite all completing properly? I can play each of them just fine to the end also. Disregard some of them not showing a preview, I had changed port of camera for some other testing.
Timelapse storing/rendering happens at the end of job signal, so shutting down directly will maybe make it marked as killed. Anyhow rendering should still start if you do not unpower pi as well. With timeout it should start in any case. If you have no images due to stopping to early you get no preview image and conversion will fail due to lack of images.
Code example looks good, also PowerOffPrinter is better before using it. With the delay it will most likely work as it should be generated after 10 seconds, so more style issue.
The render works as designed, it's just that all jobs say failed. I have to assume it's because I am not delaying the printer from turning off. I will test that theory and report back. I changed my order of the code just to make you feel better . Does the function generally go above the call? I wasn't sure if the function had to go after the call to be aware it existed.
We test when the timer gets triggered for the function. Actually the timer just adds a @call function when the time is ended. @func functions are kept in memory until they get overwritten by a new one with same name, so you can also add it in run on activate if you only want it at one place except the timed call of course.
So unfortunately that 10 second delay didn't fix the issue w/ the time lapse saying it failed under the size column. I did confirm it waited 10 seconds before powering off. It goes from converting to failed shortly after but I can click the eye and view the time lapse. Very strange. The image below is the same job just two screenshots atop each other.
perfect thanks. I thought i had seen a setting at one point for that just wasn't sure where. At some point i'll revisit an issue w. M600 I have. I'll create a separate post for that but it seems whenever an M600 is called when printing via repetier it doesn't process the command unless my start gcode includes M412 H1 S1. Oddly if i print same GCODE w/ sdcard the FW handles M600 as it should (Lift printhead, move build plate out of the way, etc) When printing via repetier it just pauses the print instead of letting printer FW handle w/o that GCODE
I think it is normal depending on your firmware config to handle M600 that way. It can be handled inside firmware or in server but server has to know. M412 just tells marlin to do that. For a while we had this even in our connect code, but that caused issues with some firmware configs so you need to add it in connect script to handle it in server.
I think it is normal depending on your firmware config to handle M600 that way. It can be handled inside firmware or in server but server has to know. M412 just tells marlin to do that. For a while we had this even in our connect code, but that caused issues with some firmware configs so you need to add it in connect script to handle it in server.
Yeah, we had discussed it here on my other printer last year and removing the M412 actually FIXED that printers M600 behavior on my duplicator i3. On that printer I had to put M600 in the run on pause for it to actually run the filament out command until you removed the M412 command. On this one it breaks it unless my start GCODE has the the M412 command to tell repetier to handle the pause on filament runout So this is likely just due to differences in the FW on the two printers?
Just trying to understand the difference in behaving on one printer vs. the other when both print via repetier server. What confuses me is if i slice the print w/o the M412 command and print via sd card it will handle the pause/M600 properly. What is it that changes when I print it via server? Because to make it work w/ my M412 H1 S1 I am, in essence, telling repetier server to handle the pause NOT the FW correct? And then i have to define what it does on pause still in the run on pause script. I guess at the end of the day I'm just curious why the pause M600 command will not work UNLESS I tell repetier server to handle it (M412 H1 ) rather than marlin (M412 H0). However, If I print from server and let marlin handle it, it won't work (M412 H0) . HOWEVER if I just take that gcode and print from SDcard (with no M412 command at all) the FW handles the pause/M600 situation perfectly.
That is probably a very confusing paragraph to you but it makes perfect sense to me
Ok, a bit confusing in deed but I think I see it. For firmware it makes a big difference if you are printing a file from sd card or if same commands come from serial. In fact some firmwares without M412 can have out of filament detection for sd print and for serial print they won't even give a sign that filament is out. For them serial commands never belong to a print job and never pause/run out of filament. That is actually what M412 solves - it tells firmware what is now coming should be treated as print job and handle out of filament internally/externally.
Thanks. I'll use OOF for out of filament to save typing it 10 times. I am going to try to word this a bit more clearly. The duplicator FW I run (custom FW) does have OOF detection and will allow the FW OOF process to run perfectly when printing from server w/o any additional M412 or M600 commands added. The Kobra Max is also running a stock firmware which has OOF detection but strangely (Only when printing from server) unless I do add that M412 H1 to start gcode and then the M600 in run on pause gcode in server the OOF process does NOT run, printer just pauses where it is. If I strip all server function out of it by printing w/ the SD card and letting printer FW handle everything the OOF process runs as expected. I would "assume" running M412 H0 that would prevent server from doing anything right? That doesn't exactly seem to be the case as if the printer FW was allowed to do what it wants to do during OOF (Which is does w/ an SD card) it would raise print head and move print bed out of the way to load new filament. Server is just pausing the print rather than just letting the FW handle the OOF event. So to me it seems the M412 H0 command isn't actually allowing the FW to handle the OOF event. Would the M412 H0 have to be defined at the start of each print? Is run on connect the best place to place it rather than start gcode in Cura? Perhaps that's my issue but I don't think so from my testing.
First you should not send M600 for filament change - this is firmware side filament change. Send @outOfFilament for server side filament change.
Second, M412 handles notification to server, not necessarily disabling it. Especially since we send g-codes telling marlin that a print is in progress it might decide to handle it internally and just block server communication until filament is changed since H0 was set. The problem is that over time there had been so many variants that you can not in general say that firmware does it this way. It depends on how firmware was configured, which version and with manufacturer versions also if they made own changes to default solution.
The FW i am using (Based on Marlin 2.0.8) sends the M600 for OOF which is why I was replicating it. Right now if I do #2 listed below (using M600) everything works (Print head moves up and away from print) but it's not ideal as I'd just rather the FW handle the OOF pause rather than server (Not reliant on start GCODE and run on pause script) but I cannot seem to find out how to do so.
As of right now, the only way the OOF routine will run (Raise print head and move away from print and not just pause atop the print) on my kobra max is by doing one of 2 things.
1. Printing from the cura generated GCODE (Not using server at all) 2. Adding M412 H1 S1 to start gcode AND M600 to the server activate on pause script. If i don't do this when OOF is detected the print will just pause with printhead atop print. It's like repetier sees the pause and just pauses the print rather than letting the firmware handle the OOF pause.
I would be more than happy if server would just pass the pause command onto the printer FW to handle the event but it doesn't seem to. It just seems to handle the OOF pause and awaits further commands once printer is back online. It does that even if I had M412 H0 S1 to have FW handle instead of server but as you said this may just be notification rather than actually ignoring commands. At least I assume that is what M412 H0 S1 is doing.
#2 server does what you write. You can also add a move to side or raise z (@moverel Z5 F600) or retract filament a bit aside. That is up to you. I assume M600 triggers end of filament handling blocking server until finished. How depends on current active settings.
#2 server does what you write. You can also add a move to side or raise z (@moverel Z5 F600) or retract filament a bit aside. That is up to you. I assume M600 triggers end of filament handling blocking server until finished. How depends on current active settings.
Right, and that is what is confusing to me. By design, when OOF occurs the FW calls an M600. However server doesn't allow the printer to get to that point during a pause. I know this because when I an OOF when printing via sd card the M600 is called correctly but in server it just sits there on pause when an OOF event occurs. That is why I am confused because AFAIK repetier should just allow the printer FW to handle the OOF pause if I don't tell it to handle it w/ an M412 command right? Sorry for all the confusion and questions, i'm just trying to wrap my head around what is happening. One thing that may or may not be related is that when I pause a print from the touch screen on printer it doesn't pause, or perhaps has a ton of data buffered and is just taking a long time to pause. My other printer doesn't do this w/ server, it'll pause much quicker. Perhaps reducing buffer or something similar would help w/ my OOF issues here? Dave
Maybe best is to show a log where this happens to see what firmware and server really do. E.g. there is also a solution where firmware posts a dialog for the server to show, but will not except any commands except some listed in their emergency commands which select dialog choices. When you say it does not react this might be the case also you should see then a change filament dialog in server since we support host dialogs.
Comments
Code example looks good, also PowerOffPrinter is better before using it. With the delay it will most likely work as it should be generated after 10 seconds, so more style issue.
version: 4.3.6-0+deb11u1+rpt3
Path: /usr/bin/ffmpeg (not /usr/bin/avconv)
Dave
Just trying to understand the difference in behaving on one printer vs. the other when both print via repetier server. What confuses me is if i slice the print w/o the M412 command and print via sd card it will handle the pause/M600 properly. What is it that changes when I print it via server? Because to make it work w/ my M412 H1 S1 I am, in essence, telling repetier server to handle the pause NOT the FW correct? And then i have to define what it does on pause still in the run on pause script. I guess at the end of the day I'm just curious why the pause M600 command will not work UNLESS I tell repetier server to handle it (M412 H1 ) rather than marlin (M412 H0). However, If I print from server and let marlin handle it, it won't work (M412 H0) . HOWEVER if I just take that gcode and print from SDcard (with no M412 command at all) the FW handles the pause/M600 situation perfectly.
That is probably a very confusing paragraph to you but it makes perfect sense to me
Dave
Dave
Second, M412 handles notification to server, not necessarily disabling it. Especially since we send g-codes telling marlin that a print is in progress it might decide to handle it internally and just block server communication until filament is changed since H0 was set. The problem is that over time there had been so many variants that you can not in general say that firmware does it this way. It depends on how firmware was configured, which version and with manufacturer versions also if they made own changes to default solution.
As of right now, the only way the OOF routine will run (Raise print head and move away from print and not just pause atop the print) on my kobra max is by doing one of 2 things.
1. Printing from the cura generated GCODE (Not using server at all)
2. Adding M412 H1 S1 to start gcode AND M600 to the server activate on pause script. If i don't do this when OOF is detected the print will just pause with printhead atop print. It's like repetier sees the pause and just pauses the print rather than letting the firmware handle the OOF pause.
I would be more than happy if server would just pass the pause command onto the printer FW to handle the event but it doesn't seem to. It just seems to handle the OOF pause and awaits further commands once printer is back online. It does that even if I had M412 H0 S1 to have FW handle instead of server but as you said this may just be notification rather than actually ignoring commands. At least I assume that is what M412 H0 S1 is doing.
Dave
Dave