Auto Connect and Start Sequence

For me the situation is a little different, my observatory and telescopes are located in different timezone, so I have to get up at 3am, login to remote desktop, start SGP, click ‘Connect All equipment’, and press the ‘Run Sequence’ button, watch for everything going well, then go back to sleep, this is a real pain for me, I searched google, SGP forum, I found nothing can help me.

Month later, I decided to solve it by myself. What I need is, at the setting time, automatically start SGP, connect all equipment, if everything goes well, start the sequence I specified.

After several weeks coding and debugging, I did it, and I’ve been using it for auto imaging for over a month, now I don’t need to get up at 3am any more, it saved me a lot of time to sleep.

Currently it’s a command line tool without UI.

I’m not sure how many people have the similar pain like me, I’m not sure if I need to keep upgrading this tool, so if I may, I’d like to build a survey here, let the numbers tell the answer.

  • Yes I need it !
  • No, it never bothers me.
  • It depends
0 voters
1 Like

I have a similar need. Given the appalling weather here, I want my observatory system to be set up so that each evening at dusk it automatically powers up, connects all the equipment and then images during any safe periods that arise overnight before disconnecting the equipment and powering down at dawn. This 24/7 365 day a year automation looks straightforward to achieve in N.I.N.A. using its Advanced Sequencer and Task Scheduler but I have not been able to find a way to do it in SGPro. I would like to use SGPro if possible.

I would like to vote but I’m not sure I understand how your script is different function than what is available in SGP? Can you provide some additional detail?

In the past I’ve been able to set a sequence start time and then “Run Sequence” - SGP then connects to equipment before saying something like “waiting for start time”. It does not open dome or slew telescope etc. until the start time arrives.

Edit - further to this, if you have a safety device that detects daylight, you could start a sequence any time during daylight, and SGP will immediately go into “safe mode” - and then wait until it is dark before continuing the sequence (no need to set a start time).


If your safety device can measure “brightness” (day/night) as well as cloudy/clear, then you should be able to achieve this already with SGP. I have been playing around with this for the last few years with growing success (using AAG Cloudwatcher).

My main challenge has been getting SGP to capture flats along the way (ie. if it turns cloudy but still dark, capture panel flats). I try to capture flats any night I have captured images which admittedly is perhaps a bit unrealistic. I’m currently playing with Autoflats for this - has potential I think but there are kinks to work out.

In the past, I have successfully set a sequence to run, and it ran without my intervention for a few days (ie. detecting when it was clear and dark in the evening, and then capturing images - closing up when cloudy or morning light).


@dnube is your solution setting in the time and coordinates dialog, and click the “Run Sequence” button?
If yes it’s not working for me, I don’t want to click that button at 3am everyday. If no, could you please give some hints to me how to do this?

Have not done this since the Fall, but I believe I set the start time for the first (active) target in the sequence. And then just ‘Run Sequence’ as normal.


Understood, I know that function in SGP and it still needs a manual click, in my situation it’s a pain, so my solution is totally automatic, I don’t even need to login the remote desktop.

Thank you for your reply, now I know I’m not alone lol

Currently my tool can only started by timer which is configured in a local file, after the sequence started, its job is done, so I guess it cannot help you to monitor the weather and start imaging whenever possible during the whole night, however, it’s not hard to make it happen with this tool’s framework. On the other hand, I think the auto recovery in SGP can do this for you.

I’ not a NINA user, but thank you for the information about the Task scheduler, I will do some research on it.

Glad you’ve got a solution that works.

I’m just curious … when trying to use SGP natively for “future start”, what manual click do you encounter (ie. is it a specific pop-up window/prompt)?


Not a pop-up dialog, it’s the button we usually use to start the sequence, on both main window and the sequencer panel, and maybe connect all equipment as well.
Not sure if there is any settings I don’t know in SGP that can automatically connect all equipment and start the sequence without any click , please teach me :laughing:

The “Restart on Safe” functionality does a lot of this and is likely what dnube is using to accomplish running for multiple days. You can start the sequence well a head of time and it will just sit there and wait until your target start time is reached and the Safety Device says you’re good to start imaging.


