API Camera Subframe Issue

Hi @Jared, @Ken,

I’m writing a software to control camera exposures through the API. It works well if I dont define subframing, but I get an issue I cannot resolve when trying to subframe. From the SGP API logging it looks like the X,Y,W,H parameters are passing to SGP, but then SGP somehow puts W=0 and H=0 which causes the ASCOM driver to through an exception. Could you please tell me if I do something obviously wrong here, or is it really some problem with the SGP handling of the call ? Excerpt of log below.

Thanks, Mikael

[03/12/21 09:43:39.087][DEBUG][Unknown][NONE] API Request:
[03/12/21 09:43:39.087][DEBUG][Unknown][NONE] * Endpoint: (GET) - /devicestatus/camera
[03/12/21 09:43:39.087][DEBUG][Unknown][NONE] * Operation: SgGetDeviceStatus
[03/12/21 09:43:39.087][DEBUG][Unknown][NONE] * Body: {“Device”:0}
[03/12/21 09:43:39.088][DEBUG][Unknown][NONE] API Response:
[03/12/21 09:43:39.088][DEBUG][Unknown][NONE] * Endpoint: (GET) - /devicestatus/camera
[03/12/21 09:43:39.088][DEBUG][Unknown][NONE] * Operation: SgGetDeviceStatus
[03/12/21 09:43:39.088][DEBUG][Unknown][NONE] * Body: {“State”:0,“Success”:true,“Message”:“Camera is idle.”}
[03/12/21 09:43:39.120][DEBUG][Unknown][NONE] API Request:
[03/12/21 09:43:39.120][DEBUG][Unknown][NONE] * Endpoint: (GET) - /cameraprops
[03/12/21 09:43:39.120][DEBUG][Unknown][NONE] * Operation: SgGetCameraProps
[03/12/21 09:43:39.121][DEBUG][Unknown][NONE] * Body: {}
[03/12/21 09:43:39.123][DEBUG][Unknown][NONE] API Response:
[03/12/21 09:43:39.123][DEBUG][Unknown][NONE] * Endpoint: (GET) - /cameraprops
[03/12/21 09:43:39.123][DEBUG][Unknown][NONE] * Operation: SgGetCameraProps
[03/12/21 09:43:39.125][DEBUG][Unknown][NONE] * Body: {“Success”:true,“Message”:“Success”,“NumPixelsX”:2750,“NumPixelsY”:2200,“SupportsSubframe”:true,“IsoValues”:null,“GainValues”:null}
[03/12/21 09:43:39.147][DEBUG][Unknown][NONE] API Request:
[03/12/21 09:43:39.147][DEBUG][Unknown][NONE] * Endpoint: (POST) - /image?BinningMode=1&ExposureLength=1&FrameType=Flat&Path=D%3a%5cAstrophotos%5ccheckADUflat.fit&UseSubframe=True&X=688&Y=550&W=1375&H=1100
[03/12/21 09:43:39.147][DEBUG][Unknown][NONE] * Operation: SgCaptureImage
[03/12/21 09:43:39.151][DEBUG][Unknown][NONE] * Body: {“BinningMode”:1,“ExposureLength”:1.0,“Gain”:null,“Iso”:null,“Speed”:0,“FrameType”:3,“Path”:“D:\Astrophotos\checkADUflat.fit”,“UseSubframe”:true,“X”:688,“Y”:550,“Width”:0,“Height”:0}
[03/12/21 09:43:39.154][DEBUG][Unknown][NONE] API Response:
[03/12/21 09:43:39.154][DEBUG][Unknown][NONE] * Endpoint: (POST) - /image?BinningMode=1&ExposureLength=1&FrameType=Flat&Path=D%3a%5cAstrophotos%5ccheckADUflat.fit&UseSubframe=True&X=688&Y=550&W=1375&H=1100
[03/12/21 09:43:39.154][DEBUG][Unknown][NONE] * Operation: SgCaptureImage
[03/12/21 09:43:39.156][DEBUG][Unknown][NONE] * Body: {“Success”:true,“Message”:“Image capture started successfully.”,“Receipt”:“302e4edb-8659-422d-908b-ca30bb816c00”}
[03/12/21 09:43:39.156][DEBUG][API Capture Thread][NONE] Running API capture event…
[03/12/21 09:43:39.163][DEBUG][Unknown][NONE] API Request:
[03/12/21 09:43:39.163][DEBUG][Unknown][NONE] * Endpoint: (GET) - /imagepath/302e4edb8659422d908bca30bb816c00
[03/12/21 09:43:39.163][DEBUG][Unknown][NONE] * Operation: SgGetImagePath
[03/12/21 09:43:39.164][DEBUG][Unknown][NONE] * Body: {“Receipt”:“302e4edb-8659-422d-908b-ca30bb816c00”}
[03/12/21 09:43:39.164][DEBUG][Unknown][NONE] API Response:
[03/12/21 09:43:39.164][DEBUG][Unknown][NONE] * Endpoint: (GET) - /imagepath/302e4edb8659422d908bca30bb816c00
[03/12/21 09:43:39.164][DEBUG][Unknown][NONE] * Operation: SgGetImagePath
[03/12/21 09:43:39.165][DEBUG][API Capture Thread][NONE] Finished sending frame capture. Entering wait mode…
[03/12/21 09:43:39.166][DEBUG][Unknown][NONE] * Body: {“Success”:false,“Message”:“No image found for receipt: 302e4edb-8659-422d-908b-ca30bb816c00”}
[03/12/21 09:43:39.174][DEBUG][Camera Thread][NONE] SGM_CAMERA_CAPTURE message received…

You need to be passing Width and Height looks like you’re using W and H.

Jared

Oh, what a silly mistake, should have know… Works perfectly now, thanks for the quick feedback Jared!

Mikael