[Nut-upsdev] No answer from upsrw <ups name> command
Charles Lepple
clepple at gmail.com
Mon Jan 8 03:56:52 UTC 2018
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] handled
Not 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
More information about the Nut-upsdev
mailing list