Monday, June 18, 2012

Using APC Back-UPS XS1500

I have a home business and built an Windows 2008R2 System so I could run Hyper-V. It was a used system but just what I needed.
I also needed a power backup so there was a sale at Staples and I bought an  APC Back-UPS XS 1500.
Plenty of backup power to shut down my server safely.
I connected the USB cable to my computer, it acknowledges the APC 1500 and reported 100% charged.
I set the power levels for percentage of battery loss using the Windows UPS options and I was set.

First power drop the next day, my server did an emergency power down.
I pull the plug to test the UPS and it held the computer at POST for 5 minutes.
I boot the computer, plugged in the UPS USB cable and it report 90% then 95% then 99, then 100%. Now very confused, I went online to APC.
Turns out the APC Back-UPS XS 1500 is not supported by APC on Windows 2008R2, you must buy the Smart series.
I loaded PowerChute Home and it works. It keeps the computer up during short spikes and drop-outs.
Being an engineer I wanted to see when the events.  PowerChute does not write to the system log file except on Shutdown.
So I wrote a simple web app to read the PowerChute eventlog.dat file and show the events.
I found a decoder work sheet and got error definitions.
Try it out at http://www.seltron.net/apc/powerchute.php
Let me know how it works for you.
If there is another APC log format with different event status I will try and update the application.

Give it a try.

