APCC Not Restarting Cleanly


Jerome A Yesavage
 

Hi,

I am using ACP and Expert Scheduler.  Normally after a night's run everything shuts down including APCC but I have never been able to get the ASCOM driver to reliably shut down.  If it is alive APCC does not start cleanly the following night.  To prevent this I look in the Task Manager and end the task if it is still running the following day.  A minor pain but it works. 

Now I not longer see the driver in running Tasks and APCC will not restart saying it cannot create the virtual port... have to reboot the system. 

Is it going under another name or is it one of the runtime brokers...?

Jerry Y

PS  Proud owner of a new ZWO ASI6200M Pro.


Ray Gralak
 

Hi Jerry,

I am using ACP and Expert Scheduler. Normally after a night's run everything shuts down including APCC but
I have never been able to get the ASCOM driver to reliably shut down.
The ASCOM driver will automatically shutdown when all clients are disconnected from it. It's as simple as that. Disconnect all clients, and the driver will close.

That said, I believe that ACP users have been told it is okay to kill applications. This is not a good thing! If you kill an application that is connected to the driver, the driver will not be able to automatically shutdown in the future. That's because the client did not disconnect before it was terminated, so the driver's client client can never count down to zero. So, keep in mind that it's not the driver's fault if you kill an application connected to it.

Now I not longer see the driver in running Tasks and APCC will not restart saying it cannot create the virtual
port... have to reboot the system.
Killing the driver and/or APCC can leave settings in an indeterminate state. If need to shut the driver down manually, double-click the client counter box in the driver's UI. You will get a confirmation prompt, which if you accept will shut down the driver cleanly.

-Ray


-----Original Message-----
From: main@ap-gto.groups.io [mailto:main@ap-gto.groups.io] On Behalf Of Jerome A Yesavage
Sent: Sunday, November 14, 2021 4:10 PM
To: main@ap-gto.groups.io
Subject: [ap-gto] APCC Not Restarting Cleanly

Hi,

I am using ACP and Expert Scheduler. Normally after a night's run everything shuts down including APCC but
I have never been able to get the ASCOM driver to reliably shut down. If it is alive APCC does not start
cleanly the following night. To prevent this I look in the Task Manager and end the task if it is still running the
following day. A minor pain but it works.

Now I not longer see the driver in running Tasks and APCC will not restart saying it cannot create the virtual
port... have to reboot the system.

Is it going under another name or is it one of the runtime brokers...?

Jerry Y

PS Proud owner of a new ZWO ASI6200M Pro.


Jerome A Yesavage
 

Ray,
This is the line in Bob's Shutdown.js:

if(!StopProcess("AstroPhysicsCommandCenter.exe"))
        Console.PrintLine("**Failed to stop AstroPhysicsCommandCenter");

Normally that closes APCC but sometimes the ASCOM driver is left running and if your restart APCC, it will not connect to the ports.  What I have noticed now is that I do not see the driver running and APCC will not start up again without giving me an error about creating the virtual ports.

Is there a "best practices" to do this in the shutdown script?

Thanks,

JY


Ray Gralak
 

Jerry,

APCC has an auto-shutdown option in APCC's Advanced Settings. If you enable that option, APCC will automatically close itself once all clients disconnect from the driver and the driver closes down.

Please take a look here:

https://www.apastrosoftware.com/help/apcc-pro/index.html?advanced_settings.htm

-Ray

-----Original Message-----
From: main@ap-gto.groups.io [mailto:main@ap-gto.groups.io] On Behalf Of Jerome A Yesavage
Sent: Monday, November 15, 2021 8:52 AM
To: main@ap-gto.groups.io
Subject: Re: [ap-gto] APCC Not Restarting Cleanly

Ray,
This is the line in Bob's Shutdown.js:

if(!StopProcess("AstroPhysicsCommandCenter.exe"))
Console.PrintLine("**Failed to stop AstroPhysicsCommandCenter");

Normally that closes APCC but sometimes the ASCOM driver is left running and if your restart APCC, it will
not connect to the ports. What I have noticed now is that I do not see the driver running and APCC will not
start up again without giving me an error about creating the virtual ports.

Is there a "best practices" to do this in the shutdown script?

Thanks,

JY


Jerome A Yesavage
 

Ray,

