Closed Simcheck closed 7 months ago
Hi! Thank you for your report! I'll need more information in order to be able to reproduce the issue. Which switch device are you using under the hood? My code is very straightforward. I just proxy calls to the actual driver without making any changes, but if I am able to reproduce this, then I may be able to find a subtle bug I had not thought about. Thanks!
Thanks for taking a look at it. The switch is the common Digital Logger Web Power Switch using the 'ASCOM Driver for DigitalLogger Web Power Switch Series'. My scenario is that in a given sequence I am turning a single port/switch on the device on and off. Once at the beginning of the evening and once at the end. When I do this directly with the above driver I have no problem. When I do it through the Dark Sky Geek ASCOM Switch Hub I do get the error. I am not connecting to any other device within the Switch Hub. If you need any further info I'll be happy to provide. Thanks again.
A short update - hopefully positive for ASCOM Switch Hub. I previously mentioned I could not reproduce this behaviour when using the ''ASCOM Driver for Digital Logger Web Power Switch Series'. However, that is no longer the case. I do not know the reason but now I routinely will get the same error above regardless whether I am using ASCOM Switch Hub or ASCOM Driver for Digital Logger ... So I do not think this issue is directly related to ASCOM switch HUB or at least is not limited to it. Another curious issue which I will post on NINA Discord is the fact that when I experience the above switch failure, and with the sequence still running, I can immediately go to Equipment Tab |Switches and manually toggle the specified switch on or off. This works regards of which driver I use. But for now I would consider this not to be an issue of ASCOM Switch Hub.
What I hope is a final update. I spoke at length to tech support at Digital Loggers. They confirmed there had been memory leak issues with the switch. Also stated they were aware of others having issues with ASCOM drivers. After discussing it was determined that I should upgrade to latest version of firmware. Since doing so I have not experienced any issues with either of the Digital Logger ASCOM related drivers. This has been over a period of 6 days of continuous usage. Small sample size so far but looks promising. DL's firmware notes indicate several references to memory leaks over past several firmware versions. I am using the LPC9 Web Power Switch Pro model and have upgraded to FW 1.13.9.0 dated 28 Sep 2023.
When using the switch hub with DigitalLogger switch experience an ASCOM exception - ASCOM.DriverException: WebClient does not support concurrent I/O operations. This occurs when calling switch a second time in sequence: Log snippets:
Start of sequence switch usage: 2023-09-13T18:25:40.8304|INFO|SequenceItem.cs|Run|206|Starting Category: Connector, Item: ConnectEquipment, Selected device: Switch, Selected device id: ASCOM.DarkSkyGeek.SwitchHub 2023-09-13T18:25:49.8965|INFO|SwitchVM.cs|Connect|266|Successfully connected Switch. Id: ASCOM.DarkSkyGeek.SwitchHub Name: DarkSkyGeek’s ASCOM Switch Hub Driver Version: 1.0 2023-09-13T18:25:49.8966|INFO|SequenceItem.cs|Run|224|Finishing Category: Connector, Item: ConnectEquipment, Selected device: Switch, Selected device id: ASCOM.DarkSkyGeek.SwitchHub
2023-09-13T18:25:50.6375|INFO|SequenceItem.cs|Run|206|Starting Category: Switch, Item: SetSwitchValue, SwitchIndex 3, Value: 1
2023-09-13T18:56:56.2120|INFO|SequenceItem.cs|Run|206|Starting Category: Switch, Item: SetSwitchValue, SwitchIndex 3, Value: 0 2023-09-13T18:57:04.8718|INFO|SequenceItem.cs|Run|224|Finishing Category: Switch, Item: SetSwitchValue, SwitchIndex 3, Value: 0
End of sequence usage: 2023-09-14T03:56:11.1509|INFO|SequenceItem.cs|Run|206|Starting Category: Switch, Item: SetSwitchValue, SwitchIndex 3, Value: 1 2023-09-14T03:56:11.1519|ERROR|SequenceItem.cs|Run|233|Category: Switch, Item: SetSwitchValue, SwitchIndex 3, Value: 1 - ASCOM.DriverException: WebClient does not support concurrent I/O operations. ---> System.Exception: WebClient does not support concurrent I/O operations. --- End of inner exception stack trace --- at ASCOM.Com.DriverAccess.DynamicAccess.CheckDotNetExceptions(String memberName, Exception e) at ASCOM.Com.DriverAccess.DynamicAccess.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result) at CallSite.Target(Closure, CallSite, Object, Int16, Double) at ASCOM.Com.DriverAccess.Switch.SetSwitchValue(Int16 id, Double value) at NINA.Equipment.Equipment.MySwitch.Ascom.AscomWritableSwitch.SetValue() in C:\Projects\nina\NINA.Equipment\Equipment\MySwitch\Ascom\AscomWritableSwitch.cs:line 36 at NINA.WPF.Base.ViewModel.Equipment.Switch.SwitchVM.SetSwitchValue(Object arg) in C:\Projects\nina\NINA.WPF.Base\ViewModel\Equipment\Switch\SwitchVM.cs:line 91 at NINA.Sequencer.SequenceItem.SequenceItem.Run(IProgress`1 progress, CancellationToken token) in C:\Projects\nina\NINA.Sequencer\SequenceItem\SequenceItem.cs:line 27