34 comments:

  1. Update, I found there are at least three different version of the log file and I have updated my application.
    I do not have the event decoder for the other events, but do have time-date of the event.
    I will update as I learn.

    ReplyDelete
  2. Updates made to fix byte pair failure.

    ReplyDelete
  3. I think that Event Key 173 = "Battery backup transferred to battery power due to undervoltage."

    and

    I think that Event Key 61453 = "Battery backup transferred to battery power due to electrical noise."

    I hope this helps.

    Tom Krajci

    ReplyDelete
  4. Thanks Tom,
    Yes that helps, I added those events to my decoder.

    Glenn

    ReplyDelete
  5. Hi.
    Thank you for the APC eventlog decoder, it is immensely useful to be able to decode the whole eventlog with timestamps. Just wish APC had also logged the maximum mains voltage somewhere.
    At the moment I am writing an insurance claim to the Utility Company - they lost control of the voltage in my area last week, there was widespread damage, even 400V surge suppressors in power supplies and VFD motor drives connected to our 230V/50Hz Mains vent up in smoke!!
    I know when this happened and think that I can definitely add Event Key 172 = "Battery backup transferred to battery power due to overvoltage."
    Hope this helps.
    Best regards
    Thor.

    ReplyDelete
  6. Hm, running PowerChute PE 3.0.2 on a W2k3 Server machine, all these entries added to eventlog.dat can also be found in the "Application" event log, including the proper timestamps.
    So, there *is* a way to read the log data, but when it comes to automation, reading the NT event log using Win32 API calls is like hell. The PHP eventlog parser does really make things much easier.

    ReplyDelete
  7. Any hints on how to connect APC smart ups to windows 2012 - My device manager only shows "Simple communications controller" and cannot find any driver. (In 2008 where i also tested it - a Battery device appeared when I connected the UPS).

    Is there a driver somewhere ?

    ReplyDelete
  8. Answer: Don't connect the UPS to a USB3 connector on Win2012 ! Moving the plug to a USB2 connector solved the issue and battery appeared in the device list.

    ReplyDelete
  9. Thanks Codex!
    Blog is very informative. It helped!
    APC back UPS

    ReplyDelete
  10. Your blog is very nice and I was also find this kind of long Sistemas de Alimentación Ininterrumpida battery for long time and this post help me out.

    Thanks
    Senetic.es

    ReplyDelete
  11. I was hoping to find a cause for 61515 and 61514 on PE V3.0 running on Win2012 server. I have a VBS that looks for unusual events and emails me. These occurred and it appears I've lost a non-UPS output port, but I haven't had time to verify. Like your interpreter and output format.

    ReplyDelete
    Replies
    1. I believe these are new codes. I have seen these codes start appearing a little over a year ago in my logs as well.
      Sorry, I have not been able to associate with any event. They could be replacing the serial RS-232 lost comm codes with USB lost and regained comm codes.
      Please let me know what you find. I am still on Windows 2008R2.

      Delete
    2. Found a way to create the codes:
      61515 Turn off Power Save (press mute and display simultaneously for 2 sec)
      61514 Turn on Power Save (press mute and display simultaneously for 2 sec)

      Leaf is shown in display. (ups model BX1500G) when Power Save is on.

      Delete
    3. Thank you.
      I will update the program to reflect this new information.

      Delete
  12. High Performance Computer and Electronics UPS for Premium Power Protection. The Back-UPS Pro family offers guaranteed power protection for high performance computer systems, routers/modems, external storage devices, game consoles and other electronics in your home or business. apc back-ups

    ReplyDelete
  13. Thank you. Enjoy your coffee. Without your App I was lost. I will use the data to show Southern California Edison (SCE) that my power is dirty and contributed to an electrical fire inside my A/C.

    ReplyDelete
  14. Great utility! Thanks for putting this together. I did notice in the Excel output file that the minutes and seconds column seem to be reversed. Otherwise this worked like a charm.
    Thanks again!

    ReplyDelete
  15. Do you have support for PowerChute Business Edtion v8.5 or v9.0.3? I tried unknown #1 and #2, too many bad values.

    ReplyDelete
  16. Working like a charm on Back-UOS XS 1100CI with PowerChute PE 3.0.2

    ReplyDelete
  17. Event Key 61454 means: Battery backup transferred to Baterry power

    Appears on my Back-UPS CS500 when power supply is removed from UPS

    ReplyDelete
  18. I want to write my own personal website information centre for my Back-UPS XS 950U and I managed to read out the usage of power in watt.

    I'd really like to read out the current voltage with PHP somehow, but the only way could be to have the PCPE application open all the time, read out PCPELog.txt and filter the voltages from this file.

    Another thing for the webbased information centre would be the possibility to read the eventlogs from eventlog.dat. So, would you mind sharing the code to read out the eventlog.dat?

    ReplyDelete
  19. I have developed a JAVA application that reads the DataLog every 30 minutes and stores the information in a database. I would like to do the same with the EventLog but cannot decode the file. Would you be so kind as to share the code you use to decode the EventLog? Thank you very much in advance.

    ReplyDelete
  20. Hi I'd like to read my data.dat file from PowerChute Agent Business edition. I hope you can help. Thanks.

    ReplyDelete
    Replies
    1. if you can upload a log file for me i will look at the format.

      Delete
  21. thanks for your wonderfull utility!

    Here you can find a full list of codes by another user.
    https://forums.apc.com/spaces/7/ups-management-devices-powerchute-software/forums/general/11727/powerchute-personal-edition-3-0-2-windows-event-id-list/1#87825

    Great job letting us use it!

    Alain Charles

    ReplyDelete
  22. Is your utility not working anymore ??

    Alain

    ReplyDelete
  23. BTW: HWinfo64 (it's a monitor) can read real-time data from APC...
    I use it to monitor and graph (Using MSIAfterburner)the total power flowing trough the UPS main.
    But there is a bunch of other info as well.

    ReplyDelete
  24. This comment has been removed by the author.

    ReplyDelete
  25. I have been writing my own program to do the same thing without connection to the internet. I have decoded as much as you have, but can't figure out something. I know it is little endian and that each event is 20 bytes long. They are as follows:

    year2, year1, month, pad, weekday, pad, day, pad, hour, pad, minute, pad, second, pad, unknown2, unknown1, eventcode2, eventcode1, pad, pad.

    What I can't figure out are those unknowns. I thought at first they might be checksums, but they aren't at the end of the line and don't follow any standard checksum algorithm I know of. Does anyone have any idea what they are? I believe I have everything your program outputs, so you may not know, but I thought I would check.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  26. Hi!
    Is it possible to use an offline version?
    Thanks

    ReplyDelete
  27. Hi all, I have created a new standalone tool for parsing and viewing the events. It also allows you to filter, sort and extract to Excel - you can download it here - http://www.pcassistsoftware.co.uk/ccount/click.php?id=16. Hope it is useful.

    ReplyDelete