Win 10 2.6.11 dev4 Shutdown Crash

66 views
Skip to first unread message

Kurt Miller

unread,
Jan 30, 2023, 12:20:57 PM1/30/23
to open-phd...@googlegroups.com
Using Windows 10 Pro 22H2 with PHD2 2.6.11 dev4 when attempting to shutdown the computer while PHD2 is running, the shutdown is prevented due to PHD2 crashing and putting up this modal dialog.

Screenshot 2023-01-30 at 12.08.22 PM.png

Kurt Miller

unread,
Jan 30, 2023, 12:29:18 PM1/30/23
to Open PHD Guiding
The second half of my email didn't post to the group:

Both OK and Cancel just close PHD2 and pressing Cancel doesn’t show any additional information. No equipment was connected in PHD2. The crash happens every time and is not intermittent for me.

Please let me know if there’s any additional information I can gather to help diagnose the problem.

Best,
-Kurt

Bryan

unread,
Jan 30, 2023, 12:37:11 PM1/30/23
to Open PHD Guiding
Kurt

The Guide and Debug logs are always the best information to provide.  Even after a crash, they will have info.

See the top of the forum for "How to Ask for help with PHD2"

Bryan

Bryan

unread,
Jan 30, 2023, 12:38:49 PM1/30/23
to Open PHD Guiding
Kurt

Why do you want to shutdown with PHD2 (or anything running)?

Bryan

Kurt Miller

unread,
Jan 30, 2023, 12:59:19 PM1/30/23
to Open PHD Guiding
Hi Bryan,

Sorry about the missing guide and debug logs. Here they are: https://openphdguiding.org/logs/dl/PHD2_logs_h7Wx.zip

I want to shutdown the mini pc at the end of an imaging session automatically. I'm in the process of switching from an ASIAIR Plus to NINA on a mini pc and I see there's a 'Shutdown PC' plugin for NINA that can be used in the advanced sequencer for the end of the session. I'd like to use that after shutting off the power to the rest of the devices (e.g. camera and mount). This will be helpful to conserve charge when running off of a battery as well.

Best,
-Kurt

Bruce Waddington

unread,
Jan 30, 2023, 7:55:40 PM1/30/23
to open-phd...@googlegroups.com

These aren’t the right log files, they are from the DAYTIME today, 1/30.  When you use the UploadLog feature, look carefully at the time/date information for each entry in the table and be sure you’re uploading logs that cover the period when you had trouble.

 

Regards,

Bruce

--
You received this message because you are subscribed to the Google Groups "Open PHD Guiding" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-phd-guidi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open-phd-guiding/352e7734-e680-484d-befe-f981387591aen%40googlegroups.com.

Kurt Miller

unread,
Jan 30, 2023, 9:11:53 PM1/30/23
to open-phd...@googlegroups.com
Hi Bruce,

Thanks for taking a look at this. 

The problem is a crash when Window 10 is shutting down with no equipment connected in PHD2. I did these tests during the daytime today. Those are the correct log files for the problem I am reporting.

It happens every time I try to shutdown windows while PHD2 is open. Are you not able to reproduce the crash with the modal dialog that stops the shutdown of windows?

Best,
-Kurt

You received this message because you are subscribed to a topic in the Google Groups "Open PHD Guiding" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/open-phd-guiding/nrsCJZaPNsg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to open-phd-guidi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open-phd-guiding/003701d9350e%24ba599e70%242f0cdb50%24%40earthlink.net.

Bruce Waddington

unread,
Jan 30, 2023, 9:22:37 PM1/30/23
to open-phd...@googlegroups.com

I guess I didn’t understand what you were doing.  Frankly, this strikes me as a really poor idea.  Putting the system into hibernation or “sleep” state is fine, and hibernation reduces the power consumption to zero.  But forcibly powering down the system with apps running is a bad practice.  One likely outcome is that you can interrupt disk i/o and corrupt the file system.  Apps aren’t notified that the system is going to power down, you’re just effectively shooting them in the head.  So I don’t see that there’s anything we can do about it.

Kurt Miller

unread,
Jan 30, 2023, 9:55:28 PM1/30/23
to open-phd...@googlegroups.com
Thanks again for your time on this. The use case is to shutdown the mini pc at the end of the night automatically using NINAs Shudown PC plugin. There are two main reasons why someone may want to do this. If you’re running off a battery and you want the power off the mini pc to save the remaining charge and also to get a clean shutdown and unmounting of a USB Drive where the images are being saved. 

After posting this report, I realized that the Shudown PC plugin does actually cleanly shutdown Windows. It must be forcing any stuck applications to close. So the only way to reproduce this is by manually shutting down Windows by Start -> Power -> Shut down.  It’s not a show stopper at all since it is possible to get a clean shutdown using NINA and the Shutdown PC plugin. 

Best,
-Kurt

On Jan 30, 2023, at 9:22 PM, Bruce Waddington <bw_m...@earthlink.net> wrote:



Bruce Waddington

unread,
Jan 30, 2023, 10:30:28 PM1/30/23
to open-phd...@googlegroups.com

A cleaner option might be for NINA to use the PHD2 server interface and issue the command to ‘shutdown’.  That will give PHD2 a chance to close files, terminate whatever operations might be active, and cleanly exit.  Once PHD2 gets a Windows close message, there’s quite a bit of housekeeping that needs to get done before it exits.

Kurt Miller

unread,
Jan 30, 2023, 10:50:16 PM1/30/23
to open-phd...@googlegroups.com
Agree. I’m new to NINA but a quick look around and it currently does not appear to have a Guide Shutdown task in the advanced sequencer nor a plugin that does that. The closest I found was a Stop Guiding task but it does just that and leaves the PHD2 server running in the looping state. I’ll point out the need for a Guide Shutdown task for cleanly terminating PHD2 on NINA discord. Thanks for the tip about the ’shutdown’ server command.

Clear Sky’s
-Kurt

Kurt Miller

unread,
Feb 8, 2023, 9:43:06 PM2/8/23
to open-phd...@googlegroups.com
Following up for any future readers of this thread. NINA has a utility
instruction for running external scripts, so I ended up writing a
simple python script to shutdown PHD2 before shutting down Windows.
Here it is:

import socket
import time

HOST = "127.0.0.1"
PORT = 4400

def readAll(s):
while True:
try:
data = s.recv(4096)
if data:
print(f"{data!r}")
else:
break;
except TimeoutError:
break

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
try:
s.connect((HOST, PORT))
s.settimeout(1)
readAll(s)
cmd = b'{"method": "shutdown", "id": 1}\r\n'
print(f"{cmd!r}")
s.sendall(cmd)
readAll(s)
s.close()
except ConnectionRefusedError:
print("PHD2 Not Running")
Reply all
Reply to author
Forward
0 new messages