[Nut-upsuser] Powercom issues in NUT (was: PowerCom BNT2000AT ups on nut 2.6.0 - second try)

Keven L. Ates atescomp at gmail.com
Tue May 17 16:38:41 UTC 2011


Hmmm...
I patched the "BNT-other" driver.  You may want to try using that as
an alternative driver, since you can specify ALL the settings for your
UPS.

But to address your problem, we can look at the system and its
settings. The BNT type defaults as follows:

/*             Type */ "BNT",
/*  Number of Bytes */ 16,
/*     Flow Control */ {  "no_flow_control", no_flow_control },
/* Validation Bytes */ { { 11U, 0x42U }, { 8U, 0U }, { 8U, 0U } },
/* Power Kill Delay */ { { 1U, 30U }, 'y' },
/*        Frequency */ {  0.00020803, 0.0 },
/*           Load % */ {  1.4474,     0.0,   0.8594,  0.0 },
/*        Battery % */ {  5.0000,  0.3268,  -825.00,  0.46511, 0 },
/*          Voltage */ {  1.9216, -0.0977,  0.82857,  0.0000 },

You have:

driver = powercom
type = BNT
port = /dev/ttyS1
numOfBytesFromUPS = 16
methodOfFlowControl = no_flow_control
validationSequence = {{11,0x42},{8,0},{8,0}}
shutdownArguments = {{1,30},y}
modelname = BNT2000APT
serialnumber = 2233445566
Desc = Computer Room Small UPS

So, the "numOfBytesFromUPS", "methodOfFlowControl",
"validationSequence", and "shutdownArguments" are all defaults for
"BNT" and can be commented out of the config file. You can also let
NUT attempt to figure it all out by commenting out the "type" as well.

The raw data you report is:

>>  0 0x10 ( )    /* UPS_LOAD */
>>  1 0x64 (d)    /* BATTERY_CHARGE */
>>  2 0x68 (h)    /* INPUT_VOLTAGE */
>>  3 0x68 (h)    /* OUTPUT_VOLTAGE */
>>  4 0x32 (2)    /* INPUT_FREQUENCY */
>>  5 0xff (ÿ)    /* UPSVERSION */
>>  6 0x32 (2)    /* OUTPUT_FREQUENCY */
>>  7 0x00 ( )
>>  8 0x00 ( )
>>  9 0x04 ( )    /* STATUS_A */
>> 10 0x00 ( )    /* STATUS_B */
>> 11 0x4b (K)    /* MODELNAME */
>> 12 0x98 ()    /* MODELNUMBER */
>> 13 0x00 ( )
>> 14 0x00 ( )
>> 15 0x00 ( )

The problem seems to be with the "validationSequence". The debug shows:

raw[11] = 0x4b (K)
raw[08] = 0x0  (null)

but the validation is:

raw[11] == 0x42
raw[08] == 0x0
raw[08] == 0x0

So raw[11] shows that the UPS is reporting as a "KIN" type, not a
"BNT" type. This is odd as you report the UPS as "BNT2000APT". You can
try the "KIN" type, but the other raw values suggest "BNT" may be
correct: raw[12] == 0x98 means BNT model 2000 (for KIN its 1600) with
a sub-model > 7 so that the input voltage is modified (2.2 * raw[2] -
24 = 204.8).
To force it to use BNT, set "validationSequence = {{11,0x4b},{8,0},{8,0}}"

However, I would simplify the config file as follows:

>> > >  [APC1]
>> > >
>> > >        driver = powercom
>> > >        port = /dev/ttyS1
>> > >        modelname = BNT2000APT
>> > >        serialnumber = 2233445566
>> > >        desc = Computer Room Small UPS

