Is it possible to have SGP close automatically at the end of the evenings sequence? Not just disconnect, but actually close.
I’m using a new computer and some program is staying open and not allowing the computer to go to sleep if SGP remains on the screen, even if all the equipment is disconnected. I’ve searched for the trouble maker with no success. Clicking SGP closed fixes the problem.
So I’m in the dark ages with script, etc. However, there is a box to check on Sequence Settings to run end of sequence scripts. Is that where I would put this script?
Thanks for replying!
John
Yikes! Task killing would work but a more orderly save and close after disconnect option works for me. Handy for remote work when you want to run an orderly power down before sunrise.
Thanks Ian,
But how do I have the computer do a Save and Close of SGP on its own, after the end of sequence?
Usual end of sequence time is around 3AM, and I’m sleeping.
Actually, a better way is to leave the /F flag off the command. This will allow the app to do a graceful shutdown. If you do this for the first time you may be presented with the pop-up stating, ‘the data in the sequence has changed, do you want to save this sequence’. I selected yes and also checked the ‘don’t show again’ box (this only has to be done once).
After a few seconds, SGP shuts down.
Below is a screen shot.
There are other tasks you will want to gracefully shutdown too like ASCOM processes and other astro related apps before shutting down (or sleeping) Windows. You can get the app names in the task manager. Just append .exe to the process names when running a script. The timing of shutdowns should be the other astro related apps ahead of SGP leaving SGP as the last astro process to end, followed by the system shutdown command.
Nonetheless, I believe the SGP folks may want to chime in on this method.
Thank you guys for looking into this problem! I don’t know anything about scripts, but if you find a way to make the shut down work, and post a script that I can copy onto my computer, that would be great!
I too am surprised that the SGP guy hasn’t suggested an answer.
I’ve been using SGP for several years now and like it, but a friend suggested I download NINA and give it a try…
This is the tail end of the bat file prepared today and tested:
I shut down other processes before SGP. I left out the /F flag so as to have a graceful shutdown instead of a kill -9 type of effect.
One drawback when testing with all the gear connected was the script started to run after the target was completed and while the camera was in the warm cycle. SGP was terminated before the warmup cycle was completed. I could add a longer timeout value greater than the CCD warmup period before shutting down SGP. This will take more testing.
echo “Shutting down iOptron Commander” @echo off
Taskkill /IM “iOptron Commander 2017.exe”
timeout 4 > null
echo “Shutting down ASCOM Simulator Server” @echo off
Taskkill /IM “ASCOM.Simulator.Server.exe”
timeout 4 > null
echo “Shutting down SGP” @echo off
Taskkill /IM “Sequence Generator.exe”
timeout 4 > null
I did try NINA out of curiosity but soon went back to SGP for its better features.
Hi folks, yesterday night i tested all we described here. It works with one minor issue. When Sequence complited and telescope park, the script runs imidietely and does not wait for camera warming. Apart from that all works OK
That’s what I encountered too.
The best workaround is to put a sleep period larger than the camera warmup period before shutting down SGP.
Below is an example based on a 10-minute camera warmup window that includes an additional minute (660 seconds)
echo “Shutting down ASCOM Simulator Server” @echo off
Taskkill /IM “ASCOM.Simulator.Server.exe”
timeout 4 > null
echo “Shutting down SGP in 11 minutes after the camera warmup completes” @echo off
timeout 660 > null
echo “Shutting down SGP” @echo off
Taskkill /IM “Sequence Generator.exe”
I tried enabling Run script at sequence end, while the Disconnect all equipment at sequence end is always enabled.
It looks the script runs before disconnect the equipment.
I have to add the task in Windows task scheduler as a workaround to close PHD2 and SGP, for allowing the equipment to disconnect, before closing the applications, instead of triggering the script from SGP sequence end actions.
Ken, Would it be possible for you to take a look at my original question, and answer if there is a way to close SGP at the end of a session.
Thank you, John