Page 1 of 1

Issue with Alpaca Focussers?

Posted: Fri Jan 24, 2025 8:56 pm
by cyrille.de.brebisson
Hello,

I am trying to develop an Alpaca based focusser...
It is detected by Sharpcap, I can connect, I can do a goto...
BUT, I can only move using the "negative"/"positive" buttons ONCE.
Once the button has been pressed, it stays disabled...

I have tried it also with the ASCOM Alpaca simulator and it does the same thing (see attached image)..
Is this a new bug, or something known (and already fixed if I was intelligent enough to take the latest version!)

Thanks,
Cyrille

Re: Issue with Alpaca Focussers?

Posted: Sat Jan 25, 2025 3:34 pm
by admin
Hi Cyrille,

the fact that the individual button is staying deactivated would indicate that the code that the button runs when you click it is never completing - the button disables itself while the code is running to avoid double activation, and if the code never completes then it will never re-enable itself.

However, I can't quite see how that would happen - apart from a bunch of error handling and thread based gymnastics to avoid the problem of a freezing ASCOM driver hanging the whole application UI, all the button does is send the 'Move' command to the ASCOM driver. With a local ASCOM driver, that Move command could never return which would lead to the problem, but with Alpaca, I assume the Alpaca remote API call will timeout eventually, which should bring the button back to life...

Note that SharpCap really expects the 'Move' API to start the movement and then return immediately - you then find out when the movement is complete by checking IsMoving and Position. The ASCOM documentation doesn't explicitly state this, but it's the way that most focuser drivers I have encountered work.

If that still doesn't get anywhere, then it would be worth checking the SharpCap log to see if anything unusual pops up when this problem occurs. If still no joy, please feel free to send me some code/binaries I can test and I can debug at my end.

thanks,

Robin

Re: Issue with Alpaca Focussers?

Posted: Sat Jan 25, 2025 11:53 pm
by cyrille.de.brebisson
Hello,

Actually, the problem shows using the (official) Ascom simulators: https://github.com/ASCOMInitiative/ASCO ... Simulators
Download the code, open one of the project (I opened the FocusserSimulator project file), it will open visual studio, build and run. It actually compiles ALL the simulators and run one app that has them all..

Then, in sharp cap: file/detect remove HW, in file/preference/hardware, select the alpaca simulator for focusser.
camera/connect a camera, connect focusser, click on the button and I get these errors...
As you said, the alpaca http request returns imediately on a move, the position changes, BUT, at least on my computer, 1 times out of 3, the button stays disabled...
No clue why...

If you can not reproduce on your side, I will do a video grag and send it to you and I can give you any logs I can (if you tell me how to get them!)

Cyrille

Re: Issue with Alpaca Focussers?

Posted: Mon Jan 27, 2025 9:54 am
by cyrille.de.brebisson
Hello,

Ok, well, it looks like the problem is 90% my mouse!

My poor mouse is ageing, and now has bounces on the left click... This causes 2 VERY quick click in succession... And it looks like this is what is causing the UI problem in sharpcap... Changing mouse solves the problem!!!!


However, I have another request/question...
You seem to block the setup button for alpaca devices stating that setup is handled differently... which is true to some extent...
Any alpaca device is supposed to have a setup page at:
http://host:port/setup/v1/type/id/setup (with type and id as needed)...
Could you open a web browser to that URL when the user clicks on setup? This would be nice!

Thanks,
Cyrille

Re: Issue with Alpaca Focussers?

Posted: Mon Jan 27, 2025 12:19 pm
by admin
Hi,

thanks for the update on the double click issue - that should give me enough to find/fix the underlying problem (I should probably count the number of times the button is disabled rather than just a flag).

I will look at the setup possibility and see if I can add it.

thanks,

Robin

Re: Issue with Alpaca Focussers?

Posted: Mon Jan 27, 2025 1:11 pm
by cyrille.de.brebisson
Hello,

Yep, that was a weired one!!!!

Do you have ALpaca devices to test, or are you using the simulator?

Cyrille

Re: Issue with Alpaca Focussers?

Posted: Tue Jan 28, 2025 2:44 pm
by admin
Hi,

I have mostly been using the simulator when necesary to test, sometimes on the local PC and sometimes running remotely. I have fixed the double click issue for this update (I hope anyway - I couldn't make it happen - probably related to getting two clicks fast enough), but I haven't had a chance to look at the setup URL yet.

cheers,

Robin