[Nut-upsuser] NUT 2.0.5 and 2.2.2 hacking -- there is something to improve!

Kārlis Repsons karlis.repsons at gmail.com
Mon Dec 8 07:56:36 UTC 2008


On Saturday 06 December 2008 12:50:41 you wrote:
> Citeren Kārlis Repsons <karlis.repsons at gmail.com>:
> >> Not having access to such a device was the
> >> #1 reason to hardcode these intervals in the first place. Making this
> >> configurable, complicates this since we can't fallback to a couple of
> >> settings that were used before.
> >> Your UPS will probably support setting a shutdown delay value between
> >> 0 and 99
> >
> > That could be too much my-ups-specific! The manufacturer did post me info
> > about 1..10, I know, 0 is working too, but more I didn't test!
>
> Please forward whatever information you have about this. Like I said,
> I don't even know if this value is in seconds or minutes, so any
> information you have is more than I have now.

Here it goes what I have:

The BP100 ups uses the Cyberpower protocol (a 
standard protocol in low power UPSs) and 
according to the official documentation of the protocol:
6. Shutdown Control

6.1 Shutdown only

Client:         Sxx<cr>
UPS:            #err_code<cr>

Asking UPS to shutdown after xx minute later. The 
value xx should be .1 to .9 or 01 to 10.
The z is error code to indicate does this operate 
is success. 0 is means success, otherwise, wrong in this operation.
If UPS does have no any response then have wrong in this operation.
When UPS received this command it should be 
turn-off at time expired and never restore.
Exception :
Prior model of UPS had not follow above rule, 
there have a exception: When UPS received this 
command at battery-mode, it should turn-off the 
outlet at time expired then restore the outlet at 
time of utility power recovered. the later 
designed UPS should correct this issue.

6.2 Shutdown with Restore

Client:    SxxRyyyy<cr>
UPS:       #err_code<cr>

Asking UPS to shutdown after xx minutes later 
then restore after yyyy minutes since command was 
received. The value xx should be .1 to .9 or 01 
to 10, value yyyy should be 0000 to 9999.
The z is error code to indicate does this operate 
is success. 0 is means success, otherwise, wrong in this operation.
If UPS does have no any response then have wrong in this operation.


6.3 Sleep

Client:         Zxx<cr>
UPS:    #y<cr>

Asking UPS to shutdown after xx minute later. The 
value xx should be .1 to .9 or 01 to 10.
When UPS received this command at line-mode, it 
should turn-off the outlet at time expired then restore it immediately.
When UPS received this command at battery-mode, 
it should turn-off the outlet at time expired then 
restore the outlet at time of utility power recovered.
In both mode, the restoration is according to 
feature of Auto-Restart is enabled or disabled.
The UPS should promise to do response for any condition.
The y is error code to indicate does this operate 
is success. 0 is means success, otherwise, wrong in this operation.
Note :
While UPS have no any response for Zxx<cr> 
command, that means UPS do not support this 
command. In order to make UPS to do shutdown, 
using Sxx<cr> to instead of Zxx<cr> command.
If UPS accept Sxx<cr> command rather than Zxx<cr> 
command, that means UPS will restore while 
utility power will recover.(see 6.Scheduled Shutdown/Shutdown only/Exception)


6.4. Cancel Shutdown Operation.

Client:         C<cr>
UPS:            #err_code<cr>

Asking UPS to stop Shutdown.
The z is error code to indicate does this operate 
is success. 0 is means success, otherwise, wrong in this operation.
If UPS does have no any response then have wrong in this operation.

As I wrote, I don't know about xx values greater than 10.

>
> > Anyway, my idea is, that driver should support full range (if there is no
> > autodetection with UPS), and should take any command as input. Then it
> > would be up to UPS to handle or reject it.
>
> Like the other drivers that support start- and shutdown delays, this
> will be configurable through 'ups.conf' with the 'ondelay' and
> 'offdelay' parameters. The only validation there will be in the
> driver, is if the value fits within the 2 or 4 character space that is
> available in the command.

So I could just compile powerpanel driver and replace for tests? I guess no, 
because of I have 2.0.5 NUT. (maybe use driver more directly?)

>
> Best regards, Arjen


k.



More information about the Nut-upsuser mailing list