Welcome! Log In Create A New Profile

Advanced

Keep PC awake while printing

Posted by dazed.dnc 
Keep PC awake while printing
March 04, 2011 06:05PM
I know you can change the power settings to stop your PC from going into sleep mode/hibernation, but sometimes I forget to turn off my PC before leaving to go somewhere. I also like to leave it on at night to do long downloads. Having it shut off when there is no activity comes in handy once in a while. When I'm printing though, sleep mode stops the print.

I had thought about installing something like mouse jiggler to keep my PC awake during a print. Opening an application seems quicker and less annoying than changing power settings back and forth all the time. Perhaps there is a way to script an application launcher that does it automatically when you launch the printing software instead?

Has anyone else given thought to this? What are some of your solutions?
Re: Keep PC awake while printing
March 04, 2011 09:52PM
Actually it would be nice if the host software (eg: whatever sends g-code to the printer) had a "Shut down PC after print" option.

Best would be to present a timer window that stays on screen for say.... 1 minute, to give you a chance to abort it. I've seen DVD/CD burning software and the like that has this sort of thing built into it for a while now.

If you use one of the command line gcode senders, you could just write up a script (windows batch file or a shell script under linux/mac) that sends the gcode, and once the gcode has been sent, issues a shutdown command.
Re: Keep PC awake while printing
March 05, 2011 06:36AM
open a command prompt window

type in shutdown

Now you should see all the arguments for issuing a shutdown command. Depending on your version of windows you should have different options.

To cancel a shutdown type

shutdown /a
Re: Keep PC awake while printing
March 05, 2011 02:53PM
To do the shutdown thing would require changing the code for the printing application so that you knew when the print was finished. This being a tool-chain dependent change, you should send a feature request to the relevant developer groups.

However, simply keeping the PC awake can be done with a (mostly) tool chain independent script. You just have to change the command that launches your printing application. The advantage of doing it this way is you don't have to manually change your power settings every time you want to print and you don't have to hope that a "keep alive" system is eventually added to your favorite toolchain's native functionality.

I'm not sure I understand what you are getting at with shutdown /a. Does this shut down the hibernation mode until you reboot? Can the script later re-enable hibernation mode? Do you have to supply another argument to tell it which type of shutdown you want to abort? I looked at "shutdown /?" but I'm not really seeing the big picture.

In the mean time, here is what I came up with. It is currently set up to work with my (outdated?) version of the reprap host. However, the concept can be applied to any application as far as I know. It is a batch script that launches MouseJiggler.exe with START /B so that the commands continue processing before MouseJiggler is closed. Next it launches the reprap host. This time the batch script will wait for you to close the window. Finnaly, after the reprap host is closed, it will kill the MouseJiggler program. If you use the Zen mode, having it run in the background does not appear to interrupt normal usage.

One other thing to note, the origional MouseJiggler did not save the state for the "jiggle" checkbox. You had to manually set it even though it would automatically launch. I changed the source code a bit so that the last used state is restored on the next run.

Source code and everything is in the zip file.
Attachments:
open | download - RepRap Host Keep Alive.zip (245.6 KB)
Sorry, only registered users may post in this forum.

Click here to login