Displaying 20 results from an estimated 26 matches for "dstate_getinfo".
2023 May 24
1
Synthesize low batt (LB) fron SNMP UPS which does not support this?
...:
@@ -1113,12 +1116,13 @@
/* write the status_buf into the externally visible dstate storage */
void status_commit(void)
{
+ upsdebugx(2, "%s: Entering (%d)", __func__, ignorelb);
while (ignorelb) {
const char *val, *low;
val = dstate_getinfo("battery.charge");
low = dstate_getinfo("battery.charge.low");
-
+ upsdebugx(2, "%s: charge val/low %s/%s']", __func__,
val, low);
if (val && low && (strtol(val, NULL, 10) < strtol(low,
NULL, 10))...
2005 Dec 19
0
new(er) SEC driver.
...Querying varnum %d",varnum);
break;
}
}
}
/*
* sec_setinfo(varnum, value)
*
* Update variable number <varnum> to value <value> in the info array.
*/
static void
sec_setinfo(int varnum, char *value)
{
char *s, buf[SEC_SIZE];
int i, e;
double d;
if (dstate_getinfo(sec_varlist[varnum].infotag) == 0) /* nothing to do */
return;
s = value;
if (sec_varlist[varnum].flags & SEC_FLAG_ENUM) {
i = strtol(value, &s, 10);
if ((s == value) || (*s != '\0')) { /* some problem */
upsdebugx(SEC_LOG_ERROR, "Error parsing enum for %s (%s)...
2023 May 24
1
Synthesize low batt (LB) fron SNMP UPS which does not support this?
...@
> /* write the status_buf into the externally visible dstate storage */
> void status_commit(void)
> {
> + upsdebugx(2, "%s: Entering (%d)", __func__, ignorelb);
> while (ignorelb) {
> const char *val, *low;
>
> val = dstate_getinfo("battery.charge");
> low = dstate_getinfo("battery.charge.low");
> -
> + upsdebugx(2, "%s: charge val/low %s/%s']", __func__, val, low);
> if (val && low && (strtol(val, NULL, 10) < strtol(low...
2018 Mar 23
3
Tripp-Lite BCPERS450 shutdown/restart problems
...on
fault.
I discovered the following code at line 571 in usbhid-ups.c. This is
part of the "checking for alternatives" code:
if (!strcasecmp(cmdname, "shutdown.return")) {
int ret;
/* Ensure "ups.start.auto" is set to "yes", if supported */
if (dstate_getinfo("ups.start.auto")) {
setvar("ups.start.auto", "yes");
}
ret = instcmd("load.on.delay", dstate_getinfo("ups.delay.start"));
if (ret != STAT_INSTCMD_HANDLED) {
return ret;
}
return instcmd("load.off.delay", dstate_ge...
2011 Feb 07
4
[PATCH/RFC v2 0/3] Updates to ACP smart driver
This is 2nd version of the earlier patch featuring a few new features
and fixes to the apcsmart driver, following the remarks in:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02294.html
Major changes from v1:
- handle battery.charge and battery.runtime checks at main.c level
- handle "immutable but writable" conflict gracefully at driver level
-
2018 Mar 20
2
Tripp-Lite BCPERS450 shutdown/restart problems
Hi, Charles. Are you by any chance planning to address my problems
where NUT does not know how to schedule a shutdown of this Tripp-Lite
UPS? If not, could you point me in the right direction? My best
understanding of the situation of the moment is that the right control
is UPS.OutletSystem.Outlet.DelayBeforeShutdown but that NUT does not
know to use that.
Thanks.
2015 Aug 20
6
APC BACK UPS 2200 model BZ2200BI-BR
Hi;
I'm having some trouble to comunicate with my just bought (08/17/15)
Ups. According to SOLIS(8):
SUPPORTED HARDWARE
This driver has been tested with :
Solis 1000 VA
Solis 1500 VA
Solis 2000 VA
Solis 3000 VA
Back-UPS BZ1200-BR
Back-UPS BZ2200BI-BR
So solis is the one to go for.
Here is my scenario:
SW: nut-2.7.3 (compiled from ports)
OS: FreeBSD
2023 May 22
2
Synthesize low batt (LB) fron SNMP UPS which does not support this?
Hmm. Is there maybe something there already that will do this? Maybe kind of back-handed.
In drivers/dstate.c, I see:
In status_init(), if ?driver.flag.ignorelb? is set in the driver state, the ?ignorelb? flag is set.
In status_set(), if ignorelb is set, and the status being set (presumably from the UPS) is LB, it?s ignored. In other words, LB reported by the UPS is ignored.
In status_commit(),
2011 Jan 25
1
[RFC] Updates to ACP smart driver
This patch introduces a handful of new options, I mentioned earlier in:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02088.html
See the large commit message in the follow-up for the details and rationale.
I realize it's a bit larger diff - so if it's required I can split it into few
smaller ones.
Michal Soltys (1):
APC smart driver update and new features.
2010 Mar 03
1
using upscode2 driver with Powerware 5119 RM
...does not support it");
}
} else {
upslogx(LOG_EMERG, "Can't determine if shutdown is supported, attempting
anyway");
}
upslogx(LOG_EMERG, "Emergency shutdown");
char msg[100];
snprintf(msg, 100, "UPS will reboot %ld seconds after shutdown",
strtol(dstate_getinfo("ups.delay.reboot"),NULL,10));
upslogx(LOG_EMERG, msg);
snprintf(msg, 100, "UPS shutting down in %ld seconds...",
strtol(dstate_getinfo("ups.delay.shutdown"),NULL,10));
upslogx(LOG_EMERG, msg);
upscsend("UPPC"); /* Powercycle UPS */
upscsend("IJHL...
2011 Mar 05
19
[RFC apcsmart V3 00/18] apcsmart driver updates
Sorry for a bit longer delay than I anticipated, I was stuffed with the work.
This is the next iteration of the patch adding some functionality to apcsmart
driver, and relying on 'ignorelb' recently added.
Follow up from previous thread:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02331.html
Main differences is that V3 is split into many small patches, so the
2023 Jan 12
0
experience with old Best Fortress? shutdown not seeming delayed
...space, as in "OFF 10"
but I could have bad memory or be confused.
3) It seems that "upsdrvctl shutdown" leads to rather immediate power
off, not a 10s delay. Power to the load stayed off and came back.
This is with 'upsmon -c fsd'.
4) The driver says
grace = dstate_getinfo("ups.delay.shutdown");
if (!grace)
grace = "1"; /* apparently, OFF0 does not work */
and I wonder what happens with OFF0. (Clearly OFF%S dereferencing a
null pointer is bad.)
5) It looks like an incomplete conversion to upslogx, and some remaining
pri...
2006 Jun 09
0
Cleaned up belkinunv diff
...... nothing major though;
- the first change comes out of me having a bit more of a clue as to how
things are working in the code, and makes the detection of [ waitonshutdown
== "true" ] a little more complete (I'd missed out getval when checking if
waitonshutdown were present and dstate_getinfo when checking if it were
true... I'm *really* not sure why I did... probably excess blood in my
caffeine stream at the time! ;-) )
- the second change removed the function I'd introduced to perform the
original "shutdown and hope" behaviour. The code is now back in
upsdrv_sh...
2006 Aug 23
0
bcmxcp: get right firmware version
...e them all, aka
ups.firmware.cpu0 etc.
$OpenBSD$
--- drivers/bcmxcp.c.orig Wed Aug 23 11:16:01 2006
+++ drivers/bcmxcp.c Wed Aug 23 11:21:26 2006
@@ -742,10 +742,7 @@ void upsdrv_initinfo(void)
(unsigned char)answer[iIndex]);
iIndex += 2;
len--;
- } while ((strcmp("00.00", dstate_getinfo("ups.firmware")) == 0) && len > 0);
-
- /* Increment index to point at end of CPU bytes. */
- iIndex += len * 2;
+ } while (len > 0);
}
/* Get rating in kVA, if present */
--
Henning Brauer, hb@bsws.de, henning@openbsd.org
BS Web Services, http://bsws.de
OpenBSD-b...
2006 Apr 26
1
RE nut 2.0 fentonups and Xanto S3000R
...um].highnorm;
+ }
}
/* now add instant command support info */
@@ -231,7 +249,8 @@ void upsdrv_initinfo(void)
dstate_addcmd("test.battery.stop");
printf("Detected %s on %s\n",
dstate_getinfo("ups.model"), device_path);
- free(raw);
+ if (raw)
+ free(raw);
/* paranoia - cancel any shutdown that might already be
running */
ret = ser_send(upsfd, "C\r");
@@ -406,6 +425,7 @@...
2013 Apr 02
3
blazer driver: Possible bugs with battery packs
...ttery packs. LThe battery packs detection code in
blazer.c is as follows:
static double blazer_packs(const char *ptr, char **endptr)
135{
136 const double packs[] = {
137 120, 100, 80, 60, 48, 36, 30, 24, 18, 12, 8, 6, 4, 3, 2, 1, 0.5, -1
138 };
139
140 const char *val;
141 int i;
142
143 val = dstate_getinfo("battery.voltage.nominal");
144
145 batt.volt.nom = strtod(val ? val : ptr, endptr);
146
147 for (i = 0; packs[i] > 0; i++) {
148
149 if (packs[i] * batt.volt.act > 1.2 * batt.volt.nom) {
150 continue;
151 }
152
153 if (packs[i] * batt.volt.act < 0.8 * batt.volt.nom) {
154...
2009 Aug 14
2
Bestfortress driver, network serial patch for nut-2.0
...uot;Setvar: unsettable variable %s", var);
return STAT_SET_UNKNOWN;
}
ups_setsuper (1);
if (setparam (parameter, len, data)) {
dstate_setinfo (var, "%*s", len, data);
}
ups_setsuper (0);
return STAT_SET_HANDLED;
}
void upsdrv_shutdown(void)
{
const char *grace;
grace = dstate_getinfo("ups.delay.shutdown");
if (!grace)
grace = "1"; /* apparently, OFF0 does not work */
printf ("shutdown in %s seconds\n", grace);
/* make power return when utility power returns */
autorestart (1);
upssend ("OFF%s\r", grace);
/* I'm nearly dead,...
2014 Aug 11
1
Cyberpower Value1200E might not need 0.667 battery scaling
...s @a battery_scale if voltage is well above nominal.
> + */
> +static void cps_adjust_battery_scale(double batt_volt)
> +{
> + const char *batt_volt_nom_str;
> + double batt_volt_nom;
> +
> + if(battery_scale_checked) {
> + return;
> + }
> +
> + batt_volt_nom_str = dstate_getinfo("battery.voltage.nominal");
> + if(!batt_volt_nom_str) {
> + upsdebugx(2, "%s: 'battery.voltage.nominal' not available yet; skipping scale determination", __func__);
> + return;
> + }
> +
> + batt_volt_nom = strtod(batt_volt_nom_str, NULL);
> + if(...
2013 Feb 08
0
Very long delay for shutdown.restart on usbhid-ups powercom
...be due to the following function, where
value seems to be splitted in seconds and minutes parts, then ORed with
0x4000 to perform the "return" feature.
$> less nut-2.6.4/drivers/powercom-hid.c
[...]
static double powercom_shutdown_nuf(const char *value)
{
const char *s = dstate_getinfo("ups.delay.shutdown");
uint16_t val, command;
val = atoi(value ? value : s);
command = ((val % 60) << 8) + (val / 60);
command |= 0x4000; /* AC RESTART NORMAL ENABLE */
upsdebugx(3, "%s: value = %s, command = %04X", __func...
2014 Aug 09
0
Cyberpower Value1200E might not need 0.667 battery scaling
On Aug 8, 2014, at 9:15 AM, Charles Lepple <clepple at gmail.com> wrote:
> On Aug 7, 2014, at 10:52 PM, Charles Lepple <clepple at gmail.com> wrote:
>
>> On Aug 7, 2014, at 10:18 PM, Matthew Stapleton <matthew4196 at gmail.com> wrote:
>>
>>> I just got a Cyberpower SOHO Value 1200 ELCD UPS and even with nut 2.7.2, it appears to report battery voltage