This basically allows SGP to image when it is safe to and shutdown and wait when it is unsafe.



I presume you mean the “Run Sequence” button lower right of the Sequencer window? And the “Run Sequence” button on the “Sequence Summary” docking module?

Are you saying the button is greyed out or not responding at all when you click it?

You can do a “Run Sequence” without equipment connected, and SGP will “Connect All Equipment” for you. It will even start PHD2 app for you, and do a “Connect All” within PHD2. In fact it is better to let PHD2 be started by SGP, than for PHD2 to already be running (in my experience anyway - if PHD2 is already running, sometimes SGP will fail to talk properly to it, and sequence aborts).

If for example it is cloudy when I go to bed but going to be clear by later in the evening, I will set a target start time, make sure it is the next target in the sequence and then “Run Sequence”. At this point, SGP will do a Connect All Equipment and also open PHD2 and “Connect All”. It will then identify that it has to wait until the target start time (status says “waiting until xx:xx to start sequence” - or something to that effect). At that point, I can go to bed (and hope for the best!). SGP will cool the camera (if it is configured to “cool on connect”) but it will not open the dome, open the flip-flat or slew the telescope until the target start time is reached.

That’s been my experience anyway. This is done with equipment in same timezone (back yard!) but via RDP. If the above doesn’t work for you then perhaps it needs to be raised as a ticket.


Thank you Jared for the introduction, for me it’s not working because there is no safety device in the observatory, the roof is opened and closed manually, besides it still needs to start SGP first and click then the Run Sequence button? please correct me if my understanding is wrong, but maybe it helps @Alistair_MacDonald

Thank you Dave so much for the detailed reply, unfortunately it can’t release my pain, because I still need to login to the remote desktop, start SGP and then click the Run Sequence button at 3am everyday(my equipment is in different time zone).

Technically I can start SGP and click the button at 10pm before I go to sleep, that’s 2pm local time, the problem is I don’t want my equipment keep waiting with power on everyday in whole year, I guess this is not a common situation :joy:

You might want to check this out as well:

This solution is said to allow completely autonomous operation by a remote observatory

Thanks Dave, very helpful. I have the AAG CW. How do you get SGPro to go into unsafe mode due to light at dawn and wait for the duration of the day before starting again when dark rather than running the end of sequence options?

Many thanks Jared. Thinking it through some more, am I correct that this also means that the method will only work for targets whose end time could be set after dawn, to ensure the system runs into unsafe light whilst still imaging on the target?


Hi Alistair,
The AAG Cloudwatcher has a light sesnor for measuring brightness (as well as IR sensor for cloud detection, rain sensor etc.). You just need to make sure that the sensor is calibrated properly to recognize dark vs light vs very light (Limits tab) and that AAG will consider it unsafe when either Light or Very Light.

Here is a sample graph showing “brightness” change from day to night (in this case it is night/dark but cloudy conditions are triggering the unsafe status).

SGP safety device config:

As for setting end time after dawn - I guess that is true. But perhaps you could also experiment with not setting an end time at all. Or set end time based on whether it becomes too close to the horizon.


HI @Jared
Thanks for highlighting that - I am indeed using a safety device and “restart-on-safe”.

Correct me if I’m wrong, but I think a simple “delayed start” (set start time for first target) would still work even if there is no safety device/restart-on-safe involved?


Many thanks Dave. I am conversant with the features of the AAG and it has been operating pretty much non-stop on the observatory for five years or so (which I think is pretty impressive for an outdoor instrument).

What I am finding it difficult to understand is how to reliably manage in SGPro the transition from night to day and day to night each day without intervention.

In NINA there is the ability in the Advanced Sequencer to set a power up / connect all equipment at dusk container, an imaging container and a disconnect all equipment / power down at dawn container, which just endlessly cycle day after day and is set up to open the roof and image whenever it is dark and clear. The NINA Task Scheduler plug-in ensures the targets are dealt with in the optimum order having regard to elevation, moon angle, priority etc.

I would like to accomplish this in SGPro as I find it far more user friendly than NINA and have been using it without major issues for years. It looks like that not setting an end time or ensuring any end time is after dawn is the best way of doing this.

Many thanks for your help.