I realize I have that checked, BUT, I also come to realize that the ACP model script shuts the mount down first, but Maxim and the camera keep running for a while to allow the chip to warm slowly.  Thus, the ASCOM connection between Maxim guiding and APCC must still be up when APCC tries to shut down. 

Would it make more sense to only shut the mount/APCC down after Maxim (and FocusMax which also uses the mount) shut down.  All this can be re-sequenced.  Then nothing would be using the mount when APCC shuts down?

Parenthetically, I also wonder if I can just shut the CMOS camera down more suddenly that my old CCD where the lore was you had to do this slowly. 

Thanks,

JY


Ray Gralak
 

Hi Jerry,

 

> I realize I have that checked, BUT, I also come to realize that the ACP model script shuts the mount down first,

> but Maxim and the camera keep running for a while to allow the chip to warm slowly.  Thus, the ASCOM

> connection between Maxim guiding and APCC must still be up when APCC tries to shut down.

> Would it make more sense to only shut the mount/APCC down after Maxim (and FocusMax which also uses

> the mount) shut down.  All this can be re-sequenced.  Then nothing would be using the mount when APCC

> shuts down?

 

If MaximDL is holding up the driver from closing down, you need to have the script disconnect Maxim from the mount. The script could do this first, then allow Maxim to continue running, warming up the camera.

 

I don’t know if Bob Denny or one of ACP’s users created that script, so if the script author doesn’t know how to disconnect MaximDL from the camera, I believe Maxim’s TelescopeConnected property controls the connection to the mount. Setting this property to False should disconnect Maxim from the scope. For reference, here is a screenshot of the TelescopeConnected property in Maxim’s documentation:

 

 

 

-Ray

 

> -----Original Message-----

> From: main@ap-gto.groups.io [mailto:main@ap-gto.groups.io] On Behalf Of Jerome A Yesavage

> Sent: Monday, November 15, 2021 11:33 PM

> To: main@ap-gto.groups.io

> Subject: Re: [ap-gto] APCC Not Restarting Cleanly

>

> Ray,

>

> I realize I have that checked, BUT, I also come to realize that the ACP model script shuts the mount down first,

> but Maxim and the camera keep running for a while to allow the chip to warm slowly.  Thus, the ASCOM

> connection between Maxim guiding and APCC must still be up when APCC tries to shut down.

>

> Would it make more sense to only shut the mount/APCC down after Maxim (and FocusMax which also uses

> the mount) shut down.  All this can be re-sequenced.  Then nothing would be using the mount when APCC

> shuts down?

>

> Parenthetically, I also wonder if I can just shut the CMOS camera down more suddenly that my old CCD where

> the lore was you had to do this slowly.

>

> Thanks,

>

> JY


Jerome A Yesavage
 

Ray I am still confused since that call is right at the top of the Shutdown Script.

I changed the order of the shutdown so that the last thing powered off is the mount and I still have the driver problem when I restart and have to reboot the computer. 

