Drivers disconnected before dome shutters closed


SGP disconnected all equipment while the shutter was closing so it stopped sinse the dome driver was closed down too, in my opinion it should wait for the driver to report shutters closed and then disconect all gear.
In case of failure to close shutters first time maybe retry up to 3 times and then throw and error and disconnect all equipment?

Link to Logs

Useful Info

OS: Microsoft Windows 10 Pro
.NET: 4.8

1 Like

I had a clear night last night. wo ho!
I was concerned about your issue and I let mine go on unattended. I checked my log files this morning. From the log, it shut down, parked the mount, closed the roof and then disconnected the equipment. I checked my ASCOM log file for the roof, it reported closed 15 seconds after being told to. SGP disconnected equipment one second later. SGP has a log entry that confirms the shutter is closed (roll off roof) from ASCOM and ā€˜continuingā€™. That would indicate there is no simple logic bug here but maybe your ASCOM driver?
Does/did your ASCOM driver support roof status (I think it has to) and did it report closed before or after the equipment was disconnected?

End of sequence script was ran too early, as you can see it was ran even before the mount had reported it was parked.
Actually it was ran at pretty much the same time as the park mount command.
Disconnect equipment was done 28 sec after it started to close, but it had no reported it closed.
The shutter takes around 2min to close.

