OK, I think this is a bug in the Pegasus ASCOM drivers, which SharpCap has a tendency to trigger when other applications might not.
The following code generates an error with Pegasus ASCOM drivers on the second attempt to connect after disconnecting
Code: Select all
Switch sw = new Switch("ASCOM.PegasusAstro.Switch 1");
Console.WriteLine("About to connect");
sw.Connected = true;
Console.WriteLine("About to disconnect");
sw.Connected = false;
Console.WriteLine("About to reconnect");
sw.Connected = true; // error happens here - Pegasus ASCOM drivers fail to reconnect
Console.WriteLine("All done");
Anyway, some of the code in SharpCap sets 'Connected' to false just to ensure a consistent state, and that action puts the Pegasus ASCOM driver into a broken state where it can't do anything else. In particular, the filter wheel code seems to do this.
I am going to try to deal with the unnecessary setting of Connected to false by SharpCap, which should allow the setup and connection to the Pegasus wheel to work. You will still get an error if you connect the wheel, disconnect it and then try to reconnect to it in SharpCap, since that directly triggers the disconnect/reconnect issue in the Pegasus ASCOM drivers. Hopefully they will fix that issue on the Pegasus side.
cheers,
Robin