Angela Williams
2011-May-13  09:46 UTC
[Nut-upsuser] PowerCom BNT2000AT ups on nut 2.6.0 - second try
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
I running /lib/nut/powercom  -a APC1 -DDDDDDDDDD  (Okay so the debugs are 
overboard!!!)
Result is this!
Network UPS Tools - PowerCom protocol UPS driver 0.12 (2.6.0)
   0.000000     debug level is '10'
   0.002058     Flow control disable
   0.002408     Num of bytes requested for reading from UPS: 16
   0.147226     Num of bytes received from UPS: 16
Raw data from UPS:
 0 0x0f ( )
 1 0x64 (d)
 2 0x6b (k)
 3 0x6b (k)
 4 0x32 (2)
 5 0xff (?)
 6 0x32 (2)
 7 0x00 ( )
 8 0x00 ( )
 9 0x00 ( )
10 0x00 ( )
11 0x4b (K)
12 0x98 ()
13 0x00 ( )
14 0x00 ( )
15 0x00 ( )
   0.147415     data receiving error (validation check)
   0.147460     send_to_all: SETINFO device.type "ups"
   0.147489     send_to_all: SETINFO driver.version "2.6.0"
   0.147516     send_to_all: SETINFO driver.version.internal "0.12"
   0.147543     send_to_all: SETINFO driver.name "powercom"
   0.147570     send_to_all: SETINFO ups.mfr "PowerCom"
   0.147596     send_to_all: SETINFO ups.model "BNT2000APT"
   0.147622     send_to_all: SETINFO ups.serial "2233445566"
   0.147649     send_to_all: SETINFO ups.model.type "BNT"
   0.147675     send_to_all: SETINFO input.voltage.nominal "230"
   0.147699     send_to_all: ADDCMD test.battery.start
   0.147722     send_to_all: ADDCMD shutdown.return
   0.147746     send_to_all: ADDCMD shutdown.stayoff
   0.147833     Num of bytes requested for reading from UPS: 16
   0.293224     Num of bytes received from UPS: 16
I did run an strace and saw this! Starting at sending the single char!
ioctl(4, SNDCTL_TMR_START or TCSETS, {B1200 -opost -isig -icanon -echo ...}) = 
0
write(4, "\1", 1)                       = 1
nanosleep({0, 0}, NULL)                 = 0
gettimeofday({1304946608, 723932}, NULL) = 0
write(2, "   0.013837\t", 12)           = 12
write(2, "Num of bytes requested for readi"..., 48) = 48
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 982709})
read(4, "\17", 16)                      = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 992263})
read(4, "d", 15)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 991229})
read(4, "l", 14)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 992217})
read(4, "l", 13)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 991206})
read(4, "2", 12)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 992220})
read(4, "\377", 11)                     = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 991215})
read(4, "2", 10)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 992207})
read(4, "\0", 9)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 991206})
read(4, "\0", 8)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 992191})
read(4, "\0", 7)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 991224})
read(4, "\0", 6)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 991209})
read(4, "K", 5)                         = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 992207})
read(4, "\230", 4)                      = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 991207})
read(4, "\0", 3)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 992208})
read(4, "\0", 2)                        = 1
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 991208})
read(4, "\0", 1)
gettimeofday({1304946608, 869751}, NULL) = 0
write(2, "   0.159656\t", 12)           = 12
write(2, "Num of bytes received from UPS: "..., 35) = 35
write(1, "Raw data from UPS:\n", 19)    = 19
write(1, " 0 0x0f ( )\n", 12)           = 12
write(1, " 1 0x64 (d)\n", 12)           = 12
write(1, " 2 0x6c (l)\n", 12)           = 12
write(1, " 3 0x6c (l)\n", 12)           = 12
write(1, " 4 0x32 (2)\n", 12)           = 12
write(1, " 5 0xff (\377)\n", 12)        = 12
write(1, " 6 0x32 (2)\n", 12)           = 12
write(1, " 7 0x00 ( )\n", 12)           = 12
write(1, " 8 0x00 ( )\n", 12)           = 12
write(1, " 9 0x00 ( )\n", 12)           = 12
write(1, "10 0x00 ( )\n", 12)           = 12
write(1, "11 0x4b (K)\n", 12)           = 12
write(1, "12 0x98 (\230)\n", 12)        = 12
write(1, "13 0x00 ( )\n", 12)           = 12
write(1, "14 0x00 ( )\n", 12)           = 12
write(1, "15 0x00 ( )\n", 12)           = 12
gettimeofday({1304946608, 871867}, NULL) = 0
write(2, "   0.161772\t", 12)
write(2, "   0.161772\t", 12)           = 12
write(2, "data receiving error (validation"..., 40) = 40
gettimeofday({1304946608, 872193}, NULL) = 0
write(2, "   0.162098\t", 12) 
Only strange think I could see is the label on the back of the ups proclaims 
it to be BNT 2000 APT. The lable lists both AP and APT but the APT version is 
the selected one!
I'm not great c programmer otherwise I would have given it a go!
So anyone any ideas? I have just had a scsi disk scribbled over in the /var 
filesystem thanks to poor power on the site and NUT not working!
Cheers
Ang
-- 
Angela Williams
angierfw at gmail dot com
Linux/Networking Hacker
Blog http://angierfw.wordpress.com
Smile! Jesus Loves You!
Arnaud Quette
2011-May-13  12:46 UTC
[Nut-upsuser] PowerCom BNT2000AT ups on nut 2.6.0 - second try
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... 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 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/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20110513/e44e20ea/attachment.htm>