Error during a sequence

Somewhere to ask questions about the best way to use SharpCap
Forum rules


If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
User avatar
CarCarlo147
Posts: 26
Joined: Wed Feb 14, 2024 8:12 pm
Location: Ariccia (RM) - Italy
Contact:

Re: Error during a sequence

#11

Post by CarCarlo147 »

Hi Robin, here I am doing some more tests, I'm trying to set the parking position of the mount from the sequence.

From a chat with Robert Morgan, author of GSServer, he suggests creating a powershell script (see attachment) that tells GSServer the correct parking position (Flat, Home... more)
Park.png
Park.png (27.82 KiB) Viewed 1440 times

Code: Select all

# Clear the console pane
Clear-Host

$parkposition = "Test1"  #name of park position

$GSS = New-Object -COMObject "GS.SkyApi" # Create GS.Sky.Api.dll
$parked = $GSS.IsParked # is mount parked
$running = $GSS.IsMountRunning # is mount running
$connected = $GSS.IsMountRunning # is mount connected
$currentparkposition = $GSS.ParkPosition # is mount connected

If($parked -eq $false -And $running -eq $true -And $connected -eq $true)
{
    $GSS.ParkPosition = $parkposition
    $parkpositionTest = $GSS.ParkPosition

    If( $parkposition -eq $parkpositionTest)
    {
        $GSS.Park()
    }
    
    Write-Host "OK"
}
else
{ 
    Write-Host "Mount is parked ("$currentparkposition.Trim()") or not running"
}
Write-Host "Done"
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($GSS) 
Remove-Variable GSS # Necessary - Relese the Com Object
Is there a way to start it from your sequencer?

Thank you
User avatar
admin
Site Admin
Posts: 15637
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Error during a sequence

#12

Post by admin »

Hi Carlo,

that looks handy to know - thanks for sharing!

You should be able to run the power shell from the sequencer - there is a 'Run a program' step in the 'Misc' steps which allows you to specify the program, arguments to pass and whether to wait. Not sure if you will get away with just passing the ps1 file as the 'program' or whether you will need to set powershell.exe as the program and make the ps1 file the argument, but one of them should work.

cheers,

Robin
User avatar
CarCarlo147
Posts: 26
Joined: Wed Feb 14, 2024 8:12 pm
Location: Ariccia (RM) - Italy
Contact:

Re: Error during a sequence

#13

Post by CarCarlo147 »

Hi Robin
Tests carried out, everything works.

To run the Powershell script you need a trick to bypass the Windows security policies by entering the parameter: -ExecutionPolicy Bypass

Code: Select all

RUN C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe WITH PARAMS "-ExecutionPolicy Bypass -File \"Park.ps1\"" WAIT True
At this link you can play with many scripts made available by Morgan:

https://github.com/rmorgan001/GSServer/ ... SkyScripts

ps.: Many commands don't work with the simulator, you need to connect the mount.

Greetings and thanks for all the help you have given me.
Carlo
User avatar
CarCarlo147
Posts: 26
Joined: Wed Feb 14, 2024 8:12 pm
Location: Ariccia (RM) - Italy
Contact:

Re: Error during a sequence

#14

Post by CarCarlo147 »

Hi Robin, yesterday while I was about to perform my photo session, at the beginning of the sequence I received the error again at the time of plate solving.

Without changing anything, because everything had worked these days, I restarted the sequence and this time the plate solve and sync worked both at the beginning of the sequence and after the meridian flip.
The camera was in live mode.

I attach the log to you in the hope that it will be useful to you in intercepting the bug.
The sequence begins at the time "Info 22:47:07.391920"

Luckily I had the latest version installed.

Greetings
Carlo
Attachments
Log_2024-07-23T21_30_34-18684.log
(536.2 KiB) Downloaded 22 times
User avatar
admin
Site Admin
Posts: 15637
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Error during a sequence

#15

Post by admin »

Hi Carlo,

