Page 1 of 1

Detecting Power Failure?

Posted: Mon Feb 18, 2008 9:57 pm
by loo_hoo_ser
Hi Y'all -

I finally got around to getting a new UPS with a USB interface. I prevously had my HB server on an older UPS with a serial interface. However, I didn't have enough comm ports on the server to connect it to the UPS. The new one has a USB interface. I do know that Windows can detect when the battery in the UPS is reaching a certain level that can trigger a program execution at a certain threshold, and even shut down the server.

What I'd like to do is to somehow have HB notice that the power has gone out (UPS has switched over to battery power). I sometimes lose power for maybe 5 minutes.

So, how do I go about making the link between UPS and HB? Ideas? I don't necessarily need HB to do anything, but it's more of a "FYI - you lost power", but others might want to use it to do something else.

Thanks!

Posted: Tue Feb 19, 2008 5:09 am
by Richard Naninck
Some USB devices like FS20 and the UIRT are based on the same circuits which can be integrated using the FTD2XX.dll to create a virtual COM port. You should find out if there is some COM object you can use to talk to this UPC or figure what hardware it is based on. Maybe you can find a way to create a virtual COM port for it. How come your PC ran out of COM ports? That should be easy to expand.

Posted: Tue Feb 19, 2008 11:21 am
by yaccri
Did you receive any software with the UPS?
Can you use it to control HB?

Posted: Tue Feb 19, 2008 8:41 pm
by loo_hoo_ser
Richard -

I ran out of serial comm ports because my PC only had 1. I'm aware you can buy expansion serial port PCI cards but I didn't think it was worth the hassle.

yaccri -

The UPS is an APC Back-Up XS900 model. It does come with software, but I don't know enough about it whether it offers what I need to communicate with it (ie. query the state of the unit). Can someone tell me if it does, then, I'd be willing to look into it.

A thought I had would be to have Windows kick off a script file when it detects it is on battery power and the script would simply write to a text file of the time and date when it was executed - thus indicating the time and date of when power was lost. HB can simply monitor this script and do a tail of the last line in the file (presumably the last power off event).

Something like that..................... simple.