Arnaud Quette
2011-May-17 07:54 UTC
[Nut-upsuser] Powercom issues in NUT (was: PowerCom BNT2000AT ups on nut 2.6.0 - second try)
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/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20110517/4bce1f60/attachment.htm>
Keven L. Ates
2011-May-17 16:38 UTC
[Nut-upsuser] Powercom issues in NUT (was: PowerCom BNT2000AT ups on nut 2.6.0 - second try)
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 UPSand 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/ > >
Angela Williams
2011-May-18 11:57 UTC
[Nut-upsuser] Powercom issues in NUT (was: PowerCom BNT2000AT ups on nut 2.6.0 - second try)
Hi All and Keven in particular! On Tuesday 17 May 2011 at 18:38 Keven L. Ates :-> 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.This I did with the settings below!> However, I would simplify the config file as follows: > >> > > [APC1] > >> > > > >> > > driver = powercom > >> > > port = /dev/ttyS1 > >> > > modelname = BNT2000APT > >> > > serialnumber = 2233445566 > >> > > desc = Computer Room Small UPSResult was worse with only 11 bytes!> 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 just added the type as suggest of BNT-other and would you believe that it worked! Here is the debug output! gatekeeper nut # /lib/nut/powercom -a APC1 -DDDDDDDDDD Network UPS Tools - PowerCom protocol UPS driver 0.13 (2.6.0-r2984) 0.000000 debug level is '10' 0.001862 Flow control disable 0.002045 Num of bytes requested for reading from UPS: 16 0.147783 Num of bytes received from UPS: 16 Raw data from UPS: 0 0x0f ( ) 1 0x64 (d) 2 0x70 (p) 3 0x70 (p) 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.147958 Detected: BNT-other-2000AP , 220V 0.148042 Values of arguments: 0.148065 manufacturer : 'PowerCom' 0.148085 model name : 'BNT2000APT' 0.148105 serial number : '2233445566' 0.148125 line voltage : '220' 0.148144 type : 'BNT-other' 0.148164 number of bytes from UPS: '16' 0.148183 method of flow control : 'no_flow_control' 0.148206 validation sequence: '{{8,0},{8,0},{8,0}}' 0.148227 shutdown arguments: '{{1,30},y}' 0.148264 frequency calculation coefficients: '{0.000278,0.000000}' 0.148292 load percentage calculation coefficients: '{1.000000,0.000000,1.000000,0.000000}' 0.148321 battery percentage calculation coefficients: '{1.000000,0.000000,0.000000,1.000000,0.000000}' 0.148345 voltage calculation coefficients: '{2.000000,0.000000}' 0.148387 send_to_all: SETINFO device.type "ups" 0.148415 send_to_all: SETINFO driver.version "2.6.0-r2984" 0.148442 send_to_all: SETINFO driver.version.internal "0.13" 0.148469 send_to_all: SETINFO driver.name "powercom" 0.148497 send_to_all: SETINFO ups.mfr "PowerCom" 0.148523 send_to_all: SETINFO ups.model "BNT2000APT" 0.148550 send_to_all: SETINFO ups.serial "2233445566" 0.148576 send_to_all: SETINFO ups.model.type "BNT-other" 0.148603 send_to_all: SETINFO input.voltage.nominal "220" 0.148628 send_to_all: ADDCMD test.battery.start 0.148650 send_to_all: ADDCMD shutdown.return 0.148673 send_to_all: ADDCMD shutdown.stayoff 0.148811 Num of bytes requested for reading from UPS: 16 0.301784 Num of bytes received from UPS: 16 Raw data from UPS: 0 0x0e ( ) 1 0x64 (d) 2 0x70 (p) 3 0x70 (p) 4 0x32 (2) 5 0xff (?) 6 0x32 (2) 7 0x00 ( ) 8 0x00 ( ) 9 0x01 ( ) 10 0x04 ( ) 11 0x4b (K) 12 0x98 () 13 0x00 ( ) 14 0x00 ( ) 15 0x00 ( ) 0.301948 input.frequency (raw data): [raw: 50] 0.301996 send_to_all: SETINFO input.frequency "72.00" 0.302020 input.frequency: 72.00 0.302040 output.frequency (raw data): [raw: 50] 0.302070 send_to_all: SETINFO output.frequency "72.00" 0.302091 output.frequency: 72.00 0.302110 ups.load (raw data): [raw: 14] 0.302140 send_to_all: SETINFO ups.load "14.0" 0.302161 ups.load: 14.0 0.302180 battery.charge (raw data): [raw: 100] 0.302211 send_to_all: SETINFO battery.charge "100.0" 0.302232 battery.charge: 100.0 0.302251 input.voltage (raw data): [raw: 112] 0.302281 send_to_all: SETINFO input.voltage "224.0" 0.302303 input.voltage: 224.0 0.302322 output.voltage (raw data): [raw: 112] 0.302352 send_to_all: SETINFO output.voltage "224.0" 0.302373 output.voltage: 224.0 0.302403 send_to_all: SETINFO ups.status "OB TEST" 0.302425 STATUS: OB TEST 0.302445 send_to_all: DATAOK 0.302723 dstate_init: sock /var/lib/nut/powercom-APC1 open on fd 5 0.302833 send_to_all: SETINFO driver.parameter.pollinterval "2" 0.302872 send_to_all: SETINFO device.mfr "PowerCom" 0.302900 send_to_all: SETINFO device.model "BNT2000APT" 0.302928 send_to_all: SETINFO device.serial "2233445566"> I hope that clears up any problems,It certainly seems to have! If you want me to try anything else give me a shout! I'm sure my customer will be happier that the firewall/front-end mail- server will be shudown on a power outage! They are in a sightly rural industrial area. Power demands is at the supply capability level. But then that's quite common here in South Africa at the moment! We are expecting rolling blackouts again this winter until the new power stations come on line! 2012 and onwards should see things improve! 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-25 13:09 UTC
[Nut-upsuser] Powercom issues in NUT (was: PowerCom BNT2000AT ups on nut 2.6.0 - second try)
2011/5/23 Angela Williams <angierfw at gmail.com>> Hi All > > On Thursday 19 May 2011 at 11:13 Arnaud Quette :- > > > Hi Angela, > > > > as I understand, your issue is now fixed (confirmed?). > > thanks a lot to Keven for addressing this. > > Pretty much so! I have a happy customer! >thanks for the confirmation Angela. 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/20110525/1d9e8c03/attachment.html>