ASCOM Generic UPS driver (for SGP)As my MountCMD tool could not warm up the camera, I decided to write this ASCOM Generic UPS SafetyMonitor driver for use in Sequence Generator Pro (SGP). It is written in C# .NET using Visual Studio and has passed the ASCOM Conform test (report is included in the zip file). Version 0.4.2 can be downloaded from my server: http://www.dehilster.info/docs/GenericUPS-Setup.zip
The driver works with the events in the Windows Application Events Logbook (can be accessed via eventvwr). This SafetyMonitor can be combined with others, like a weather SafetyMonitor, by using the ASCOM SafetyMonitor Hub.
ConfigurationBefore configuring the driver the UPS and its software should be installed (i.e. PowerChute for an APC UPS or PowerPanel for a CyberPower UPS).
The rest of the set-up can be done manually or semi-automatic.
Set-up fieldsThe Generic UPS SafetyMonitor works with a set of rules similar to a firewall. These rules can be specified and added by pressing the Add button. Once defined, each rule can be altered by clicking on the rule, editing the corresponding fields, and accept them by clicking the Update button.
There are several fields to be filled (see figure 2):
Manual set-up using Windows EventViewerIn order to find these Event-IDs, unplug the UPS from mains at a given time (e.g. 16:20:30) and plug it in again a short while later (e.g. 16:23:35). Start the Windows Event Viewer by clicking the [Windows] and [R] keys, typing "eventvwr" (without the quotes) and hitting enter. It should result in the adjacent screen.
Goto Windows-logbook->Application and search for the times that the UPS took over control. Note down the two Event-IDs given for the UPS events (174 and 61455 in this example) and enter these values in the driver setup. In case these two IDs are equal, note down the messages that come with it. If the Application logbook does not contain the necessary information, the System logbook may contain them. In that case the "Logbook to Monitor" in the driver should be changed to "System".
To test-fire the events:
BehaviourIf mains returns with the Set Unsafe Delay [minutes] time, the driver keeps the safe mode to safe. It will not return to safe when the delay time has expired, unless the option Report SAFE after Unsafe Delay is checked. There is, however, a risk that using this option will exhaust the UPS when multiple power failures occur shortly after each other. So use this option with caution and preferably with a short Set Unsafe Delay time.
The Generic UPS driver communicates with the ASCOM SafetyMonitor Hub. In that driver a timer will be visible when the UPS fails, while the alert window turns orange as an indication that the system is becoming unsafe.
The only thing not covered is the complete shutdown of the mount, but that is done using my MountCMD tool on computer shutdown.
I have tested this driver with SGP doing its stuff with a ZWO ASI1600MM Cool, a 10Micron GM3000 mount and the slaved LesveDome, which all parked and warmed up properly.
UPS systems tested so far
Hopefully other people will test my Generic UPS Safety Monitor driver and give some feedback on how their UPSís work. Please note that the driver will not work until the first image has been taken (that is a documented SGP feature, see the not at the bottom of their Safety Monitor page). If you wish to postpone imaging, it is best to have two targets in the sequence: one with a single exposure directly taken, the next target being timed.
Change logv.0.0.1 (14/06/2019): first stable version.
v.0.1.2 (23/06/2019): Added select options for System and Application, extended the triggers with search strings.
v.0.2.0 (10/07/2019): Added the option to return to safe even when delay time has expired. Added communication with SafetyMonitor Hub.
v.0.2.1 (10/07/2019): Bug fix in the count-down timer.
v.0.3.0 (13/07/2019): Added communication with UPS tests to see if the UPS is still connected.
v.0.4.0 (16/07/2019): Complete revised version of the UPS driver, now serializing events, by which it becomes possible to have an unlimited amount of SAFE and UNSAFE event detections.
v.0.4.1 (16/07/2019): Added Learning mode, by which the driver semi-automatically adds UPS events found in the Event Viewer.
v.0.4.2 (22/07/2019): Improved feedback of Learning mode, now not only showing the EventID, but also the event description.
If you have any questions and/or remarks please let me know.
Astronomical Twilight MountCMD MountMonitor ASCOM Generic UPS driver ASCOM SafetyMonitor Hub