Re: [Nut-upsuser] Support of amp; amp; amp; amp; quot; shutdown.returnamp; amp; amp; amp; quot; on a APC Back-UPS CS 500

2011-01-20 Thread Kevin
Kevin bakdong at gmail.com writes:

 
 on 19/01/2011 15:31 Arjen de Korte wrote:
  Please also post the output of 'upsc upsname' (see 'man 8 upsc') and 
  'upscmd -l upsname' (see 'man 8 upscmd') for both devices, so that we 
  can see which commands are detected.

APC Smart-UPS 1000

# clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 31.5
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.4.1
driver.version.data: APC HID 0.93
driver.version.internal: 0.34
input.voltage: 224.6
output.voltage: 224.6
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 20
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.vendorid: 051d


# ./clients/upscmd -l apc1500
Instant commands supported on UPS [apc1500]:

beeper.disable - Description unavailable
beeper.enable - Description unavailable
beeper.mute - Description unavailable
beeper.off - Description unavailable
beeper.on - Description unavailable
load.off - Description unavailable
load.off.delay - Description unavailable
load.on - Description unavailable
load.on.delay - Description unavailable
shutdown.reboot - Description unavailable
shutdown.return - Description unavailable
shutdown.stayoff - Description unavailable
shutdown.stop - Description unavailable
test.battery.start.deep - Description unavailable
test.battery.start.quick - Description unavailable
test.battery.stop - Description unavailable
test.panel.start - Description unavailable
test.panel.stop - Description unavailable




APC CS 500

# clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2010/09/19
battery.mfr.date: 2010/09/19
battery.runtime: 3877
battery.runtime.low: 120
battery.temperature: 29.2
battery.type: PbAc
battery.voltage: 13.6
battery.voltage.nominal: 12.0
device.mfr: American Power Conversion
device.model: Back-UPS CS 500
device.serial: 4B1038P51197
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95
driver.version.internal: 0.35
input.sensitivity: medium
input.voltage: 224.0
input.voltage.nominal: 230
output.voltage: 230.0
output.voltage.nominal: 230.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.firmware: 808.q10 .I
ups.firmware.aux: q10
ups.load: 0.0
ups.mfr: American Power Conversion
ups.mfr.date: 2010/09/19
ups.model: Back-UPS CS 500
ups.productid: 0002
ups.serial: 4B1038P51197
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.timer.start: 0
ups.vendorid: 051d


# ./clients/upscmd -l apc1500
Instant commands supported on UPS [apc1500]:

beeper.disable - Description unavailable
beeper.enable - Description unavailable
beeper.mute - Description unavailable
beeper.off - Description unavailable
beeper.on - Description unavailable
load.off - Description unavailable
load.off.delay - Description unavailable
load.on - Description unavailable
load.on.delay - Description unavailable
shutdown.reboot - Description unavailable
shutdown.return - Description unavailable
shutdown.stayoff - Description unavailable
shutdown.stop - Description unavailable
test.battery.start.deep - Description unavailable
test.battery.start.quick - Description unavailable
test.battery.stop - Description unavailable
test.panel.start - Description unavailable
test.panel.stop - Description unavailable


  It may be a log easier to do the testing with the upscmd 
  'shutdown.return' (Smart-UPS 1000) and 'shutdown.reboot' (CS-500) 
  while the upsd server is running. During testing, it allows you to run 
  an instance of upslog (see 'man 8 upslog') so that you'll be able to 
  see the 'ups.timer.*' variables counting down. I suspect that the 
  current mapping might be wrong.
 
  Also note that the (re)start delay set in the Smart-UPS 1000 is 
  presently set to 180 seconds, so you may have to wait a little longer 
  that expected for the output to be switched on after the power returns.
 
 Thanks Arjen. I've spent a little more time on it today and can confirm 
 that shutdown.reboot works as expected with the Smart-UPS 1000. (I only 
 tested this by commenting out the shutdown.return code in the usbhid-ups 
 driver) I will try with the upscmd command tomorrow.
 
 This matches and confirms the behaviour of the 2.4 versions.

On the Smart-UPS 1000, all the instant commands do more or less what you would 
expect. Looking at the 

Re: [Nut-upsuser] Support of amp;amp; amp; amp; amp; quot; shutdown.returnamp;amp; amp; amp; amp; quot; on a APC Back-UPS CS 500

2011-01-20 Thread Kevin
Kevin bakdong at gmail.com writes:

Sorry, this is the correct output for the Smart-UPS 1000


# clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 6300
battery.runtime.low: 120
battery.temperature: 31.5
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 226.0
output.voltage: 226.0
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.2
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 051d



___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Support of amp; amp; amp; amp; quot; shutdown.returnamp; amp; amp; amp; quot; on a APC Back-UPS CS 500

2011-01-20 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:

On the Smart-UPS 1000, all the instant commands do more or less what  
you would

expect. Looking at the timers using upsc apc1500 I now see that:

 shutdown.
   load.off/load.off.delay both set the shutdown timer to 90, shuts down
 after 90 seconds


It looks like this is the minimum time the UPS allows. On almost every  
other HID PDC UPS we know of, the granularity is much finer than that  
(usually one to ten seconds). It is quite possible that your UPS was  
originally designed with a serial interface (possibly even a dumb one)  
and that the USB interface was added later on. So this may be all the  
underlying hardware supports.



   reboot sets the reboot timer to 90, sleeps after 90 seconds


Same here.


   return immediately switches to battery for a moment, sets both shutdown
 and startup to 90 seconds, sleeps after 90 seconds


