UPS NUT failed with APC Usb

ups
v7

(!) #1

NethServer Version: 7.5.1804 (final)
Module: nethserver-nut

Hello,

I try to connect a APC Power-Saving Back-UPS Pro 900VA Line-Interactive USV on my nethserver via usb.
I tried usbhid-ups as driver and USB(auto) but i have a failed message.

How to debug that and make it work ? I didn’t find a way where to look to find info on what append.

Thanks.
Rémy.


(Marc) #2

Is the USB detected?

lsusb |grep -i UPS

Any clues from /var/log/messages?


(!) #3

Thanks Marc.

xxx@neth:~$ lsusb
Bus 001 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply

and it give :
Aug 24 10:51:21 neth upsmon: UPS [UPS@127.0.0.1]: connect failed: Connection failure: Connection refused
on any USB peripheral (Auto, ttyUSB0, ttyUSB1).

I also got
Aug 24 10:50:51 neth systemd: Starting Network UPS Tools - power device monitor and shutdown controller…
Aug 24 10:50:51 neth systemd-tmpfiles: Failed to open ‘/etc/tmpfiles.d/nut-run.conf’, ignoring: No such file or directory
Aug 24 10:50:51 neth systemd: Started Network UPS Tools - power device monitor and shutdown controller.
Aug 24 10:50:51 neth esmith::event[602]: [INFO] nut-monitor has been started
Aug 24 10:50:51 neth upsmon: fopen /var/run/nut/upsmon.pid: No such file or directory
Aug 24 10:50:51 neth upsmon: Using power down flag file /etc/killpower
Aug 24 10:50:51 neth upsmon: UPS: UPS@127.0.0.1 (master) (power value 1)
Aug 24 10:50:51 neth upsmon: UPS [UPS@127.0.0.1]: connect failed: Connection failure: Connection refused

:frowning:
???
Rémy


(Ralf Jeckel) #4

I had a simmilar issue some times ago.
With a new cable it was gone.
Can you try to mount a new usb-cable.
Maybe it helps. :slight_smile:


(!) #5

Thanks Ralf.
It’s a rj11/usb cable. I haven’t any spare, must find one first.
Rémy.


(Ralf Jeckel) #6

In my case it was a simple usb A/B cable. Not shure if the RJ11/USB is HID-compatible. Do you know?

I had a look at https://networkupstools.org/stable-hcl.html.

I saw the Back-UPS Pro USB, but did you also try the apcsmart-driver (Back-UPS Pro)?

(That’s why I like Eaton: Vendor provided protocol and hardware. :wink: )


(Marc) #7

Can you try if it works after restarting the server, or connecting the cable to another USB port and running:

signal-event nethserver-nut-save

Some more info:

config show nut-server     # you can leave out the password
tail -4 /etc/ups/ups.conf  # shall match your selection on GUI (port could be auto)

# status of nut services
systemctl -l status nut-{driver,server,monitor}

Some tests:

# allows to try to start the driver for the configured UPS (could report errors)
upsdrvctl -DD start

# poll status of UPS
upsc `upsc -l|head -1`

Another test (EDIT: beware it can be left running in background and consuming many CPU resources, unless killed):

usbhid-ups -DD -a `upsc -l|head -1` -x vendorid=051d -x productid=0002

usbhid-ups manual says:

maxreport
With this option, the driver activates a tweak to workaround buggy firmware returning invalid HID report length. Some APC Back-UPS units are known to have this bug.

So it’s not for all cases but a few, but just in case you could try the same command appending -x maxreport

Also note that nut 2.7.4 fixed some missing USB strings in APC.

To get more details about the USB device:

lsusb -v -s 1:2   # Bus 001 Device 002
usb-devices |grep -A6 -B6 -i ups

(!) #8

Hi dnutan,

I’m not able to work on this server for now, i’ll try your commands as soon as i can. I’m stay hold on.
Thanks,
Rémy.