[Solved] USB: Driver not loaded for APC Smart-UPS750

Hello,
i'd like to use my APC SmartUPS with apcupsd.
I'm using an AVM Fritz!Box 7520, running OpenWrt SNAPSHOT r21856-afcf1a4de4 / LuCI Master git-23.013.73089-9634086.
The problem is: When i connect the UPS via USB with the router, the HID driver doesn't seem to recognize the UPS as a HID.

From dmesg:

[38920.906684] usb 1-1: new low-speed USB device number 11 using xhci-hcd
[38921.231991] usbhid 1-1:1.0: can't add hid device: -71
[38921.232136] usbhid: probe of 1-1:1.0 failed with error -71

lsusb:

Bus 002 Device 001: ID 1d6b:0003 Linux 5.15.88 xhci-hcd xHCI Host Controller
Bus 001 Device 011: ID 051d:0002 American Power Conversion Smart-UPS 750 FW:651.12.I USB FW:4.2
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.88 xhci-hcd xHCI Host Controller

lsusb -v:

Bus 001 Device 011: ID 051d:0002 American Power Conversion Smart-UPS 750 FW:651.12.I USB FW:4.2
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x051d 
  idProduct          0x0002 
  bcdDevice            0.06
  iManufacturer           3 American Power Conversion
  iProduct                1 Smart-UPS 750 FW:651.12.I USB FW:4.2
  iSerial                 2 QS0517244435
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration         11 1
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower               30mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength    1064
          Report Descriptor: (length is -1)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0006  1x 6 bytes
        bInterval             100
Device Status:     0x0001
  Self Powered

It might have something to do how hid-generic.ko on OpenWrt works compared to the version running on my PC (openSuse Tumbleweed).

Has anybody an idea or even a solution on how to fix that?

Thanks in advance.

Have you followed this:

and

http://www.apcupsd.org/manual/manual.html

What does
ls -la /dev/usb return.

I did.

I did this also.

Nothing.
There's neither a file nor a directory with usb in it's name.

I just did the same on my PC: The device /dev/usb/hiddev0 will be created after the UPS is plugged in, and it will be deleted when i remove the plug.
Afaik this is done (should be done) by usbhid.

I'm just not sure if i found a bug (hooray) or just missing something important.

All necessary modules should've been loaded:

lsmod | grep hid
hid                   102400  2 usbhid,hid_generic
hid_generic            16384  0 
input_core             45056  2 hid,evdev
usbhid                 32768  0 

lsmod | grep usb
hid                   102400  2 usbhid,hid_generic
usbhid                 32768  0

After futzing around with the HID stuff, I ended up setting mine as a plain USB device on the router (OpenWrt 22.03.2), here's the config that I've got working. It's an APC BackUPS Pro 1500, but I'm pretty sure the SmartUPS behaves the same. From my workstations, I run apcaccess status 10.1.1.1 and get the raw status report from it.

$ egrep -v '^(#|$)' /etc/apcupsd/apcupsd.conf
UPSNAME APC-1500-2
UPSCABLE usb
UPSTYPE usb
LOCKFILE /var/lock
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc
NOLOGINDIR /etc
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 10.1.1.1
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0

Comfirm your USB signal cable as to type. If it came with the UPS or you bought if from APC, the part number will be stamped on the cable sheathing. Verify the cable type (voltage-signalling, or Smart RS232), but I suspect if it’s a recent Smart model, you will need the kmod-usb-serial, and/or kmod-usb-serial-pl2303.

See - https://openwrt.org/docs/guide-user/services/ups/apcupsd_su700#apc_smartups_su-700_-_linksys_ea3500_-_luci_graphs

Check if the USB driver is installed/working with

ls -la /dev/ttyUSB* and apcstatus

FWIW, I run an APC BackUPS 550 ES on my production 1900ACS using a self made RJ45/10/8 to USB, with email Alerts since almost day one without a hitch. I have not even had to think about anything day to day.

Reminder from the Wiki

  • If you don't see a serial port then something is wrong with the driver for the serial-to-usb converter.
  • Resolve this, before proceeding.

Thank you for your help,
but i guess maybe you didn't quite understood the core of the problem. Perhaps my description of it wasn't good enough.
The UPS and the router are connected via a pure USB-A-B cable.
There's no serial-usb-converter involved.

So, because of the lack of a converter there will be no /dev/ttyUSB* created.

The UPS is recognized, as you can see via lsusb:

2 American Power Conversion Smart-UPS 750 FW:651.12.I USB FW:4.2

but in dmesg you'll see loads of messages like

usbhid: probe of 1-1:1.0 failed with error -71
[67366.187172] usbhid 1-1:1.0: can't add hid device: -71

as long as the UPS is connected.
My assumption is, the USB-HID driver doesn't know what to do with it.

Because on my Linux-PC it will be recognized as

usb 1-1.1: new low-speed USB device number 4 using ehci-platform
hid-generic 0003:051D:0002.0002: hiddev96,hidraw0: USB HID v1.10 Device [American Power Conversion Smart-UPS 750 FW:651.12.I USB FW:4.2] on usb-1b000000.usb-1.1/input0

A few years ago, i already had it running on another router with apcupsd.
But now:
I just dusted off my old TL-WDR4300, which i had upgraded to 22.03.0 some time ago and added just the kmod-usb-hid package which wasn't installed.
After i connected the UPS to the router, it was correctly recognized just like on the Linux-PC. After i put apcupsd on the router and set up the configuration, apctest could connect to the UPS.

OK, that's a different router and an older version of OpenWrt.
But it's working.
So, one or some of the changes between kernel 5.10.138 and 5.15.88 (or maybe it's just this exact version) must have broke something regarding USB-HID.
Maybe i'll wait a few days (weeks) and give it a new try with a then actual Master-Snapshot.

Anyway, thank you for your contribution to my problem.

I was hoping, the problem solves itself with a newer kernel.
Unfortunately, it didn't.
I just flashed both my FB7520 and TL-WDR4300 with the current snapshot with kernel 15.90.
While the UPS is correctly recognized as a HID on the TP-Link, it still fails on the Fritzbox.

Sigh...i don't know what's wrong with it...

I guess i have to look for my Serial-to-USB-converter and solder myself an adaptor from standard RS-232 to APC Smart Cable.
I never tried the serial port on the UPS, i do hope it's not broken.

Not the solution i was hoping for...

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.