Arnaud Quette
2012-Feb-13 17:58 UTC
[Nut-upsdev] RFC: new variable battery.status (was: [PATCH] upscode2: Report ABM Status)
2012/2/6 thomas schorpp <thomas.schorpp at googlemail.com>:> Hi,Hi Thomas,> I want the driver report the battery status from ABM charging controllers > -patch attached- :thanks for your patch. since it introduces a new variable (battery.status.abm), I prefer to step back and think to something useful more widely. thus, I'm thinking about a generic "battery.status" that would have the following possible values: - charging - floating (charging method with lower voltage) - resting (not charging nor discharging) a complementary status should be discharging, when none of the above applies. For the time being, this only applies to Eaton manufactured UPSs. But I'd like to get feedback from owners of other devices, that support an equivalent technology. This data would apply to upscode2, bcmxcp*, usbhid-ups ("MGE" subdriver) and possibly snmp-ups. For now, I've tracked your patch here: https://alioth.debian.org/tracker/index.php?func=detail&aid=313541&group_id=30602&atid=411544> http://www.google.de/url?sa=t&rct=j&q=advanced+battery+management+floating&source=web&cd=1&ved=0CDMQxQEwAA&url=http%3A%2F%2Fdocs.google.com%2Fviewer%3Fa%3Dv%26q%3Dcache%3AH0Fy9-ZmujgJ%3Alit.powerware.com%2Fll_download.asp%253Ffile%253DABM_datasheet_rev_A_re_working.pdf%2Badvanced%2Bbattery%2Bmanagement%2Bfloating%26hl%3Dde%26gl%3Dde%26pid%3Dbl%26srcid%3DADGEESj_h5zp2cVwCOSCZP0BgmzG3jNOC9cq_54FStVvgWoYVD6lauUNAqYpMSoVxYMf3dcNF2_9x_ZGCPNGnnlm6OVZuvi8VzKvbVfwVdNISlcSrdzqaeS3b8I2WApj9E_Yh38CGIww%26sig%3DAHIEtbRE44qDSR4VtSuK7qOOLZSRVz7XYA&ei=ytUvT6XyBILKtAbJk4ndDA&usg=AFQjCNH0GuqrYphp6h9t1jtWcAu0LzGsBw > > battery.capacity.nominal: 17.00 > battery.charge: 74.4 > battery.runtime: 1620 > battery.status.abm: RS (New) > battery.voltage: 26.10* > battery.voltage.maximum: 28.20 > battery.voltage.minimum: 20.00 > battery.voltage.nominal: 24.00 > > Since my ancient Compaq T1000h got it, response STBM should be widely > implemented: > http://webcache.googleusercontent.com/search?q=cache:Pt8WJTtgaW0J:old.networkupstools.org/protocols/eaton/UC2concept-1002889j.odt+upscode+II+pdf&cd=1&hl=de&ct=clnk&gl=de > > BTW, possible bug: Wether my new lead AGM batteries are broken (Cold weather > storage damage in GLS logistics transport?) > http://media.rotek.at/a000/000/007/000000007_V000000_HAB_HIG_00_RT_A_de.pdf > > *or the charge estimation calculator of the driver is broken: > > battery.capacity.nominal: 17.00 > battery.charge: 93.9 > battery.runtime: 1620 > battery.status.abm: FT > battery.voltage: 27.70 > battery.voltage.maximum: 28.20 > battery.voltage.minimum: 20.00 > battery.voltage.nominal: 24.00 > device.mfr: Compaq > device.model: UPS 1000 VA FW -0026 > device.serial: E00230050 > > My UPS does not support UPBS cmd, but its responses are not very useful > anyway.as mentioned in the manpage and source code, no battery.charge data is returned from the device. "the driver will guestimate a value based on the nominal battery min/max and the current battery voltage." so it may be due to both. It may also be a percentage of the nominal level, which may be not reachable after some time. cheers, Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/
thomas schorpp
2014-Nov-03 23:25 UTC
[Nut-upsdev] RFC: new variable battery.status (was: [PATCH] upscode2: Report ABM Status)
Hi, Am 13.02.2012 um 18:58 schrieb Arnaud Quette:> 2012/2/6 thomas schorpp <thomas.schorpp at googlemail.com>: >> Hi, > > Hi Thomas, > >> I want the driver report the battery status from ABM charging controllers >> -patch attached- : >> For now, I've tracked your patch here: > https://alioth.debian.org/tracker/index.php?func=detail&aid=313541&group_id=30602&atid=411544 >Thanks, but no anonymous read access, so not very useful linking on public lists: "You've been redirected to this login page because you have tried accessing a page that was not available to you as an anonymous user.">> *or the charge estimation calculator of the driver is broken: >> >> battery.capacity.nominal: 17.00 >> battery.charge: 93.9 >> battery.runtime: 1620 >> battery.status.abm: FT >> battery.voltage: 27.70 >> battery.voltage.maximum: 28.20 >> battery.voltage.minimum: 20.00 >> battery.voltage.nominal: 24.00 >> device.mfr: Compaq >> device.model: UPS 1000 VA FW -0026 >> device.serial: E00230050> > as mentioned in the manpage and source code, no battery.charge data is > returned from the device. > "the driver will guestimate a value based on the nominal battery > min/max and the current battery voltage."Maybe I've found a better "guesstimation", -PATCH found cleaning up old stuff attached-> > so it may be due to both. > It may also be a percentage of the nominal level, which may be not > reachable after some time.We're talking about lead/acid batteries here? A lead battery not reaching its rated nominal after charge is usually considered to be broken, ask Your car garage mechanic ;-) And now it's after "some (EU warranty) time" for my batteries: battery.capacity.nominal: 17.00 battery.charge: 98.3 battery.runtime: 2280 battery.status.abm: RS battery.voltage: 25.90 battery.voltage.maximum: 28.20 battery.voltage.minimum: 20.00 battery.voltage.nominal: 24.00 ups.mfr: Compaq ups.model: UPS 1000 VA FW -0026 ups.serial: E00230050 Voltage still above "nominal" in ABM resting state. And one more, the "panel test" isn't a "panel test", it's a complete selftest including the controller, inverter and fan under load here. Here's the last patch for people using NUT and still have got an upscode2 talking UPS, who may find it useful, pls report breakage.> > cheers, > Arnaud >y tom --- drivers/upscode2.c 2012-05-15 13:22:07.000000000 +0200 +++ drivers/upscode2.c 2012-07-18 15:39:15.000000000 +0200 @@ -32,7 +32,7 @@ * Powerware 9305 * * Also tested against - * Compaq T1500h (Per J?nsson <per.jonsson at bth.se>) + * Compaq T1000h/T1500h (T.Schorpp, <thomas.schorpp at gmail.com>, Per J?nsson <per.jonsson at bth.se>) * Powerware 9120 (Gorm J. Siiger <gjs at sonnit.dk>) * Fiskars PowerServer 10 (Per Larsson <tucker at algonet.se>) */ @@ -45,7 +45,7 @@ #include <math.h> #define DRIVER_NAME "UPScode II UPS driver" -#define DRIVER_VERSION "0.88" +#define DRIVER_VERSION "0.89abm" /* driver description structure */ upsdrv_info_t upsdrv_info = { @@ -54,7 +54,7 @@ "H K Lygre, <hklygre at online.no>\n" \ "Niels Baggesen <niels at baggesen.net>\n" \ "Niklas Edmundsson <nikke at acc.umu.se>", - DRV_EXPERIMENTAL, + DRV_BETA, { NULL } }; @@ -262,7 +262,7 @@ { "STAT", t_list, NULL, 0, 0, att }, { "STBO", t_status, NULL, UPSC_STAT_ONBATT }, { "STBL", t_status, NULL, UPSC_STAT_LOBATT }, - { "STBM", t_ignore }, + { "STBM", t_string, "battery.status.abm" }, { "STBP", t_status, NULL, UPSC_STAT_BYPASS }, { "STEA", t_list, NULL, 0, 0, env }, { "STEM", t_list, NULL, 0, 0, env }, @@ -412,8 +412,8 @@ { "shutdown.stop", "UPPU", NULL }, { "shutdown.reboot", "UPPC", "IJHLDMGCIU" }, { "shutdown.reboot.graceful", NULL, NULL }, - { "test.panel.start", "UPIS", NULL }, - { "test.panel.stop", NULL, NULL }, + { "test.selftest.start", "UPIS", NULL }, /* Spec:"UPIS(cr)INITIATE SELF TEST" not "panel test" */ + { "test.selftest.stop", NULL, NULL }, { "test.failure.start", NULL, NULL }, { "test.failure.stop", NULL, NULL }, { "test.battery.start", "UPBT", "1" }, @@ -1363,6 +1363,7 @@ static float batt_charge_pct(void) { float chg=-1; + float batt_volt_rs = (batt_volt_nom * 26/24); /* ABM specs Vrs at 108.333 % Vnom */ /* This is only a rough estimate of charge status while charging. * When on battery something like Peukert's equation should be used */ @@ -1389,9 +1390,10 @@ chg *= (100/maxcurr); } /* Old method, assumes battery high/low-voltages provided by UPS are - * applicable to battery charge, but they usually aren't */ + * applicable to battery charge, but they usually aren't, cause high is a UPS internal and/or battery + * ABSOLUTE MAXIMUM RATING, not reported as "nominal" value, the upscode2 spec maybe wrong. */ else if (batt_volt_low > 0 && batt_volt_high > 0 && batt_volt > 0) { - if (batt_volt > batt_volt_high) { + if (batt_volt > batt_volt_rs) { chg=100; } else if (batt_volt < batt_volt_low) { @@ -1399,7 +1401,7 @@ } else { chg = (batt_volt - batt_volt_low) / - (batt_volt_high - batt_volt_low); + (batt_volt_rs - batt_volt_low); chg*=100; } }
THANKYOUTHANKYOUTHANKYOUTHANKYOU!!!!!! There was a smaller patch posted to the list for lines -1389,9 +1390,10 a couple years ago, it helped some - BUT - it was still buggy. I have a Compaq R3000, I will get this patch integrated pronto and test Note that since the UPS relies on the voltage from the battery pack to determine state of charge, it is quite useful to add in the battery pack voltage to the logs as such: --- upslog.c.orig 2012-07-31 10:38:58.000000000 -0700 +++ upslog.c 2014-02-20 09:23:14.000000000 -0800 @@ -50,6 +50,7 @@ static flist_t *fhead = NULL; #define DEFAULT_LOGFORMAT "%TIME @Y at m@d @H at M@S% %VAR battery.charge% " \ + "%VAR battery.voltage% %VAR output.current% " \ "%VAR input.voltage% %VAR ups.load% [%VAR ups.status%] " \ "%VAR ups.temperature% %VAR input.frequency%" Ted On 11/3/2014 3:25 PM, thomas schorpp wrote:> Hi, > > Am 13.02.2012 um 18:58 schrieb Arnaud Quette: >> 2012/2/6 thomas schorpp <thomas.schorpp at googlemail.com>: >>> Hi, >> >> Hi Thomas, >> >>> I want the driver report the battery status from ABM charging >>> controllers >>> -patch attached- : >> > >> For now, I've tracked your patch here: >> https://alioth.debian.org/tracker/index.php?func=detail&aid=313541&group_id=30602&atid=411544 >> >> > > Thanks, but no anonymous read access, so not very useful linking on > public lists: > > "You've been redirected to this login page because you have tried > accessing a page that was not available to you as an anonymous user." > >>> *or the charge estimation calculator of the driver is broken: >>> >>> battery.capacity.nominal: 17.00 >>> battery.charge: 93.9 >>> battery.runtime: 1620 >>> battery.status.abm: FT >>> battery.voltage: 27.70 >>> battery.voltage.maximum: 28.20 >>> battery.voltage.minimum: 20.00 >>> battery.voltage.nominal: 24.00 >>> device.mfr: Compaq >>> device.model: UPS 1000 VA FW -0026 >>> device.serial: E00230050 > >> >> as mentioned in the manpage and source code, no battery.charge data is >> returned from the device. >> "the driver will guestimate a value based on the nominal battery >> min/max and the current battery voltage." > > Maybe I've found a better "guesstimation", -PATCH found cleaning up old > stuff attached- > >> >> so it may be due to both. >> It may also be a percentage of the nominal level, which may be not >> reachable after some time. > > We're talking about lead/acid batteries here? A lead battery not > reaching its rated nominal after charge is usually considered to be broken, > ask Your car garage mechanic ;-) > > And now it's after "some (EU warranty) time" for my batteries: > > battery.capacity.nominal: 17.00 > battery.charge: 98.3 > battery.runtime: 2280 > battery.status.abm: RS > battery.voltage: 25.90 > battery.voltage.maximum: 28.20 > battery.voltage.minimum: 20.00 > battery.voltage.nominal: 24.00 > ups.mfr: Compaq > ups.model: UPS 1000 VA FW -0026 > ups.serial: E00230050 > > Voltage still above "nominal" in ABM resting state. > > And one more, the "panel test" isn't a "panel test", it's a complete > selftest including the controller, inverter and fan under load here. > > Here's the last patch for people using NUT and still have got an > upscode2 talking UPS, who may find it useful, pls report breakage. > >> >> cheers, >> Arnaud >> > > y > tom > > --- drivers/upscode2.c 2012-05-15 13:22:07.000000000 +0200 > +++ drivers/upscode2.c 2012-07-18 15:39:15.000000000 +0200 > @@ -32,7 +32,7 @@ > * Powerware 9305 > * > * Also tested against > - * Compaq T1500h (Per J?nsson <per.jonsson at bth.se>) > + * Compaq T1000h/T1500h (T.Schorpp, <thomas.schorpp at gmail.com>, Per > J?nsson <per.jonsson at bth.se>) > * Powerware 9120 (Gorm J. Siiger <gjs at sonnit.dk>) > * Fiskars PowerServer 10 (Per Larsson <tucker at algonet.se>) > */ > @@ -45,7 +45,7 @@ > #include <math.h> > > #define DRIVER_NAME "UPScode II UPS driver" > -#define DRIVER_VERSION "0.88" > +#define DRIVER_VERSION "0.89abm" > > /* driver description structure */ > upsdrv_info_t upsdrv_info = { > @@ -54,7 +54,7 @@ > "H K Lygre, <hklygre at online.no>\n" \ > "Niels Baggesen <niels at baggesen.net>\n" \ > "Niklas Edmundsson <nikke at acc.umu.se>", > - DRV_EXPERIMENTAL, > + DRV_BETA, > { NULL } > }; > > @@ -262,7 +262,7 @@ > { "STAT", t_list, NULL, 0, 0, att }, > { "STBO", t_status, NULL, UPSC_STAT_ONBATT }, > { "STBL", t_status, NULL, UPSC_STAT_LOBATT }, > - { "STBM", t_ignore }, > + { "STBM", t_string, "battery.status.abm" }, > { "STBP", t_status, NULL, UPSC_STAT_BYPASS }, > { "STEA", t_list, NULL, 0, 0, env }, > { "STEM", t_list, NULL, 0, 0, env }, > @@ -412,8 +412,8 @@ > { "shutdown.stop", "UPPU", NULL }, > { "shutdown.reboot", "UPPC", "IJHLDMGCIU" }, > { "shutdown.reboot.graceful", NULL, NULL }, > - { "test.panel.start", "UPIS", NULL }, > - { "test.panel.stop", NULL, NULL }, > + { "test.selftest.start", "UPIS", NULL }, /* Spec:"UPIS(cr)INITIATE > SELF TEST" not "panel test" */ > + { "test.selftest.stop", NULL, NULL }, > { "test.failure.start", NULL, NULL }, > { "test.failure.stop", NULL, NULL }, > { "test.battery.start", "UPBT", "1" }, > @@ -1363,6 +1363,7 @@ > static float batt_charge_pct(void) > { > float chg=-1; > + float batt_volt_rs = (batt_volt_nom * 26/24); /* ABM specs Vrs at > 108.333 % Vnom */ > > /* This is only a rough estimate of charge status while charging. > * When on battery something like Peukert's equation should be used */ > @@ -1389,9 +1390,10 @@ > chg *= (100/maxcurr); > } > /* Old method, assumes battery high/low-voltages provided by UPS are > - * applicable to battery charge, but they usually aren't */ > + * applicable to battery charge, but they usually aren't, cause high is > a UPS internal and/or battery > + * ABSOLUTE MAXIMUM RATING, not reported as "nominal" value, the > upscode2 spec maybe wrong. */ > else if (batt_volt_low > 0 && batt_volt_high > 0 && batt_volt > 0) { > - if (batt_volt > batt_volt_high) { > + if (batt_volt > batt_volt_rs) { > chg=100; > } > else if (batt_volt < batt_volt_low) { > @@ -1399,7 +1401,7 @@ > } > else { > chg = (batt_volt - batt_volt_low) / > - (batt_volt_high - batt_volt_low); > + (batt_volt_rs - batt_volt_low); > chg*=100; > } > } > > > _______________________________________________ > Nut-upsdev mailing list > Nut-upsdev at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev
Charles Lepple
2014-Nov-08 13:23 UTC
[Nut-upsdev] RFC: new variable battery.status (was: [PATCH] upscode2: Report ABM Status)
On Nov 3, 2014, at 6:25 PM, thomas schorpp <thomas.schorpp at gmail.com> wrote:>> For now, I've tracked your patch here: >> https://alioth.debian.org/tracker/index.php?func=detail&aid=313541&group_id=30602&atid=411544 >> > > Thanks, but no anonymous read access, so not very useful linking on public lists: > > "You've been redirected to this login page because you have tried accessing a page that was not available to you as an anonymous user."Note that you replied to an email from two years ago. We tried to make things work with the Alioth tracker, but the admins were not very responsive when issues cropped up. In the time since that patch was posted, we tried to move everything to Github, and it looks like we missed at least one patch. (I'm listed as an administrator on the Alioth NUT project, and I even get that error when I'm logged in, so there seems to be an inconsistency in their database.) Try not to assume that we are intentionally making things difficult. We're happy to integrate this patch in to NUT, especially since many users are not compiling NUT from source anymore. It looks like the "battery.status.abm" variable is new, though, so to get back to Arnaud's original question, should we have a more general "battery.status"? http://article.gmane.org/gmane.comp.monitoring.nut.devel/5884 -- Charles Lepple clepple at gmail