UI become slow/unresponsive when connected to an Alpaca cover

Anything that doesn't fit into any of the other forums
julien.t
Posts: 28
Joined: Mon Jan 15, 2024 9:05 pm

UI become slow/unresponsive when connected to an Alpaca cover

#1

Post by julien.t »

Hi,

I noticed strange behaviour when connected to an ASCOM Alpaca cover. The camera, a PlayerOne Saturn, view refresh became slow (new images displayed only every few seconds). I first thought about some kind of camera slowness due to SSD speed, USB issues, ... But as soon as I disconnect the cover, everything is back to normal.
The cover is a DIY device based on a Raspberry Pi Pico 2W with a driver implemented from a fork of this project : https://github.com/RunTJoe/MiPyAlpaca
I also tried with the ASCOM Cover simulator driver and with this one I have no issue.
I will try to find another Alpaca device to test to try to find out if there is some kind of general issue or if the cause of the issue is my device driver implementation.

Regards,

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

Re: UI become slow/unresponsive when connected to an Alpaca cover

#2

Post by admin »

Hi Julien,

thanks for reporting - I just had a look at the code and it looks like the status update requests to check on the state of the cover are happening in a way that is impacting on the responsiveness of the rest of the UI. It will be particularly bad when the cover is a remote device being accessed via Alpaca, as the update requests involve network traffic and take longer.

I will attempt to fix this for the next update.

cheers,

Robin
julien.t
Posts: 28
Joined: Mon Jan 15, 2024 9:05 pm

Re: UI become slow/unresponsive when connected to an Alpaca cover

#3

Post by julien.t »

Hi,

Thanks for the reply.

Let me know if you want me to test a beta version.

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

Re: UI become slow/unresponsive when connected to an Alpaca cover

#4

Post by admin »

Hi,

shouldn't need to do a beta for this - the next update of 4.1 (probably early next week) will have the change in it. I suspect that something similar might happen if you have an Alpaca switch device in use and it is slow responding to requests for updates, so I will be looking at that too.

cheers,

Robin
julien.t
Posts: 28
Joined: Mon Jan 15, 2024 9:05 pm

Re: UI become slow/unresponsive when connected to an Alpaca cover

#5

Post by julien.t »

Hi,

OK, Thank you. I will try the new version this week.

Regards,

Julien
julien.t
Posts: 28
Joined: Mon Jan 15, 2024 9:05 pm

Re: UI become slow/unresponsive when connected to an Alpaca cover

#6

Post by julien.t »

Hi,

I tried the new version. Much better.

But I got several crashes. The crash report dialog appeared and I sent it, but on at least two occasions it was also frozen and had to kill the process from the Windows task manager.

Let me know if you need more information, logs, ...


Regards,

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

Re: UI become slow/unresponsive when connected to an Alpaca cover

#7

Post by admin »

Hi Julien,

thanks for sending the bug reports - I think I have located the relevant ones related to the 'Sun Flip Flat Cover'.

Looking at the cause of the crash, I think it is strictly speaking the Alpaca driver not behaving according to the ASCOM specification - because the device is giving a CalibratorState that is not 'NotPresent', SharpCap sees it as a device with a calibrator and then asks for its MaxBrightness. However, the request for MaxBrightness is getting a 'NotImplemented' error from the Alpaca driver, which seems to be out-of-spec (see https://ascom-standards.org/newdocs/cov ... Brightness).

I can make SharpCap deal with receiving this error from an ASCOM driver and not crash, but I don't think I can sensibly make SharpCap continue to work with the calibrator illumination if the MaxBrightness call is failing. I am inclined to actually leave the crash in place as it makes the problem with the Alpaca/ASCOM driver 'discoverable' - if I handled the error and logged something in the SharpCap log, the end user result would be that the illumination didn't work with no obvious reason why.

Interested in hearing your take on this,

cheers,

Robin
julien.t
Posts: 28
Joined: Mon Jan 15, 2024 9:05 pm

Re: UI become slow/unresponsive when connected to an Alpaca cover

#8

Post by julien.t »

Hello,

I didn't thought that the cover could be the cause of the crash because it seamed to occur when I tried to change the camera ROI.
Looking at the cause of the crash, I think it is strictly speaking the Alpaca driver not behaving according to the ASCOM specification - because the device is giving a CalibratorState that is not 'NotPresent', SharpCap sees it as a device with a calibrator and then asks for its MaxBrightness. However, the request for MaxBrightness is getting a 'NotImplemented' error from the Alpaca driver, which seems to be out-of-spec (see https://ascom-standards.org/newdocs/cov ... Brightness).
But returning/throwing a MethodNotImplementedException is a valid case when calibrator is not present as stated by the documentation :

Raises:
- MethodNotImplementedException – When CalibratorState returns NotPresent.

So, if CalibratorState returns "NotPresent" I think MaxBrightness and other calibrator related methods should not be called.


This is my case, I only have a cover. It's a particular case of a flat cover panel for sun imaging. It doesn't have a illuminated panel like usual cover + calibrator devices. Instead it has an acrylic glass to blur the image to do the flat.
flat cover.jpg
flat cover.jpg (110.65 KiB) Viewed 545 times

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

Re: UI become slow/unresponsive when connected to an Alpaca cover

#9

Post by admin »

Hi Julien,

I agree with you that if the Calibrator state is NotPresent, then throwing an exception is OK. However, as far as I can see, SharpCap should only be requesting the maximum brightness if the state is not 'NotPresent', so SharpCap shouldn't be making the request if the CalibratorState property is consistent with the MaxBrightness.

Unfortunately the current ASCOM Simulator device doesn't let you configure it to behave as if it has no calibrator, but I have hardwired the code in SharpCap temporarily to force a value of 'NotPresent' on the calibrator state and that seems to cause the request for MaxBrightness to be skipped properly.

Can you check your ASCOM driver is really returning 'NotPresent' for the calibrator state request? If it looks like it is then maybe you could share the code with me and I can try to rig it up to be runnable without the hardware and see if I can repro the issue here.

I do like the look of your cover device - a very clean looking design. I was tempted at one point to either buy or make something similar, but I now use a front mounted ERF for solar, and changing between the flat panel sheet and the ERF is just too complicated (let alone dealing with the weight of the ERF, as it's about 11mm thick glass...)

cheers,

Robin
julien.t
Posts: 28
Joined: Mon Jan 15, 2024 9:05 pm

Re: UI become slow/unresponsive when connected to an Alpaca cover

#10

Post by julien.t »

Hi,
admin wrote: Thu May 14, 2026 1:53 pm Can you check your ASCOM driver is really returning 'NotPresent' for the calibrator state request? If it looks like it is then maybe you could share the code with me and I can try to rig it up to be runnable without the hardware and see if I can repro the issue here.
Yes, it returns NotPresent. And yes, I can share the code. But it's developed in MicroPython, and as far as I know it can't be run on Windows. But if you have a Raspberry Pi Pico or an equivalent device it should work even without the motor.
An other solution would be to use the new ASCOM Alpaca simulators : ASCOM Omni-Simulator. Its cover driver allows to define the value returned by the coverState and calibratorState properties. I'm not sure Omni-Simulator is installed by default by the ASCOM installer, you may have to reinstall ASCOM.

Regards,

Julien
Post Reply