realbasic-nug
[Top] [All Lists]

Re: APC UPS connection

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: APC UPS connection
From: Kimball Larsen <kimball at kimballlarsen dot com>
Date: Sun, 30 Mar 2003 23:50:39 -0700
I have seen several good write ups on the APC protocol, and you are correct that there are some open source tools for linux that do communicate with APC stuff over both serial and usb. The best one is apcupsd, a simple google search will show you all you need to know about it. I would google for the protocol description as well.

An important point to mention - the communication with the UPS CAN be 2 way... there are 2 major types of UPS, the "dumb" ups, and a "smart" ups. (APC sells these as their "BackUPS" and "SmartUPS" lines, respectively. The dumb ones pretty much only make noise on the line when there is a power failure, and report that fact. Other than that, you can't get a lot of info from them. The smart ones are the type you can query for battery level, time remaining on the current charge, amount of current being drawn etc. However, BOTH (as I understand it) versions have the ability to be told to turn themselves off...

For example, I maintain several linux servers right now that are connected to BackUPS 500 from apc. The apcupsd daemon is configured to shut down the servers after 30 seconds when a power failure occurs, and to turn off the UPS a minute later. This conserves battery power on the UPS, should another failure occur shortly after power returns.

So, in short, I would say you probably have to roll your own on this one (unfortunately) and I would recommend that you look for the docs on the protocols that APC uses for comms with their devices.

--Kimball


On Sunday, March 30, 2003, at 05:35 PM, chris wrote:

Has anyone written a class or plugin that can connect to an APC UPS and
pick up the power info data it transmits?

Did you ask the developer of the machines?

You certainly need a driver for this.

APC no longer appears to offer the Mac version of their software for
prior to OS 9. They also don't appear to offer a software SDK, but there are some open source Linux tools that pick up the data from their UPSes.
So before I attempted to understand the protocol from looking at the
Linux code, I was hoping someone already did the work for RB.

I don't think a driver is needed.

From what I understand, the communication is pretty much one way. The UPS
sends data over a cable plugged into the serial port. You either read the data and understand what it is, or you ignore it. You never send anything back to the UPS. All that happens is you read the data sent, and then act however you want based on the data. (the data is things like line voltage levels, battery power levels, and possibly remaining battery time, but I suspect that is actually calculated at the client based on battery level
and rate of discharge)

-chris
<http://www.mythtech.net>


---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>

Subscribe to the digest:
<mailto:realbasic-nug-digest at lists dot realsoftware dot com>


------------------------------------------------------------------------ -----------------------
"Not everything that can be counted counts,
        and not everything that counts can be counted."
                - Albert Einstein



---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>

Subscribe to the digest: <mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.


<Prev in Thread] Current Thread [Next in Thread>