That is very odd. You could try what happens if you change the  
'ondelay' and 'offdelay' values in 'ups.conf'. Set offdelay to 1  
second and ondelay to 100/200/400 seconds and run the shutdown.return  
command again (while monitoring the 'ups.timer.shutdown' and  
'ups.timer.start' through upslog or upsc.



 test.panel and beeper commands also work as expected.

So you are right, it does seem to be working on this model. I don't  
know why I
didn't see this when I was testing originally. Also I don't  
understand why the
shutdown.return, which seems to be translated to load.on.delay,  
load.off.delay

is used in preference to the shutdown.reboot command.


According to the USB HID PDC specifications, the 'reboot n' command  
will kill the power immediately and return after 'n' seconds if power  
is present or will wait until the power returns if it wasn't. We  
prefer to have a little grace period, so that's why we do the two step  
approach of setting both the shutdown and (re)start timers.


By setting a restart timer longer than the shutdown timer, this  
effectively allows for a grace period until the UPS switches off. From  
then it behaves like a reboot command. You need this grace period if  
you want your system to hibernate instead of shutdown, since the Linux  
kernel doesn't allow calling hooks just before it powers off the system.


Apparently, due to the dreadful granularity of your UPS hardware  
timers the commands we send


load.on.delay 30
load.off.delay 20

are interpreted as setting both to 90 seconds. Worse, since the  
ups.timer.start elapses before the ups.timer.shutdown, this  
effectively puts the UPS to sleep.



On the CS 500 the load.off switches it off immediately, the load.off delay,
shutdown.return and shutdown.stayoff all switch to battery, and set  
the shutdown

timer to 20 seconds and then shuts down after that time. (Never restarts) The
beeper commands work, as does the shutdown.stop (sets the shutdown  
timer to -1)


This probably requires some remapping of variables. I'll see if I can  
find a solution for that.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Support of amp; amp; amp; amp; amp; quot; shutdown.returnamp; amp; amp; amp; amp; quot; on a APC Back-UPS CS 500

2011-01-20 Thread Kevin
Arjen de Korte nut+users at de-korte.org writes:

 
 Citeren Kevin bakdong at gmail.com:

 return immediately switches to battery for a moment, sets both shutdown
   and startup to 90 seconds, sleeps after 90 seconds
 
 That is very odd. You could try what happens if you change the  
 'ondelay' and 'offdelay' values in 'ups.conf'. Set offdelay to 1  
 second and ondelay to 100/200/400 seconds and run the shutdown.return  
 command again (while monitoring the 'ups.timer.shutdown' and  
 'ups.timer.start' through upslog or upsc.

Like this?

[apc1500]
driver=usbhid-ups
port=auto
ondelay=200
offdelay=1

After restarting the driver, and running shutdown.return, the timers are set to 
90 and 200. (the values of ups.delay.shutdown and ups.delay.start)

REBOOT:-1 SHUT:-1 START:-1
REBOOT:-1 SHUT:-1 START:-1
REBOOT:-1 SHUT:89 START:199
REBOOT:-1 SHUT:89 START:199
REBOOT:-1 SHUT:89 START:199
REBOOT:-1 SHUT:85 START:195
REBOOT:-1 SHUT:85 START:195
REBOOT:-1 SHUT:83 START:193
REBOOT:-1 SHUT:83 START:193

Using values of 250 and 1 gives:

delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:-1 START:-1
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:-1 START:-1
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:86 START:246
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:86 START:246
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:84 START:244
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:84 START:244

 
 According to the USB HID PDC specifications, the 'reboot n' command  
 will kill the power immediately and return after 'n' seconds if power  
 is present or will wait until the power returns if it wasn't. We  
 prefer to have a little grace period, so that's why we do the two step  
 approach of setting both the shutdown and (re)start timers.
 
 By setting a restart timer longer than the shutdown timer, this  
 effectively allows for a grace period until the UPS switches off. From  
 then it behaves like a reboot command. You need this grace period if  
 you want your system to hibernate instead of shutdown, since the Linux  
 kernel doesn't allow calling hooks just before it powers off the system.
 

Ok, this makes sense now. The Smart-UPS 1000 apparently has some variations on 
the 'standard'. The CS 500, by the way, is more compliant at least with the 
reboot command using hidups, in that it actions the command straight away. I'd 
be very happy if we could get the reboot command to work on this one too.

 Apparently, due to the dreadful granularity of your UPS hardware  
 timers the commands we send
 
  load.on.delay 30
  load.off.delay 20
 
 are interpreted as setting both to 90 seconds. Worse, since the  
 ups.timer.start elapses before the ups.timer.shutdown, this  
 effectively puts the UPS to sleep.

The default appears to be that they are both set equal (at the minimum value of 
90), and so elapse at the same time. 

Isn't putting the UPS to sleep the desired behaviour here, so that it wakes up 
again when power returns?

 
  On the CS 500 the load.off switches it off immediately, the load.off delay,
  shutdown.return and shutdown.stayoff all switch to battery, and set  
  the shutdown
  timer to 20 seconds and then shuts down after that time. (Never restarts) 
The
  beeper commands work, as does the shutdown.stop (sets the shutdown  
  timer to -1)
 
 This probably requires some remapping of variables. I'll see if I can  
 find a solution for that.

On the CS 500, the shutdown timer is the only one that changes at all. The 
reboot and start timers stay at zero (not -1) all the time.

Regards,
Kevin.




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser