SGP hung while downloading frame and focus image


#1

This has happened before, though not in a while. Sometimes when I change my mind and stop a frame and focus run, the frame that is in the middle of downloading will get “stuck.” SGP reports the frame is still downloading, but nothing more happens, and I have to close SGP. A log is here:

https://dl.dropboxusercontent.com/u/58468743/sg_logfile_20150609200253.txt

Just a small glitch, but maybe fixing this will fix something more serious. (I’m not a programmer, so I’m free to speculate wildly!)

Kevin


SX camera problem, super dangerous loop
#2

Thanks for the report. I am not sure if this is a property of SGPro or your ASCOM driver (I have never seen it on other cameras… doesn’t mean much). Just saying I am not sure. Apparently your camera throws up when we call abort during a download state.

[6/9/2015 8:04:26 PM] [DEBUG] [Camera Thread] ASCOM Camera: Error when trying to abort exposure. : Abort not possible when camera is in state cameraDownload (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Abort not possible when camera is in state cameraDownload

We properly handle this by continuing on with the abort. The log indicates that some other stuff happened before you closed SGPro (like moving the CFW and the focuser). So when you say “hung” so you mean to say that SGPro is functional, but the camera is non-responsive?


#3

Well, it’s just stuck on download I can’t get it to respond to anything. It’s not crashed, but I can’t get it to do anything.


#4

It’s not that I’m doubting you… just how it is hung makes a difference. I see activity in your log after the camera errors so I am just curious of the exact behavior. When you say you can’t get “it” to do anything do you mean the camera? It seems like other equipment is indeed doing something after the camera errors present themselves.


#5

Oh, wait, I see what you’re saying. I can’t say I remember 100% about the FW. I know I tried to disconnect the camera via SGP to see if I could get it restarted, but it wouldn’t disconnect. My recollection is that SGP would not take any commands, but I’m not 100% sure. If it matters, I can report that my focuser went crazy once I restarted SGP. The first command it received, it had a runaway inward move, so I had to physically disconnect it and restart SGP again. My focuser has always been my most finicky piece of hardware, though.


#6

OK. Well looking at the next error in the log it appears, you entered frame and focus, aborted during download, received an error (internal to SGPro at least), then it looks like you started Frame and Focus again, but SGPro could not start it because your camera seems to be reporting that it is in a constant state downloading.

[6/9/2015 8:04:29 PM] [DEBUG] [Camera Thread] ASCOM Camera : StartExposure called while in state cameraDownload (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: StartExposure called while in state cameraDownload

Not 100% certain what we can do about this. Maybe we can talk to SX.


#7

Just out of curiosity, when did you add native SX support? I just noticed it a couple weeks ago, though it might have been there for ages. I’m sure I saw this type of issue even before native SX, though. I can remember mentioning it once quite a long time ago, but I can’t find that post. Maybe in the old group.

Kevin


#8

We don’t have native support for SX cameras right now.


#9

Ah, okay, I’m just misinterpreting what I’m seeing. The ASCOM dialog box no longer pops up when I connect the camera. That probably just means Bret changed something in the ASCOM driver.


#10

Ah now this is interesting, since going to 2.4.1, my sx camera also does this.

Huw


#11

Horwig, do you mean that SGP stalls downloading a frame and focus image, or that the ASCOM dialog box no longer pops up when you connect the camera?


#12

I get an SGP error message, something like ‘error in frame and focus’, and the download progress bar, instead of showing travelling blue bars becomes solid blue. Camera connect button is then greyed out, so have to close and reopen SGP to re connect.

It only seems to happen during frame and focus, once the imaging run starts everything is stable.

Huw


#13

Could you post an SGP log showing the issue? That might help to track it down.

Kevin


#14

The SX cameras are sent a command and respond with data and until all the data is read, it is in “write” mode instead of “read” more. A “start exposure” is really just a “wipe pixels” as the cameras don’t have shutters, they are “exposing” all the time. After a period of time (your exposure time), the driver does a “read pixels” and the camera responds with the full frame. Nothing can be done with the camera until all the pixel data is read from the camera.

I suspect the abort exposure, in this case, was sent after the “read pixels” and so the camera is waiting for the data to be read. There is nothing you can do until that data is read, even “camera reset” won’t work as that requires a read state in the camera. Most SX drivers will have a routine to read all data from the camera on the “abort exposure” and before sending the “camera reset” to make sure the camera is ready for a new command.

It sounds like the SX ASCOM driver doesn’t do this. If you unplug the camera from the computer, wait a second, and plug it back in, it will start responding again. The power cable on a modern SX camera is for the cooler and fans only, the CCD and circuitry is powered from the USB so this causes a cold start.


#15

*'ll cut and paste a section of one of the logs here, hope it’s not too large

Huw

[09/06/2015 01:42:14] [DEBUG] [Camera Thread] Auto focus complete…
[09/06/2015 01:42:14] [DEBUG] [Camera Thread] SGM_FOCUSER_AUTO_FOCUS complete…
[09/06/2015 01:42:16] [DEBUG] [Focuser Thread] SGM_FOCUSER_MOVE_ABS complete…
[09/06/2015 01:42:19] [DEBUG] [Camera Thread] SGM_FRAME_AND_FOCUS message received…
[09/06/2015 01:42:19] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:19] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:19] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:20] [DEBUG] [Camera Thread] SGM_FRAME_AND_FOCUS complete…
[09/06/2015 01:42:35] [DEBUG] [Camera Thread] SGM_FRAME_AND_FOCUS message received…
[09/06/2015 01:42:35] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:35] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:35] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:37] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:37] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:37] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:38] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:38] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:38] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:39] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:39] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:39] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:40] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:40] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:40] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:42] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:42] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:42] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:43] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:43] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:43] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:44] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:44] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:44] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:45] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:45] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:45] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:47] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:47] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:47] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:48] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:48] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:48] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:49] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:49] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:49] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:49] [DEBUG] [Camera Thread] ASCOM Camera: abort message received…
[09/06/2015 01:42:49] [DEBUG] [Camera Thread] ASCOM Camera: Attempting to abort exposure…
[09/06/2015 01:42:49] [DEBUG] [Camera Thread] ASCOM Camera: Exposure aborted…
[09/06/2015 01:42:50] [DEBUG] [Camera Thread] SGM_FRAME_AND_FOCUS complete…
[09/06/2015 01:42:51] [DEBUG] [Camera Thread] SGM_FRAME_AND_FOCUS message received…
[09/06/2015 01:42:51] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:51] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:51] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:51] [DEBUG] [Camera Thread] ASCOM Camera: abort message received…
[09/06/2015 01:42:51] [DEBUG] [Camera Thread] ASCOM Camera: Attempting to abort exposure…
[09/06/2015 01:42:51] [DEBUG] [Camera Thread] ASCOM Camera: Exposure aborted…
[09/06/2015 01:42:52] [DEBUG] [Camera Thread] SGM_FRAME_AND_FOCUS complete…
[09/06/2015 01:42:52] [DEBUG] [Camera Thread] SGM_FRAME_AND_FOCUS message received…
[09/06/2015 01:42:52] [DEBUG] [Camera Thread] ASCOM camera: frame and focus…
[09/06/2015 01:42:52] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[09/06/2015 01:42:52] [DEBUG] [Camera Thread] Cannot set readout speed, not supported by camera…
[09/06/2015 01:42:52] [DEBUG] [Camera Thread] ASCOM Camera : StartExposure called while in state cameraExposing (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Runtime.InteropServices.COMException: StartExposure called while in state cameraExposing
— End of inner exception stack trace —
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at ASCOM.DriverAccess.MemberFactory.CallMember(Int32 memberCode, String memberName, Type[] parameterTypes, Object[] parms) in c:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:line 443)
at ASCOM.DriverAccess.MemberFactory.CallMember(Int32 memberCode, String memberName, Type[] parameterTypes, Object[] parms) in c:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:line 483
at ASCOM.DriverAccess.Camera.StartExposure(Double Duration, Boolean Light) in c:\ASCOM Build\Export\ASCOM.DriverAccess\Camera.cs:line 594
at ad.CaptureImage(Image image, SgMessage& abort)
[09/06/2015 01:42:52] [DEBUG] [Camera Thread] ASCOM Camera: Attempting to abort exposure…
[09/06/2015 01:42:52] [DEBUG] [Camera Thread] ASCOM Camera: Exposure aborted…
[09/06/2015 01:42:52] [DEBUG] [Camera Thread] ASCOM camera: frame and focus error. : Error capturing during frame and focus!
at ad.FrameAndFocus(Image image, SgMessage& abort)
[09/06/2015 01:43:03] [DEBUG] [Sequence Thread] Dispatch loop: Received SGM_TERMINATE…
[09/06/2015 01:43:03] [DEBUG] [Main Thread] Disconnecting ASCOM camera: Starlight Xpress Main Camera…
[09/06/2015 01:43:03] [DEBUG] [Main Thread] Error while disconencting all equipment: Object reference not set to an instance of an object.
[09/06/2015 01:43:03] [DEBUG] [Focuser Thread] Focuser Dispatch loop: Received SGM_TERMINATE…
[09/06/2015 01:43:03] [DEBUG] [Telescope Thread] Telescope Dispatch loop: Received SGM_TERMINATE…
[09/06/2015 01:43:03] [DEBUG] [Filter Wheel Thread] Filter Wheel Dispatch loop: Received SGM_TERMINATE…
[09/06/2015 01:43:03] [DEBUG] [Auto Guider Thread] Auto Guider Dispatch loop: Received SGM_TERMINATE…
[09/06/2015 01:43:03] [DEBUG] [TEC Thread] TEC Dispatch loop: Received SGM_TERMINATE…
[09/06/2015 01:43:03] [DEBUG] [Main Thread] Performing clean up…
*


#16

Can you post the full logs? Often there is more they want to see besides what you post.

Thanks,
Chris


#17

Sure thing Chris, here is the complete log, hope it helps.

Huw


#18

Yes, It’s the same issue. Seems to be unique to SX cameras. Not much (that I know of) that we can do about this.


#19

OK, I’l try rolling back to 2.4.0, see if it’s still there on that release

Huw


#20

2.4.1.4 was the other version I had, this gives the same error in the log, but does not throw up error messages in frame and focus, are they connected,or just a coincidence?

Huw


www.mainsequencesoftware.com