thanks for sharing the log - it reveals that it failed in a different way this time... This time the capture of the frame from the camera succeeded, but the plate solver didn't find a solution for the stars detected in the image. This could be down to a bug in SharpCap's plate solver, or just bad luck in terms of the stars being detected in the frame didn't nicely match with those in the database.

Unfortunately the image that was being used will not have been kept (unless you have additional logging for Plate Solving turned on in the settings). My goal is that this sort of random error should be very rare (less than 1 in 1000 times) unless there is some reason (cloud covering a big fraction of the image or similar). If you ever catch this failing this way with an image that you can send me, please do, and I will be happy to investigate why.

thanks,

Robin
User avatar
CarCarlo147
Posts: 26
Joined: Wed Feb 14, 2024 8:12 pm
Location: Ariccia (RM) - Italy
Contact:

Re: Error during a sequence

#16

Post by CarCarlo147 »

Good morning Robin This night something went wrong.
These days I'm taking a lot of photos and until this night everything has always worked.
Yesterday before starting I downloaded and installed the new version v4.1.12455.0

What happened: after the meridian flip with subsequent plate solve it did not recenter the target.

I analyzed the log and the image files produced, I'm attaching the log to you the FIT files there is the Link if you want to download them, it seems that it has mixed the images.
Log_2024-07-30T21_30_34-1184.log
(431.03 KiB) Downloaded 20 times

More precisely:
- at point 01:51:29.089490 it writes the last image before flipping (600s each image);
- at point 01:55:36.791526 Stop condition monitoring (to start the flip)
- at point 02:01:30.645929 the confirmation of writing an image during the entire flip movement. (in fact if you analyze the FIT that I attached it is a mix of the two specular ones)

Therefore in the plat solve it seems that I took the right part of this image as a reference moving and getting all the coordinates wrong.

https://drive.google.com/drive/folders/ ... drive_link
Explanation of the images:
2024-07-30-2351_4... Last image before the flip
2024-07-31-0001_5... Image acquired and saved during the entire flip
2024-07-31-0011_8... First image after the flip

I hope I was helpful. Today I go back to the previous version
User avatar
admin
Site Admin
Posts: 15637
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Error during a sequence

#17

Post by admin »

Hi,

thanks for sharing - it looks like the 'Stop at' step interrupts the capturing of still frames, but leaves a frame in progress rather than cancelling it. That frame continues to run during the flip and eventually finishes while the plate solve step is waiting for a frame. The plate solve step thinks it is getting 4s, but those setting changes don't take effect because there is still a frame in progress...

Nothing new here in the latest version, just a timing issue that would sometimes happen and sometimes not happen.

Having just checked the code, it should be cancelling the 600s frame when the 'Stop at' interrupts capture - not sure how that is failing just yet - will have to investigate more.

For now, put a 'live view' step in before the flip, maybe along with a shorter exposure to like 30s? In live view, the change in exposure from the 'set plate solve settings' step will end the current frame and start a new one with 4s exposure - that doesn't happen in still mode.

cheers,

Robin
User avatar
CarCarlo147
Posts: 26
Joined: Wed Feb 14, 2024 8:12 pm
Location: Ariccia (RM) - Italy
Contact:

Re: Error during a sequence

#18

Post by CarCarlo147 »

Ok, as I imagined.
I will try your advice to not regress with the version.

With all these tests I realized that an error handling like Try Catch is missing.
It would be very useful to insert it.

Regards Carlo.
User avatar
admin
Site Admin
Posts: 15637
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Error during a sequence

#19

Post by admin »

Hi Carlo,

there's an 'Ignore any errors when running these steps' block that gives you some try/catch error handling. By default it's try {// do stuff} catch {// do nothing}, but you can set a subroutine to run in the catch block to attempt recovery. There is also a very new 're-raise the last error' step that allows you to 'throw' from the error handling subroutine.

cheers,

Robin
Post Reply