apcupsd on Linux does not see APC BackUPS Pro 900 on USB

2

2

From what documentation I could find, the UPS is supported on Linux and is reported to be working with apcupsd.

I looked for specific problems such as the infamous Microlink protocol, and found none.

I have found a feedback from a guy in UK that reports using this very model on a not-too-different OS version (his OpenSuSE 12.1, mine 12.3 x86_64).

The USB port is detected, lsusb reports it as being used by an APC:

Bus 002 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply

and lsusb -v -s002:003 confirms and expands:

Bus 002 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x051d American Power Conversion
  idProduct          0x0002 Uninterruptible Power Supply
  bcdDevice            0.90
  iManufacturer           1 American Power Conversion
  iProduct                2 Back-UPS RS 900G FW:879.L4 .I USB FW:L4
  bNumConfigurations      1
  Configuration Descriptor:
    [...]
    Interface Descriptor:
      [...]
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength    1134
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval             100
Device Status:     0x0000
  (Bus Powered)

The kernel recognizes this, and duly sets up a Human Interface Device

crw------- 1 root root 180, 96 Nov  4 16:11 /dev/usb/hiddev0

So, as far as I know, everything is as it should be.

I have put the standard configuration in /etc/apcupsd/apcupsd.conf (which is Unix-terminated, ASCII-only, no BOM (just in case))

UPSCABLE usb
UPSTYPE  usb
DEVICE

(I have also tried commenting out DEVICE, and setting a device of /dev/puppa results in an access attempt to /dev/puppa, not some /var/lib/dev/puppa or /dev/puppa\r\n).

Yet, what apcaccess tells me is "no UPS here, sorry":

VERSION  : 3.14.10 (13 September 2011) suse
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2013-11-04 16:24:22 +0100
MODEL    :
STATUS   : NOBATT
LINEV    : 000.0 Volts
LOADPCT  :   0.0 Percent Load Capacity
BCHARGE  : 000.0 Percent
TIMELEFT :   0.0 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
SENSE    : Low
LOTRANS  : 000.0 Volts
HITRANS  : 000.0 Volts

It doesn't recognize the model, and reports no battery (and no voltage). This confirms that it's not the Microlink problem, or it would report the battery status, if precious little else.

If I disconnect the USB cable, I get an apcupsd message to the effect that communications have been lost; and I get the "communication restored" broadcast too, if I reconnect the cable. So apcupsd is monitoring.

So everything tells me that it should work -- only it doesn't. Apparently, the UPS won't talk to apcupsd. Does anyone spot what I'm missing?

LSerni

Posted 2013-11-04T15:37:49.290

Reputation: 7 306

Answers

2

I found a similar case (re: a different model of UPS, but still USB) that had been solved by the voodoo method of changing the USB port. So I tried. It worked.

The output from lsusb for the two ports (the one that works, and the one that doesn't) is identical except for this one detail:

Device Status:     0x0000           <-- old port
  (Bus Powered)

Device Status:     0x0002           <-- new port
  (Bus Powered)
  Remote Wakeup Enabled

I don't know whether this means that the first port lacked 'Remote Wakeup', which for some reasons was required by apcupsd (maybe to support wakeup-on-power-back?), or this port is recognized for some totally different reason, and due to its recognition, a Remote Wakeup gets enabled that previously wasn't.

However, if I put the UPC back to the old port it stops working again, while on the new port I get apcaccess reporting, as expected,

MODEL    : Back-UPS RS 900G
STATUS   : ONLINE
LINEV    : 231.0 Volts
LOADPCT  :  10.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT : 118.4 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 176.0 Volts
HITRANS  : 294.0 Volts
ALARMDEL : 30 seconds
BATTV    : 27.3 Volts

LSerni

Posted 2013-11-04T15:37:49.290

Reputation: 7 306

Just for completeness, the first USB port appears to be working okay with both a Webcam, a keyboard, a mouse and a WD external disk. Weird. – LSerni – 2013-11-06T17:22:09.207

1

In my case, I had to set the following variables in apcupsd.conf to get USB to work:

UPSCABLE smart
UPSTYPE usb
DEVICE

Glad that you got it working, but I'm hoping those 3 variables help someone else in the future. (I'm using CyberPower CP1000AVRLCDa)

RustyCar

Posted 2013-11-04T15:37:49.290

Reputation: 21