Switches Turn Off Unexpectedly

I noticed this in the last log I sent:

[07/01/24 12:32:56.374][DEBUG][Unknown][NONE] ASCOM Switch ASCOM.DigitalLoggers.Switch-4: Set switch state to True
[07/01/24 12:32:56.374][DEBUG][Unknown][NONE] ASCOM Switch ASCOM.DigitalLoggers.Switch-4: switch state reports 1

So it looks like an immediate good status return for that switch.

Switch 7 is not so lucky:

[07/01/24 12:32:56.620][DEBUG][Unknown][NONE] ASCOM Switch ASCOM.DigitalLoggers.Switch-7: Set switch state to True
[07/01/24 12:32:56.620][DEBUG][Unknown][NONE] ASCOM Switch ASCOM.DigitalLoggers.Switch-7: switch state reports 0

And then:

[07/01/24 12:32:56.620][ERROR][Unknown][NONE] Exception while attempting to set switch state => “ASCOM.DigitalLoggers.Switch-7” to “1.00” : Could not set switch “ASCOM.DigitalLoggers.Switch-7” to “1.00”! Switch does not reflect the desired state within 30 seconds. Attempted to set switch state 1 times…
at j0.ci(String A_0, Dictionary`2 A_1, Boolean A_2)

But no time has elapsed.

To answer your last questions, setting the switch manually works fine; no errors. Only errors on sequence run and those have always been immediate. I realize now I hadn’t communicated that fact to you. Sorry!

Wak! I spoke too quickly. SGP is still leaving devices connected.

Another pathway to the startup problem is Tools/Connect All Equipment. I get connection errors and the switches do not turn on at all. There is no way to turn them on using the tool. I put the log on Dropbox if you want to look at it:


Do you have the logs for this? I am at a point right now where I seem to be chasing problems I cannot identify here locally.

Can you clarify what you mean here?

Here is the log for SGP leaving devices connected:


Clarification, as requested:
When I use the tool, I get an immediate “ASCOM—Connected set end2”. This is the attempt to connect to the camera with no power. Clicking ok in that box, I get “Error connecting to QHYCCD-Cameras-Capture”.
Clicking ok to that box, I get more error boxes for the filter wheel and Robofocus server. Clicking ok to each boxe clears the window. At the end, with all the boxes cleared, the switches associated with those devices remain off.

OK, thanks. This is completely my fault (beta-life). A completely unrelated change seems to have diabled the option to disconnect. From your sequence, you can see the option is no longer enabled:

The changes that caused this are unrelated to what we have been chasing and involve moving these settings to a new area. I am looking at why the migration has seemingly failed, but, in the meantime, for any sequences you opened with the last beta, you’ll need to verify these setting. The “damage” should be isolated to only things found in the Sequence Settings window.

Once the options are set again, there appears to be no problem with them “sticking”


I hate to admit it but I didn’t even know those settings were there. Finally found the icon, set it, and made a run. About 5 seconds after devices disconnected, power was turned off to them. I also realize now that the settings box came up right below the selection icon - clever. I suspect that works for other icons as well. Ken, you’re too clever for me.

So now I think I can finally say that the switches will be quite useful to me in SGP.

It would still be nice to know why the switch activation errors that are supposed to take 30 seconds happen with no time elapsed; I hate unknowns.

I found by trial and error, using the countdown window and the DL web UI locally, that the lag seems somewhat inconsistent between getting errors and not. It appears to be as little as 3 seconds and as much as 7 seconds. I can also force errors by hitting “yes” within a second of when the switch appears to get turned on in the DL UI. So the camera takes on the order of a second or two after the power is turned on before it is power-ready.


One minor issue: if switches are turned on external to SGP and a sequence is run with all switches set to “unchanged” on start then SGP will display the message “Connecting to required switch devices” and not continue. Although already “on”, setting at least one switch change to “on” makes it work. Log at:


Are you certain all the switch states are set to unchanged? When I open the sequence from the logs you attached, I see this:


Relatively sure, but that must be the wrong log. Sorry! I just made another run:


Yes, thanks for this. I have been able to find and locate this issue for when you have switches available but are not using them. It will be in the next beta.

Thanks. Would it be possible to make “Tools/Connect All Equipment” work using the same logic as “Run Sequence” where it errors out then comes up with a time-out window after which it succeeds? Right now, I have to turn each switch on manually before using the tool or it fails on all devices does not turn them on.


Sorry, I’m still not clear on what you mean by “tool” here in this context.

I am, for obvious reasons, unable to reproduce this like you see it. What is the behavior that you see (as exactly as possible)? Are you saying it just fails immediately or something? But the switches are indeed in the state they should be in?

The context is that of SGP: Tools/Connect All Equipment.

Yes. It fails immediately (always has). If I try to use “Tools/Connect All Equipment” with no power yet, I get all the error messages for each device and at the end, nothing is turned on or connected. Here’s a log:


BTW, I certainly don’t need the tool to power on and connect to devices. I can do that by individually powering them on and connecting them. It’s just a “nice to have” feature. Tools/Disconnect All Equipment works ok. Normally, I would use the sequencer and that works ok, even with errors, after the startup error timeout window goes away automatically.