Vitālijs Hodiko
2018-Jan-07 18:37 UTC
[Nut-upsdev] No answer from upsrw <ups name> command
<html><div id="eml-cke__body" title="">Hello,<br /> I want to create custom UPS monitoring client using js. I connected directly to driver socket and can successfully receive data and instantiate commands. Now i try to SET variables, but i receive some errors. So I found that running "upsrw <ups name>" will give me a list of supported variables that i can set. I started UPS driver with debug flags:<br />> ./blazer_usb -DDDD -a ups<br />and have run 'upsrw ups' with and without admin credentials and driver debugged nothing, no data in response either.<br /> I sent directly SET command like this ""SET var 'value'\n"" to socket and driver debugged:<br /> > new connection on fd 6<br />> 1195.606235 Got SET, but driver lacks a handler<br /> >From this o\p i can assume that blazer_usb doesnt support SET command, is it true?<br /><br /> My UPS supports multiple test commands, but i can run only one of them.<br /> Failed test 1:<br />> 1758.386031 instcmd(test.battery.start.deep, 3)<br /> > 1758.388547 send: TL<br /> > 1758.785995 read: TL<br /> > 1758.786044 instcmd: command [test.battery.start.deep] failed<br /><br /> Failed test 2:<br />> 2150.275428 instcmd(test.battery.start, [NULL])<br /> > 2150.277636 send: T10<br /> > 2150.688833 read: T10<br /> > 2150.688880 instcmd: command [test.battery.start] failed<br /><br /> Only quick test is working:<br />> 2232.746956 instcmd(test.battery.start.quick, [NULL])<br /> > 2232.749549 send: T<br /> > 2233.136727 read: <br /> > 2233.136780 instcmd: command [test.battery.start.quick] handled<br /><br /> Any help will be appreciated. <br /> <br /> Driver info from Dump.<br />> SETINFO device.type "ups"<br /> > SETINFO driver.name "blazer_usb"<br /> > SETINFO driver.version "2.7.2"<br /> > SETINFO driver.version.internal "0.11"</div><div id="eml-cke__signature_top" title="Подпись"> <div class="eml-cke__signature" id="eml-cke__signature_top-wrap" title="">--<br /> Best wishes,<br /> Vitaly Hodiko<br /> </div> </div> <div id="eml-cke__signature_bottom" title="Подпись"> </div> </html>
On Jan 7, 2018, at 1:37 PM, Vit?lijs Hodiko <hodiko.v at inbox.lv> wrote:> > Hello, > I want to create custom UPS monitoring client using js. I connected directly to driver socket and can successfully receive data and instantiate commands. Now i try to SET variables, but i receive some errors. So I found that running "upsrw <ups name>" will give me a list of supported variables that i can set. I started UPS driver with debug flags: > > ./blazer_usb -DDDD -a ups > and have run 'upsrw ups' with and without admin credentials and driver debugged nothing, no data in response either. > I sent directly SET command like this ""SET var 'value'\n"" to socket and driver debugged: > > new connection on fd 6 > > 1195.606235 Got SET, but driver lacks a handler > From this o\p i can assume that blazer_usb doesnt support SET command, is it true?Apparently, yes. It seems to only register an instant command handler here: https://github.com/networkupstools/nut/blob/v2.7.2/drivers/blazer.c#L756 Note that blazer_usb (and blazer_ser) have not been maintained for a while. Please try nutdrv_qx, and let us know if it is not backwards-compatible (it should be a superset of the blazer driver). Also, while this still might not do anything for your UPS, nutdrv_qx does have a setvar handler: https://github.com/networkupstools/nut/blob/v2.7.2/drivers/nutdrv_qx.c#L1423-L1424> > My UPS supports multiple test commands, but i can run only one of them. > Failed test 1: > > 1758.386031 instcmd(test.battery.start.deep, 3) > > 1758.388547 send: TL > > 1758.785995 read: TL > > 1758.786044 instcmd: command [test.battery.start.deep] failed > > Failed test 2: > > 2150.275428 instcmd(test.battery.start, [NULL]) > > 2150.277636 send: T10 > > 2150.688833 read: T10 > > 2150.688880 instcmd: command [test.battery.start] failed > > Only quick test is working: > > 2232.746956 instcmd(test.battery.start.quick, [NULL]) > > 2232.749549 send: T > > 2233.136727 read: > > 2233.136780 instcmd: command [test.battery.start.quick] handledNot all UPSes support the standard commands, especially with a de facto standard like the Qx protocol. For testing the read/write variable support, you can also use the dummy-ups driver in dummy (simulation) mode: http://networkupstools.org/docs/man/dummy-ups.html -- Charles Lepple clepple at gmail
copying the list for reference.> On Feb 4, 2018, at 10:57 AM, Vit?lijs Hodiko <hodiko.v at inbox.lv> wrote: > > Thank you very much for a quick response. I tested nutdrv_qx driver and it's working just fine. > > SETINFO battery.voltage "13.50" > SETINFO device.type "ups" > SETINFO driver.name "nutdrv_qx" > SETINFO driver.parameter.pollfreq "30" > SETINFO driver.parameter.pollinterval "2" > SETINFO driver.parameter.port "auto" > SETINFO driver.version "2.7.2" > SETINFO driver.version.data "Q1 0.02" > SETINFO driver.version.internal "0.06" > SETINFO input.frequency "49.9" > SETINFO input.voltage "224.1" > SETINFO input.voltage.fault "223.6" > SETINFO output.voltage "223.6" > SETINFO ups.beeper.status "enabled" > SETINFO ups.delay.shutdown "30" > + ADDRANGE ups.delay.shutdown 12 600 > + SETFLAGS ups.delay.shutdown RW > SETINFO ups.delay.start "180" > + ADDRANGE ups.delay.start 0 599940 > + SETFLAGS ups.delay.start RW > SETINFO ups.load "3" > SETINFO ups.productid "0003" > SETINFO ups.status "OL" > SETINFO ups.temperature "25.0" > SETINFO ups.type "offline / line interactive" > SETINFO ups.vendorid "06da" > ADDCMD beeper.toggle > ADDCMD load.off > ADDCMD load.on > ADDCMD shutdown.return > ADDCMD shutdown.stayoff > ADDCMD shutdown.stop > ADDCMD test.battery.start > ADDCMD test.battery.start.deep > ADDCMD test.battery.start.quick > ADDCMD test.battery.stop > DATAOK > DUMPDONE > > It even reports some RW variables, but as i understand from driver debug message they are built in into driver: > > 2536.209109 setvar(ups.delay.start, 100) > > 2536.209134 setvar: setting server side variable ups.delay.start > > 2536.209149 setvar: SUCCEED > > 2536.859612 upsdrv_updateinfo... > > 2536.859626 Full update... > > Best wishes, > Vitaly >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20180204/e8aad8e3/attachment.html>