[02/03/20 06:04:11.257][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: Park message received.
[02/03/20 06:04:11.257][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: Dome slave set to park mount first, parking mount.
[02/03/20 06:04:11.262][DEBUG][Sequence Thread][SQ;PK;] Sending Notification: StatusParkScope - Mount is parking.
[02/03/20 06:04:11.263][DEBUG][Sequence Thread][SQ;PK;] Alnitak Flat Box - Setting Brightness to 0
[02/03/20 06:04:11.264][DEBUG][Sequence Thread][SQ;PK;] End of sequence scriptā€¦
[02/03/20 06:04:11.264][DEBUG][Sequence Thread][SQ;PK;] End of sequence script ā€œC:\ScopeDome\SGP Scripts\UtstyrAv.vbsā€ runningā€¦
[02/03/20 06:04:11.264][DEBUG][Main Thread][SQ;PK;] Adding sequence level notification: Running end of sequence script (UtstyrAv.vbs)ā€¦
[02/03/20 06:04:11.272][DEBUG][Sequence Thread][SQ;PK;] Sending Notification: Status - Running end of sequence script (UtstyrAv.vbs)ā€¦
[02/03/20 06:04:11.273][DEBUG][Sequence Thread][SQ;PK;] Running sequence related scriptā€¦
[02/03/20 06:04:11.273][DEBUG][Sequence Thread][SQ;PK;] RunVbScript: Running script: C:\ScopeDome\SGP Scripts\UtstyrAv.vbs
[02/03/20 06:04:11.321][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: Sending parkā€¦
[02/03/20 06:04:14.326][DEBUG][Main Thread][SQ;PK;] PopulateDataModel: Transferring view to the data modelā€¦
[02/03/20 06:04:14.361][DEBUG][MF Update Thread][SQ;PK;] Performing serializeā€¦
[02/03/20 06:04:34.772][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: Parked
[02/03/20 06:04:34.772][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: closing observatory shutterā€¦
[02/03/20 06:04:34.793][DEBUG][Telescope Thread][SQ;PK;] Dome: Closing Shutter
[02/03/20 06:04:52.275][DEBUG][Sequence Thread][SQ;PK;] End of sequence script ran successfullyā€¦
[02/03/20 06:04:52.275][DEBUG][Sequence Thread][SQ;PK;] Attempting to diconnect equipment, waiting for equipment idleā€¦

What i believe should happen:

  1. All gear is parked
  2. Waiting to make sure all gear is parked, closed etc.
  3. Disconnect gear
  4. Run end of sequence scipt

hmm - just a thought - what are your telescope slave options? Is this a dome? I just wonder if that may be the cause. I think the end of sequence script includes part/shut/shutdown. The question is why mine appears to wait for the roof to close.

[02/05/20 01:17:49.369][DEBUG][Sequence Thread][SQ;] Parking telescopeā€¦
[02/05/20 01:17:49.378][DEBUG][Main Thread][SQ;] Adding sequence level notification: Parking the mountā€¦
[02/05/20 01:17:49.382][DEBUG][Sequence Thread][SQ;] Sending Notification: Status - Parking the mountā€¦
[02/05/20 01:17:49.385][DEBUG][Main Thread][SQ;] Adding sequence level notification: Mount is parking.
[02/05/20 01:17:49.389][DEBUG][Telescope Thread][SQ;] SGM_TELESCOPE_PARK message receivedā€¦
[02/05/20 01:17:49.389][DEBUG][Sequence Thread][SQ;PK;] Sending Notification: StatusParkScope - Mount is parking.
[02/05/20 01:17:49.389][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: Park message received.
[02/05/20 01:17:49.389][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: Dome slave set to park mount first, parking mount.
[02/05/20 01:17:49.401][DEBUG][Sequence Thread][SQ;PK;] Attempting to diconnect equipment, waiting for equipment idleā€¦
[02/05/20 01:17:49.434][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: Sending parkā€¦
[02/05/20 01:18:13.605][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: Parked
[02/05/20 01:18:13.605][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: closing observatory shutterā€¦
[02/05/20 01:18:13.606][DEBUG][Telescope Thread][SQ;PK;] Dome: Closing Shutter
[02/05/20 01:18:31.636][DEBUG][Telescope Thread][SQ;PK;] ASCOM Observatory: Reports shutter is closed, continuingā€¦
[02/05/20 01:18:31.692][DEBUG][Telescope Thread][SQ;PK;] ASCOM Telescope: Parked
[02/05/20 01:18:31.692][DEBUG][Telescope Thread][SQ;PK;] Attempting to stop PHD2 guidingā€¦
[02/05/20 01:18:31.692][DEBUG][Telescope Thread][SQ;PK;] Checking PHD2 stateā€¦
[02/05/20 01:18:31.692][DEBUG][Telescope Thread][SQ;PK;] PHD2 GetPhdStatus - Pre-Wait : Stopped
[02/05/20 01:18:31.692][DEBUG][Telescope Thread][SQ;PK;] Sending to PHD2:
{ā€œmethodā€: ā€œget_app_stateā€, ā€œidā€: 1001}

[02/05/20 01:18:31.793][DEBUG][Telescope Thread][SQ;PK;] PHD2 GetPhdStatus - Post-Wait: Stopped
[02/05/20 01:18:31.793][DEBUG][Telescope Thread][SQ;PK;] PHD2 Guider is already stopped.
[02/05/20 01:18:31.793][DEBUG][Telescope Thread][SQ;PK;] Autoguider (PHD2) stopped Successfully
[02/05/20 01:18:31.793][DEBUG][Telescope Thread][SQ;] SGM_TELESCOPE_PARK message completeā€¦
[02/05/20 01:18:31.793][DEBUG][Telescope Thread][SQ;] Telescope thread is IDLEā€¦
[02/05/20 01:18:32.428][DEBUG][Sequence Thread][SQ;] Equipment is idleā€¦
[02/05/20 01:18:32.428][DEBUG][Sequence Thread][SQ;] Disconnecting all gearā€¦

Yes itā€™s a dome so it has to either close the shutters and then rotate to park or rotate to park and then close the shutters (the driver wonā€™t let both happen at the same time)

Hereā€™s the slaving options of the dome, unticking park mount first might fix the problem, but it still doesnā€™t change the fact that there is logic problem in SGP.

I have a ROR - so the Park Obsy is unticked, otherwise the same. Strange that the behavior is different - my roof takes ~20 seconds to close but it does look like SGP waited for it.
Ken and Jared were in London over the weekend (Astrofest) . If it is a logic issue, Iā€™m guessing it is relatively straightforward to fix.


Maybe I am not understanding somethingā€¦

This is the current behavior.

  • SGPro issues command to close shutter at 2/3/2020 6:04:34
  • SGPro issues timeout on close shutter command at 2/3/2020 6:08:50
  • This is more than 4 minutes (SGPro currently times out at 4 minutes)
  • After the failure, the dome is disconnected at 2/3/2020 6:08:56

I am not sure where you are seeing a dome disconnect 28 seconds later.

Since the shutter stopped 1/3 closed it means it actually started, but stopped either because of powerloss or the driver was closed.
One thing is for sure and that is the end of sequence script which turns of power to most of the gear is set to run before all the gear has parked.
Shouldnā€™t the end of sequence script be ran after 2/3/2020 6:08:56?
In the log you can see the script was ran at the same time the mount was asked to park, if the script actually turned off power to the mount it would have lost power while it was parking.

Oh, OK. I see what you meanā€¦ I somehow misinterpreted or did not understand that the script was to cut power. A recent change in 3.1 altered this behavior and caused the scope park to run parallel to other shutdown actions. This was not an optimization, but rather a precaution based on another issue that, due to some mishap in the scope driver, the hung the sequence and prevented remaining end of sequence actions from executing. That said, I think I have arrived at a solution that will safely block end of sequence scripts from running until the scope is done.

This will be in


  • End of sequence scripts still do not formally support cutting power and may still cause some amount of complaining by SGPro or drivers due to the fact that SGPro will run the script BEFORE disconnecting gear (I think all actions will complete successfully though). In this case, I would recommend that your script perform gear disconnect and then perform power cutā€¦ and then, of course, untick the option to have SGPro disconnect all gear on sequence end.
  • SGPro 4 will simplify this process (assuming your power switches are ASCOM compliant)

That should work, but how do i script that SGP should disconnect gear?

I have a 2M Scopedome. I never had an issue with the end off sequence.
When I get up in the morning the dome is parked and shut. So is the mount.
But I do not disconnect any equipment. I do that when I close SGP in the morning.
Some software close the driver down instead of only disconnecting it.
I leave the dome powered 24/7 because of the heating elements on the gearboxes and electronics.

You will need to use the SGPro API (unless the device in question supports multiple connectionsā€¦ in that case you can do it directly by scripting with ASCOM).