function main()
{
    var SEQTOK, buf;
    var doDawnCalFrames = false;
    
    FSO = new ActiveXObject("Scripting.FileSystemObject");

    Console.LogFile = Prefs.LocalUser.DefaultLogDir + "\\Scheduler\\ShutdownObs-" +
                Util.FormatVar(new Date().getVarDate(), "yyyymmdd") + "@" +
                Util.FormatVar(new Date().getVarDate(), "HhNnSs") + ".log";
    Console.Logging = true;

    
    //
    // Similar to shutdown logic in AcquireSupport.wsc
    //
    
    if(Telescope.Connected) {
        Console.PrintLine("Parking scope 2");
        Telescope.Park();                                               // Park the scope if possible, and/or close/park dome
        Console.PrintLine("OK");
        if(Telescope.Connected) {
            Console.PrintLine("Disconnecting Scope 2");
            Telescope.Connected = false;
        }


Ray Gralak
 

Hi Jerome,

Ray I am still confused since that call is right at the top of the Shutdown Script.
They can be two separate connections to the telescope - one from ACP and the other from MaximDL. In your script, I see that ACP is disconnecting from the telescope, but I do not see a call disconnecting MaximDL from the telescope.

Have you posted about this issue to the ACP forum? If there is a question of what needs to be done, have Bob Denny contact me.

-Ray


-----Original Message-----
From: main@ap-gto.groups.io [mailto:main@ap-gto.groups.io] On Behalf Of Jerome A Yesavage
Sent: Tuesday, November 23, 2021 1:43 PM
To: main@ap-gto.groups.io
Subject: Re: [ap-gto] APCC Not Restarting Cleanly

Ray I am still confused since that call is right at the top of the Shutdown Script.

I changed the order of the shutdown so that the last thing powered off is the mount and I still have the driver
problem when I restart and have to reboot the computer.

function main()
{
var SEQTOK, buf;
var doDawnCalFrames = false;

FSO = new ActiveXObject("Scripting.FileSystemObject");

Console.LogFile = Prefs.LocalUser.DefaultLogDir + "\\Scheduler\\ShutdownObs-" +
Util.FormatVar(new Date().getVarDate(), "yyyymmdd") + "@" +
Util.FormatVar(new Date().getVarDate(), "HhNnSs") + ".log";
Console.Logging = true;


//
// Similar to shutdown logic in AcquireSupport.wsc
//

if(Telescope.Connected) {
Console.PrintLine("Parking scope 2");
Telescope.Park(); // Park the scope if possible, and/or close/park dome
Console.PrintLine("OK");
if(Telescope.Connected) {
Console.PrintLine("Disconnecting Scope 2");
Telescope.Connected = false;
}


Bob Denny
 

I know this is old, sorry it's  been on my queue too long:

They can be two separate connections to the telescope - one from ACP and the other from MaximDL. In your script, I see that ACP is disconnecting from the telescope, but I do not see a call disconnecting MaximDL from the telescope.
MaxIm, when used with ACP never connects the Telescope (or anything else!) in its own Observatory Control. ACP is in charge of slewing the scope etc. However, if the guider uses Pulse Guiding, then MaxIm will use a connection from the guider logic ("ASCOM Direct") only for the purpose of providing guiding corrections. In this case, connecting and disconnecting the Camera (MaxIm's CCDCamera object) results in connecting and disconnecting from the telescope. In Jerry's case

        Camera.LinkEnabled = false;
        Util.CameraConnected = false;            // Disconnect it from ACP
        Console.PrintLine("OK, imager shutdown complete.");

Is releasing MaxIm's connection to the telescope.

I need to review with Jerry though, on how he is getting his "dangerous low hjanging rolloff" closed safely. I believe you changed (rightly) Park() from sync to async, right? His script may be trying to disconnect the telescope while it is still parking. I'll let you know.


Ray Gralak
 

Hi Bob,

I know this is old, sorry it's been on my queue too long:
Camera.LinkEnabled = false;
Util.CameraConnected = false; // Disconnect it from ACP
Console.PrintLine("OK, imager shutdown complete.");

Is releasing MaxIm's connection to the telescope.
The problem is that Jerry says he has to kill APCC because it is not exiting. Jerry indicated he has APCC set up to automatically shut itself down when all connections are closed. APCC can take a short amount of time to close down but there should never be a need to kill it. So, either an application has not disconnected from the AP ASCOM driver, or the script is not giving APCC enough time to close down. APCC has a configurable auto-shutdown timer that can be reduced to as low as 1-second.

I need to review with Jerry though, on how he is getting his "dangerous low hjanging rolloff" closed safely. I
believe you changed (rightly) Park() from sync to async, right? His script may be trying to disconnect the
telescope while it is still parking. I'll let you know.
Yes, Async Park() is an option in the driver's setup.

-Ray


Jerome A Yesavage
 

Guys, I checked my shutdown scrip and it was written before 2018... Bob's latest version has the bad code removed but it was in my legacy script.... updating ACP changes the model script but not the one is use...  Fixed and tested twice and it works. 

My safety issues are a PITA.... unfortunately I have to use a ROR as that is the only thing I can put up on my own roof legally where I live.  Anyway, if I use the automatic closure I have the pier lowered (fixed) below what the roof can hit.  This unfortunately limits my lowest Alt to about 45 DEG.  What I have done to get lower Alt safely is fully disable the roof in ACP and then run the pier up manually and open and close the roof Manually... I have to keep my wits about me... but I can get down to 12 DEG above the S horizon.  In this case the Mach1 goes into Park 5 and gets under the roof.  I watch it with video....

Nothing is simple. 

I cannot find a failsafe way to run the Pier-tech roof and pier in concert.... in theory this is possible.... but I have never gotten it to work reliably.  Vito says people do it with additional position sensors and I have see photos, but that makes my palms sweaty.

Cheers and Happy Holidays.