Hi all
I’ve noticed a strange issue with the REST API (using v3.0.2.94).
Background info:
I’ve written an application that can be used to create mount models for mount’s that support it. This application instruments SGP to take images. Once the command to start an image has been sent, I frequently query the state of the image via the “SgGetImagePath” call. Interestingly, SGP does not know about image after it has been completed. The image is visible on the SGP UI, and the file saved to the disk in the location specified.
Please note that this issue was reported to me by a user of ModelCreator. I personally am unable to reproduce this issue. I’m testing all of this with the camera simulator, and it works fine for me. But looking at the logs, there is clearly something wrong in certain constellations.
Anybody have any ideas on why it would behave like that? I do not know if earlier versions of SGP show the same problem or not.
Thanks
Martin
Here are the corresponding log entries.
Here SGP Captures the image:
[09/26/18 18:35:04.616][DEBUG] [Unknown] * Body:
{“BinningMode”:1,“ExposureLength”:2.0,“Gain”:null,“Iso”:“1600”,“Speed”:0,“FrameType”:0,“Path”:“C:\Users\xxxxx\Documents\Astromi\ModelCreator\Temp\Modelcreator_20180926_183504559.fit”,“UseSubframe”:false,“X”:0,“Y”:0,“Width”:0,“Height”:0}
[09/26/18 18:35:04.620][DEBUG] [Unknown] API Response:
[09/26/18 18:35:04.620][DEBUG] [Unknown] * Endpoint: (POST) -
/image
[09/26/18 18:35:04.620][DEBUG] [Unknown] * Operation:
SgCaptureImage
[09/26/18 18:35:04.623][DEBUG] [API Capture Thread] Running API
capture event…
[09/26/18 18:35:04.623][DEBUG] [Unknown] * Body:
{“Success”:true,“Message”:“Image capture started
successfully.”,“Receipt”:“fcb3bc1d-7497-4af8-a992-0599f970a667”}
[09/26/18 18:35:04.631][DEBUG] [API Capture Thread] Finished sending
frame capture. Entering wait mode…
[09/26/18 18:35:04.633][DEBUG] [Camera Thread] SGM_CAMERA_CAPTURE
message received…
[09/26/18 18:35:04.636][DEBUG] [Camera Thread] Starting ZWO Capture
for 2.00 Seconds
Here SGP Saves the image to the folder specified, with the name specified. So far so good.
[09/26/18 18:35:08.776][DEBUG] [Unknown] * Endpoint: (POST) -
/imagepath/fcb3bc1d-7497-4af8-a992-0599f970a667
[09/26/18 18:35:08.776][DEBUG] [Unknown] * Operation:
SgGetImagePath
[09/26/18 18:35:08.776][DEBUG] [Unknown] * Body:
{“Success”:false,“Message”:“No image found for receipt:
fcb3bc1d-7497-4af8-a992-0599f970a667”}
[09/26/18 18:35:09.232][DEBUG] [API Capture Thread]
GatherFitsHeaders: Writing header info from UI…
[09/26/18 18:35:09.237][DEBUG] [API Capture Thread] Clearing timed
monitoring events…
[09/26/18 18:35:09.238][DEBUG] [API Capture Thread] Created full
file name (file does not exist):
C:\Users\xxxxxx\Documents\Astromi\ModelCreator\Temp\Modelcreator_20180926_183504559.fit
[09/26/18 18:35:09.239][DEBUG] [API Capture Thread] SaveFileAscom:
Start…
[09/26/18 18:35:09.239][DEBUG] [API Capture Thread] SaveFileAscom:
Checking image data…
[09/26/18 18:35:09.239][DEBUG] [API Capture Thread] SaveFileAscom:
Create normal preview bitmap…
[09/26/18 18:35:09.246][DEBUG] [API Capture Thread] SaveFileAscom:
Locking preview bits…
[09/26/18 18:35:09.246][DEBUG] [API Capture Thread] SaveFileAscom:
Validating file name…
[09/26/18 18:35:09.246][DEBUG] [API Capture Thread] SaveFileAscom:
Starting byte traversal…
[09/26/18 18:35:09.435][DEBUG] [API Capture Thread] SaveFileAscom:
Unlocking preview bits
…
Then, ModelCreator asks again if the image is ready:
[09/26/18 18:35:09.776][DEBUG] [Unknown] API Request:
[09/26/18 18:35:09.776][DEBUG] [Unknown] * Endpoint: (POST) -
/imagepath/fcb3bc1d-7497-4af8-a992-0599f970a667
[09/26/18 18:35:09.776][DEBUG] [Unknown] * Operation:
SgGetImagePath
[09/26/18 18:35:09.776][DEBUG] [Unknown] * Body:
{“Receipt”:“fcb3bc1d-7497-4af8-a992-0599f970a667”}
And the response from SGP:
[09/26/18 18:35:09.776][DEBUG] [Unknown] API Response:
[09/26/18 18:35:09.776][DEBUG] [Unknown] * Endpoint: (POST) -
/imagepath/fcb3bc1d-7497-4af8-a992-0599f970a667
[09/26/18 18:35:09.776][DEBUG] [Unknown] * Operation:
SgGetImagePath
[09/26/18 18:35:09.776][DEBUG] [Unknown] * Body:
{“Success”:false,“Message”:“No image found for receipt:
fcb3bc1d-7497-4af8-a992-0599f970a667”}