and then, if that doesn't give you what you need, add "type =
BNT-other", repeat test, and add other elements as needed until you
get what you want.
Using "BNT-other", you can tweak all the settings to what you need for
display. The defaults for "BNT-other" will choose between BNT, KIN,
and IMP based on raw values.  Especially, if you have a 120 volt (US)
model, use "BNT-other" or set "linevoltage = 240". I use KNutClient to
check that my values are being reported accurately and tweak them
until they are correct (assuming there isn't a problem with the UPS).
An example "BNT-other" config:

[BNT1500AP]
    driver = powercom
    port = /dev/ttyS0
    desc = "PowerCom BNT 1500 AP"
    manufacturer = PowerCom
    modelname = BNT1500AP
    serialnumber = 13245678900
    type = BNT-other
#   linevoltage = 120
#   numOfBytesFromUPS = 16
#   methodOfFlowControl = no_flow_control
#   validationSequence = {{8,0},{8,0},{8,0}}
#   shutdownArguments = {{1,30},y}
#   frequency = {0.00027778,0.0000}
#   loadPercentage = {1.0000,0.0,1.0000,0.0}
#   batteryPercentage = {1.0000,0.0000,0.0000,1.0000,0.0000}
#   voltage = {2.0000,0.0000,2.0000,0.0000}

I hope that clears up any problems,
Keven

On Tue, May 17, 2011 at 2:54 AM, Arnaud Quette <aquette.dev at gmail.com> wrote:
> Dino, Alexey,
>
> there are a number of users suffering issues with your Powercom devices.
>
> Could you (Dino, and Keven if possible) please have a look at the below one,
> from Angela, and check for a fix?
>
> I've scheduled to release 2.6.1 next week, and having that fixed is part of
> the list.
>
>
> 2011/5/16 Angela Williams <angierfw at gmail.com>
>>
>> Hi All
>>
>> On Friday 13 May 2011 at 14:46 Arnaud Quette :-
>>
>> > Hi Angela,
>> >
>> > sorry for not replying earlier, which doesn't mean that I'm considering
>> > your issue.
>> > only that the agenda is crowded, and that support queue need
>> > consolidation...
>>
>> Thanks!
>>
>> > 2011/5/13 Angela Williams <angierfw at gmail.com>
>> >
>> > > Hi!
>> > > Normally nut was just worked and worked for me!
>> > > Not this time though!
>> > >
>> > > Distro is Gentoo withe latest nut-2.6.0 emerged today.
>> > > Linux kernel version is 2.6.36
>> > > UPS is PowerCom BNT2000AT
>> > > "Driver" is powercom
>> > > ups.conf looks like this! Okay so APC1 is not and APC!
>> > >
>> > >  [APC1]
>> > >
>> > >        driver = powercom
>> > >        type = BNT
>> > >        port = /dev/ttyS1
>> > >        numOfBytesFromUPS = 16
>> > >        methodOfFlowControl = no_flow_control
>> > >        validationSequence = {{11,0x42},{8,0},{8,0}}
>> > >        shutdownArguments = {{1,30},y}
>> > >        modelname = BNT2000APT
>> > >        serialnumber = 2233445566
>> > >        desc = Computer Room Small UPS
>> > >
>> > > (...)
>> >
>> > a powercom patch has recently been submitted, and I had to first discuss
>> > with the submitter about the possible fix of your issue with this patch:
>> > http://lists.alioth.debian.org/pipermail/nut-upsdev/2011-May/005408.html
>> >
>> > so, this seems quite positive for you, though the validation will come
>> > once
>> > the patch is merged, and tested on your side...
>> >
>> > note that the patch is there:
>> >
>> > http://lists.alioth.debian.org/pipermail/nut-upsdev/2011-April/005402.html
>>
>> Okay! I got the patched tarball, unpacked it, ran configure and make then
>> make
>> install. No probs!
>>
>> I tested the update driver and the result was still a validation error!
>> This is the console debug output!
>>
>> gatekeeper nut #  /lib/nut/powercom -a APC1 -DDDDDDDDDDNetwork UPS Tools -
>> PowerCom protocol UPS driver 0.13 (2.6.0-r2984)
>>   0.000000     debug level is '10'
>>   0.002388     Flow control disable
>>   0.002561     Num of bytes requested for reading from UPS: 16
>>   0.148057     Num of bytes received from UPS: 16
>> Raw data from UPS:
>>  0 0x10 ( )
>>  1 0x64 (d)
>>  2 0x68 (h)
>>  3 0x68 (h)
>>  4 0x32 (2)
>>  5 0xff (ÿ)
>>  6 0x32 (2)
>>  7 0x00 ( )
>>  8 0x00 ( )
>>  9 0x04 ( )
>> 10 0x00 ( )
>> 11 0x4b (K)
>> 12 0x98 ()
>> 13 0x00 ( )
>> 14 0x00 ( )
>> 15 0x00 ( )
>>   0.148222     data receiving error (validation check)
>>
>>
>> So there you have it! No phix yet! My C knowledge is not at a higher
>> enough
>> level to tackle on my own! I learnt just enough to get the feel of it!
>> Just
>> like cobol, algol and other weird languages!
>>
>> I can see the bit were the validation happens but I cannot get my head
>> around
>> it! Seems it checks each byte in turn but then I'm lost! I really wish I
>> could
>> hep a bit more!
>
> I also don't know enough on this protocol to help :(
> So, I've called to help from the manufacturer, and Keven who has worked a
> bit on the driver.
>
> cheers,
> Arnaud
> --
> Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
> Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
> Debian Developer - http://www.debian.org
> Free Software Developer - http://arnaud.quette.free.fr/
>
>



More information about the Nut-upsuser mailing list