Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jan 2018
    Location
    Louisa, VA
    Posts
    360

    Default Shutdown doesn't allow proper closure of APCC virtual ports

    Maybe I'm the only one with this problem or maybe everyone else figured it out a while back, but ShutdownObs.js does not seem to allow APCC to properly close its virtual ports. Each time APCC restarts, it has to create new, higher numbered virtual ports and the older ports remain "active" and unuseable. After some advice from Ray G. at A-P, I modifed APCC to auto shutdown after disconnection (this is a choice in the "advanced" tab of APCC). I then modified ShutdownObs.js so that it does not shut down APCC. As soon as ACP disconnects from APCC, APCC starts its own autoshutdown routine and closes automatically, properly closing the virtual ports. So far, this seems to have fixed the problem.
    Astro Physics 92mm Stowaway

    Tech. Innovations 10' Pro Dome
    Astro Physics 1600-AE mount
    PlaneWave 17" CDK scope
    QHY600PH M CMOS camera
    SBIG AO-X adaptive optics
    SBIG StarChaser guider
    Maxim-DL / The Sky X
    FocusMax / CCDInspector
    ACP Expert

  2. #2
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,292

    Default Shutdown doesn't allow proper closure of APCC virtual ports

    Perhaps the ShutdownObs script needs something specific to APCC to accomplish a graceful shutdown. The “off the shelf” ShutdownObs script knows nothing about any mount specifics (and mostly neither do I haha). It is just a starting place. At this point, Astro-Physics is the place to go for info. If they need to contact me for help I will be back the 28th.

    Maybe someone else here has already made the customizations for orderly APCC Shutdown.
    -- Bob

  3. #3
    Join Date
    Apr 2013
    Location
    Milton, ON, Canada
    Posts
    1,028

    Default

    I suspect the issue is the StopProcess code is killing the task without the task closing gently. I don't know enough MS code to write that up. eg send a Quit / Exit to apcc, instead of just stopping its process.

  4. #4
    Join Date
    Jan 2018
    Location
    Louisa, VA
    Posts
    360

    Default

    Quote Originally Posted by Colin Haig View Post
    I suspect the issue is the StopProcess code is killing the task without the task closing gently. I don't know enough MS code to write that up. eg send a Quit / Exit to apcc, instead of just stopping its process.
    Agreed. The current StopProcess works fine for FocusMax and Maxim-DL. I'm sure Bob doesn't want to (and shouldn't have to) write a bunch of hardware specific shutdown routines, but it may be possible to modify the current single routine to be more "gentle" one, ie. "Exit" v. "Shutdown". For now, having APCC do an auto-shutdown seems to work fine. If code modification isn't feasible then a note about this issue in the ACP help files would be good.
    Astro Physics 92mm Stowaway

    Tech. Innovations 10' Pro Dome
    Astro Physics 1600-AE mount
    PlaneWave 17" CDK scope
    QHY600PH M CMOS camera
    SBIG AO-X adaptive optics
    SBIG StarChaser guider
    Maxim-DL / The Sky X
    FocusMax / CCDInspector
    ACP Expert

  5. #5
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,292

    Default

    The Shutdown Obs is an external script because it, and StartupObs, are often customized for device specific handling. The ASCOM interfaces are strictly for routine operations, not initialization, servo currents, encoder ticks, PEC, pointing enhancers, etc. that have virtually infinite variety. Whatever is needed by the AP software before killing the process(es) should be there.
    -- Bob

  6. #6
    Join Date
    Jan 2018
    Location
    Louisa, VA
    Posts
    360

    Default

    Quote Originally Posted by Bob Denny View Post
    The Shutdown Obs is an external script because it, and StartupObs, are often customized for device specific handling. The ASCOM interfaces are strictly for routine operations, not initialization, servo currents, encoder ticks, PEC, pointing enhancers, etc. that have virtually infinite variety. Whatever is needed by the AP software before killing the process(es) should be there.
    Bob, we're on the same page. I was just curious if there was another kinder/gentler call in the WMI playbook to allow closing an external program, but on quick review, as best I can tell, terminate() is the only way. So clearly this is out of your control. I've sent a note to Ray G. on the APCC forum to at least put in a plug for dealing with this at some point in the future, even though using APCC's auto-shutdown solves the problem in another way. It would certainly be cleaner if terminate() worked properly.
    Astro Physics 92mm Stowaway

    Tech. Innovations 10' Pro Dome
    Astro Physics 1600-AE mount
    PlaneWave 17" CDK scope
    QHY600PH M CMOS camera
    SBIG AO-X adaptive optics
    SBIG StarChaser guider
    Maxim-DL / The Sky X
    FocusMax / CCDInspector
    ACP Expert

  7. #7
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,292

    Default

    Terminate() is unclean. Every effort to clean things up like parking a scope, disconnecting the scope from ACP, should be done. I would ask AP what the nice way of shutting down is. I’m sorry I don’t already know. It’s the first I’ve heard of the problem you’re having.
    -- Bob

  8. #8
    Join Date
    Jan 2018
    Location
    Louisa, VA
    Posts
    360

    Default

    Quote Originally Posted by Bob Denny View Post
    Terminate() is unclean. Every effort to clean things up like parking a scope, disconnecting the scope from ACP, should be done. I would ask AP what the nice way of shutting down is. I’m sorry I don’t already know. It’s the first I’ve heard of the problem you’re having.
    Bob, Here's a thread from last year with the same problem.

    forums.dc3.com/showthread.php?10860-Clean-Shutdown-of-APCC

    Ray G. at Astro-Physics says terminate( ) doesn't "warn" APCC that it's going to shutdown so APCC doesn't have time to disconnect the virtual serial ports. (I'm over my pay grade here!). :-)
    The other forum thread above suggests that this problem appeared with a newer version of APCC.

    As I mentioned earlier, I just commented out the code in ShutdownObs.js to shutdown APCC and let it auto-shut after it's disconnected. On a quick look, it appears that's what the other individual did in the code shown in the above link.

    Thanks, Happy Holidays and New Year!
    Astro Physics 92mm Stowaway

    Tech. Innovations 10' Pro Dome
    Astro Physics 1600-AE mount
    PlaneWave 17" CDK scope
    QHY600PH M CMOS camera
    SBIG AO-X adaptive optics
    SBIG StarChaser guider
    Maxim-DL / The Sky X
    FocusMax / CCDInspector
    ACP Expert

  9. #9
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,292

    Default

    Good find.... thanks for taking the time to dig for it. I didn’t remember it (no surprise I guess). We can catch up when we return.
    -- Bob

  10. #10
    Join Date
    Jan 2018
    Location
    Louisa, VA
    Posts
    360

    Default

    Quote Originally Posted by Bob Denny View Post
    Good find.... thanks for taking the time to dig for it. I didn’t remember it (no surprise I guess). We can catch up when we return.
    No problem. Enjoy your vacation. When you get back, you might consider the following response that I got from Thomas Swann on the AG GTO forum when I suggested that maybe terminate( ) was the only way to externally close a program.

    RE: "it looks like the only way to close a program externally from another Windows program (like ACP) is to call the WMI function, terminate()"


    "You can acquire the handle for the application's main window and send it a WM_CLOSE message using either SendMessage or CloseWindow. That will terminate the process in the same way as pressing the "X" in the title bar. If you're using powershell you can get at all the Win32 functions by importing user32.dll." Now that I think back on it, I think I used this MANY years ago when I was writing some C++ code. My skills have atrophied!

    Just a thought. Don't know if it's workable or worth pursuing.
    Last edited by Stacey E. Mills; Dec 25, 2018 at 00:20. Reason: grammatical correction, extra text
    Astro Physics 92mm Stowaway

    Tech. Innovations 10' Pro Dome
    Astro Physics 1600-AE mount
    PlaneWave 17" CDK scope
    QHY600PH M CMOS camera
    SBIG AO-X adaptive optics
    SBIG StarChaser guider
    Maxim-DL / The Sky X
    FocusMax / CCDInspector
    ACP Expert

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Clean Shutdown of APCC?
    By Samuel Lising in forum Hardware/Software/Driver Topics Not Directly Related to Our Software
    Replies: 12
    Last Post: Aug 20, 2017, 01:57
  2. Roof Doesn't Close on #Shutdown
    By Timothy Cann in forum Hardware/Software/Driver Topics Not Directly Related to Our Software
    Replies: 6
    Last Post: Jul 7, 2015, 16:47
  3. Reseting com ports in ASCOM
    By Michael Miller in forum Hardware/Software/Driver Topics Not Directly Related to Our Software
    Replies: 4
    Last Post: Oct 11, 2011, 16:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •