API Strangeness


#1

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”}


#2

Bump — Nobody?


#3

Unfortunately I have not seen this before. If you can provide us with a full log I can take a look. Maybe something else failed and this error is masking it?

Thanks,
Jared


#4

Sorry for the delay Jared. I’ve asked the problem reporter to upload a log here, but it seems like he hasn’t gotten around to it yet.
I’ve attached the one I received, hopefully it sheds some light…

Thanks
Martin
sg_logfile_20180926182949.txt (439.3 KB)


#5

The only think that comes to mind is that maybe SGP is having problems writing to :
C:\Users\arie\Documents\Astromi\ModelCreator\Temp

Does the folder exist (although pretty sure SGP should attempt to create it if not)?

This is only occurring on a single users machine or do you have multiple reports? Does running SGP as Admin have any affect (not that you should need to, just wondering)

Thanks,
Jared


#6

Yes that folder was existing. The user confirmed that the picture was actually stored in there when ModelCreator got stuck waiting for the picture to become available.
So far only one person has reported this issue to me, so it seems to be an isolated problem.
I’ve sent a link of this thread to the reporter of the issue, hopefully he can chime in and provide additional information, such as whether he tried running as admin or not.

Cheers
Martin


#7

Thanks Martin. Do you know if they can consistently create the issue or is it just a one time occurrence?

Is the model creator something I’m able to run and test with or do you need specific hardware to make it work?

Thanks
Jared


#8

Hi Jared

I’ve asked Arie, who experienced the problem, to chime in here and answer your question regarding repeatability and equipment details.
You can download ModelCreator here to have a play with it:
http://www.astromi.ch/Files/ModelCreator/ModelCreator_Setup_1.3.0.zip

It should not require a particular equipment setup, as it should be compatible with more or less anything that ASCOM supports. But I have to admit that I’ve only tested it with a 10Micron Mount and the simulators from ASCOM.

If there are any questions / problems with ModelCreator, I’m happy to help.

Cheers
Martin


#9

Jared, Martin,
I tried several times to do test-runs for Martin’s ModelCreator. Especially the dome-telescope synchronization has my interest. Main focus for me was on the alignment of the dome slot and the telescope. I did quit some blank runs with a closed shutter, for this purpose. But every time there was at least an attempt made to platesolve (the inside of my dome). Once Martin had the alignment kinda sorted out, I waited for a clear night and an opportunity to do a real run. In the mean time I upgraded SGP to .94. The issue I had with that is reported elsewhere on this forum. Nevertheless, when it came to the real thing, the MC/SGP combo halted after the first image was taken. SGP did take the image, saved it at the right place and showed a nice starry image on the PC screen. “API call completed” was visible. When MC queried if the picture was there, SGP stayed numb for this request (explanation from Martin). In SGP I could right click on the image and platesolve it. No problem.
A few days ago, don’t ask me why, I changed the ASCOM driver in SGP for the ASI1600 camera from ZWO camera to ASICam(1) The 1st driver works normal in SGP when I take images. I was very surprised that this time the MC/SGP combo continued to solve the 1st picture taken. And continued to do so.
I have had the issue with MC halting and waiting on SGP several times. But since Martin is continuously making improvements to his program, and I have alternative ways to create a sky model, I did not report it here.
I do not keep a diary of everything I do or fool around in my obs. I do not have the dates recorded, but do have a large pile of very long log files.
Maybe the cumbersome upgrade to .94 plays a role. In combination with the ZWO cam driver compatibility. Hard to say.
But if I am the only user with this peculiar problem (maybe I am the only person running this configuration) I shouldn’t panic.
ModelCreator appears to be a smart application. So is SGP. And the ASI1600MM-C camera is super to. Not to mention the 10Micron GM1000hps mount and I am very pleased with my fully automized 2M Scopedome. But if you put 5 geniuses together, you never know what is going to happen. :slight_smile:
Give me some time and I will try to repeat the issue and I’ll send you the log files.

Arie


www.mainsequencesoftware.com