[Nut-upsdev] bcmxcp patch

Kjell Claesson kjell.claesson at epost.tidanet.se
Tue Jan 8 23:05:37 UTC 2008


OK Michael,

I have looked at the patch.
Den Monday 07 January 2008 10.45.13 skrev Arnaud Quette:
> Hi Michael,
>
> I've forwarded your patch to Kjell, who's maintaining the bcmxcp
> driver, and to the nut development list.
>
> Kjell and others have more knowledges of the xcp protocol and will be
> able to analyze your patch.
>
> 2008/1/4, michalwd1979 <michalwd1979 at o2.pl>:
> > Hello Arnaud,
> > I am sending You a small patch to bcmxcp.c and bcmxcp.h files from
> > nut-2.2.0. I written this because bcmxcp lacks some features that I
> > wanted to have, and it was quite straight forward anyway. The changes
> > are: 
> > 1) I changed shutdown.stayoff instant command to shut down after 
> > user-defined delay, just like shutdown.return. Small problem is with
> > delay time: XCP defines this delay time in minutes not in seconds like
> > for "return". The driver converts "shutdowndelay" option to minutes,
> > everything below 120sec means 1 minute. 

Yep this command is for delay of 1-65534 minutes (about 45 days).
And as you say delay of 0 is not working. Because if you set delay
0 you abort (clear) any pending delay on/off command.

The best way to accomplice this is to set the 'outlet parameter (auto on)'
to -1. Then it would not power up automatic after a shutdown.return,
but you need to order a 'ups on' command.

This is thing I have in my TO DO list. But I need some testing equipment,
and time :-)

But as the outlet setting are missing on some ups I will take a closer look
on a way to get this into the driver. And your way is in the notebook.

The plan is also to have settable config parameter.

Even if the driver looks ready, it is not. That is why it is marked 
experimental. When I'm finished it may include a coffee-pot parameter,
because looking at what is possible in the protocoll I think it can
make coffee also :-)

> > 2) I added load.on, load.off 
> > instant commands. They works as expected 

Something like that is already in 2.2.1. But I was planning on reading
the loadsegment config and make a smarter switching that can be used
together with the 'upssched' to preserve power to critical parts.

But the ups.on / off (load.on load.off) can go into the driver. The problem
is that a ups with loadsegments switch the segments, but a ups whitout
segments power off.

It would have been nice to write a driver for just one type like pw9120.
But this driver is going to be used on pw3105 up to 3-phase pw9155.

> > 3) I added test.panel.start 
> > command. In XCP this is SYS_TEST but it test front panel on my ups as
> > well 

This part i can put in.

But I plan to change things in tha driver so that ups'es with no frontpanel
don't diplay this command when you do a upscmd -l <ups>.
This goes for all commands that is not implemented in the ups.

> > 4) I added shutdowntype config option. The idea is taken from 
> > apcsmart.c, 0 (default) means shutdown and return, 1 means shutdown and
> > stay off. The delay is defined in shutdowndelay just like for
> > shutdown.return and shutdown.stayoff commands.
> >

I have put this into my notes. So when it goes into the driver it would
be as you describe in 4)


> > The patch should be applied from main directory with -p1 option. I hope
> > that you find it useful. I tested this with HP/Compaq R3000 XR Euro ups
> > (3kW, 230V) with serial connection. Works right without any problems.
> >

I patch it by hand. As I only have the trunk and testing branch from cvs.
And it would not apply clean to that.

> > Oh, I almost forgot: The serial cable for this UPS is standard 9 pins
> > male (ups side) to 9 pins female (computer side) straight cable. Nice
> > that it uses typical pinouts. Pins 2 and 6 are connected inside ups. On
> > pin 9 ups outputs +8-12V DC voltage, I did not connected this pin. I
> > don't know if the ups can be used in "dumb" mode, but if smart works then
> > who cares?
> >

Yes this is something that is nice about some of the powerware and HP/Compaq.
Don't think that the R3000 XR have any 'dumb mode', but the older T models
using upscode2 (they don't us strait cables  ;-(  ) have a type of dumb mode.

But you can check the manual. But as you say if the smart mode works
it give you more info about the ups.

> > Best Regards,
> > Michael Widlok
> >
> > PS let me know if You will apply the patch or drop it, I just want to
> > know.
>
> thanks for your contribution,
> Arnaud

If thing goes as planned, you may find a driver with manny more features
not so far in the future. Even if it is not included exactly as the patch,
I am greatfull for the feedback and suggestions of improvements to the
driver.

Regards
Kjell



More information about the Nut-upsdev mailing list