[Nut-upsdev] questions re. patching bcmxcp.c and choosing variable names

Kjell Claesson kjell.claesson at epost.tidanet.se
Fri Apr 6 09:32:50 UTC 2007

Hi Oliver,

fre 2007-04-06 klockan 00:39 -0400 skrev Oliver Wilcock:
> I've patched bcmxcp.c such that it can power cycle the outlet load
> segments independently on a Powerware PW5125 UPS.  I presume that it will
> work for any XCP protocol UPS with 2 load segments.

No only after rev A. And it is overkill on ups'es with one load segment.
This can be handled by asking the ups for the commands it can handle,
put this in a struct a use this to build the right numbers of instant

For the moment i have a more intricate problem in the driver to solve.
This would not be any problem if i only have to support one rev of 
the firmware.

> Should these instant commands be called
> outlet.1.shutdown.return
> outlet.2.shutdown.return
> ?
> Where do the descriptions displayed by upscmd -l come from?  Presently it
> shows
>  outlet.1.shutdown.return - Unavailable
>  outlet.2.shutdown.return - Unavailable

Look at the mail from Arjen about the naming. The command is not a
load-off command. It is 'Delayed Load Power Off & Restart Command'.

So it going to shut down the outlet in t time and restart the outlet:

1. When the Utility Input is within an acceptable range, AND

2. After the Utility Stabilization delay (from the Extended Limits
block), AND

3. After a UPS-dependent internal start-up delay

> And just in case there is someone out there who has documentation of the
> XCP protocol.  What is the 4th byte of the 0x8A command for?  I tinkered
> with values until it worked, but it would be nice to know if sending 0x00
> means something unpleasant that hasn't yet become apparent...

Then command used in the driver is.

0xAB (start) 0x02 (lenght) 0x8A (cmnd) 0xXX (time) 0xXX (Csum)

You may set a longer delay by entering one more field:

0xAB (start) 0x03 (lenght) 0x8A (cmnd) 0xXX (time) 0xXX (time) 0xXX

(sorry for the linebreak) This give you up to 65,534 seconds delay 
instead of 255 seconds.Then you may set it on a outlet
0xAB (start) 0x04 (lenght) 0x8A (cmnd) 0xXX (time) 0xXX (time) 0xXX
(outlet) 0xXX (Csum)

Where outlet is 1-64 or you may set it to 255 to shut off all outlet.
Observe the time is in 2 bytes (0 - 65535 seconds).

So the command should handle the input of time and outlet to control

It would be better to use the 0x91 (on) 0x93 (off) command with the
length of 0x04.

Referred to 'PW_UPS_ON_TIME' and 'PW_UPS_OFF_TIME' in the bcmxcp.h
This is more a Load.n.off Load.n.on and it looks like this.

0xAB (start) 0x04 (lenght) 0x93 (cmnd) 0xXX (time) 0xXX (time) 0xXX
(outlet) 0xXX (Csum)

0xAB (start) 0x04 (lenght) 0x91 (cmnd) 0xXX (time) 0xXX (time) 0xXX
(outlet) 0xXX (Csum)

But the time is in Minutes and LS byte first.

> And since I'm so green that I don't know what a patch in diff -u format
> means, would someone be kind enough to explain how to submit this patch
> (or point me to a succinct description).

You can send me the patch, I check it out and if I like it it goes into
the driver.


More information about the Nut-upsdev mailing list