LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-28-2022, 11:34 PM   #1
81bones
Member
 
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66

Rep: Reputation: 15
Unable to get APC UPS to connect via USB cable


I have an APC Back-UPS XS 1300 that I've been using for years with my old CentOS 7 server (connected via an APC UPS cable and using the apcupsd monitoring software). I recently built a new server and am now running AlmaLinux 9 (Linux 5.14.0-70.22.1.el9_0.x86_64). I was able to transfer everything over to my new server successfully...except the UPS.

The system can see the UPS when running lsusb (listed below as bus 001 device 004):

Code:
[user@locahost]/etc/ups% lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 011: ID 0c45:7692 Microdia USB Keyboard
Bus 001 Device 010: ID 046d:c53a Logitech, Inc. PowerPlay Wireless Charging System
Bus 001 Device 009: ID 0bda:5411 Realtek Semiconductor Corp. RTS5411 Hub
Bus 001 Device 008: ID 1a40:0801 Terminus Technology Inc. USB 2.0 Hub
Bus 001 Device 006: ID 1a40:0801 Terminus Technology Inc. USB 2.0 Hub
Bus 001 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I attempted to use the apcupsd configuration that worked on my old system, but apcupsd is apparently unable to see the UPS. Immediately upon starting the apcupsd service, I get a "Battery Disconnected" error. Similarly the /var/log/apcupsd.status file that should contain information about the UPS is full of generic non-information instead of the expected details.

Code:
[user@localhost]/var/log% sudo systemctl status apcupsd.service
● apcupsd.service - APC UPS Power Control Daemon for Linux
     Loaded: loaded (/usr/lib/systemd/system/apcupsd.service; disabled; vendor preset: disabled)
     Active: active (running) since Sun 2022-08-28 21:59:59 CDT; 11s ago
    Process: 6801 ExecStartPre=/bin/rm -f /etc/apcupsd/powerfail (code=exited, status=0/SUCCESS)
   Main PID: 6802 (apcupsd)
      Tasks: 3 (limit: 98223)
     Memory: 836.0K
        CPU: 11ms
     CGroup: /system.slice/apcupsd.service
             └─6802 /sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf

Aug 28 21:59:59 localhost systemd[1]: Starting APC UPS Power Control Daemon for Linux...
Aug 28 21:59:59 localhost systemd[1]: Started APC UPS Power Control Daemon for Linux.
Aug 28 21:59:59 localhost apcupsd[6802]: apcupsd 3.14.14 (31 May 2016) redhat startup succeeded
Aug 28 21:59:59 localhost apcupsd[6802]: NIS server startup succeeded
Aug 28 22:00:01 localhost apcupsd[6802]: Battery disconnected.
A few interesting things are happening here. First, while the apcupsd service above is running, the syslog is absolutely flooded with messages like the ones below:

Code:
Aug 28 22:00:04 localhost kernel: hid-generic 0003:051D:0002.0001: usb_submit_urb(ctrl) failed: -53
Aug 28 22:00:04 localhost kernel: hid-generic 0003:051D:0002.0001: control queue full
Second, if I unplug the USB cable from the UPS unit and then plug it back in, apcupsd will send a message stating "Communications with UPS restored." However, this is not actually the case, as apcupsd still appears to be unable to poll the UPS and provide information about it. The syslog flooding will stop when I unplug the cable, and will start right back up upon reconnection.

I attempted to use NUT (nut-2.7.4-44.el9.x86_64) instead of apcupsd, but I've had intermittent success. The usbhid-ups driver often does not appear to be able to see the UPS either, although I was randomly able to get it running once.

So I'm not able to tell if this is an apcupsd problem, or a weird hardware compatibility problem. I did find this bug report that seems to indicate the syslog flooding was introduced in kernel 5.14, but was maybe resolved? I'm not sure if this would fix the communication problem overall? Has anyone else encountered this issue?
 
Old 08-29-2022, 09:14 AM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
You said you have been using it for years.

Is the battery the original? If so then it is likely that the battery has reached EOL and may need replaced. That could be the cause of the errors since the UPS is not able to be self-powered. The "Battery Disconnected" error would seem to indicate this.

Your title is incorrect. The messages clearly show the device is connecting and communicating by the USB cable, just not getting the results you expect.

Last edited by computersavvy; 08-29-2022 at 09:15 AM.
 
Old 08-30-2022, 06:37 PM   #3
81bones
Member
 
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66

Original Poster
Rep: Reputation: 15
Although I have been using it for years, I do in fact replace the battery as needed! It's been replaced a few times thus far, and the current battery is relatively new. I will also note that as recently as last week apcupsd was able to interact with the UPS and report accurate information in the /var/log/apcupsd.status. The only thing that has changed is that I have moved the UPS from a CentOS 7 system to an AlmaLinux 9 system. Even the version of apcupsd is the same (3.14.14).

While it's definitely odd that apcupsd will report "Battery Disconnected" and "UPS Communication Restored" when unplugging and reconnecting the USB cable, I'm still not sure there's any real communication happening. Of note, here's what the /var/log/apcupsd.status looks like:

Code:
APC      : 001,034,0763
DATE     : 2022-08-28 22:06:06 -0500
HOSTNAME : xenon
VERSION  : 3.14.14 (31 May 2016) redhat
UPSNAME  : xenon
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2022-08-28 22:06:04 -0500
MODEL    :
STATUS   : NOBATT
LINEV    : 0.0 Volts
LOADPCT  : 0.0 Percent
BCHARGE  : 0.0 Percent
TIMELEFT : 0.0 Minutes
MBATTCHG : 30 Percent
MINTIMEL : 5 Minutes
MAXTIME  : 0 Seconds
SENSE    : Low
LOTRANS  : 0.0 Volts
HITRANS  : 0.0 Volts
ALARMDEL : 30 Seconds
BATTV    : 0.0 Volts
LASTXFER : No transfers since turnon
NUMXFERS : 0
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : ??
STATFLAG : 0x01000000
SERIALNO :
BATTDATE : 1980-00-00
NOMINV   : 0 Volts
NOMBATTV : 0.0 Volts
END APC  : 2022-08-28 22:06:06 -0500
On my previous system (again, last week) this file was populated with real info in all fields.
 
Old 08-30-2022, 08:12 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,521

Rep: Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224
Looks like APC devices have a problem and that it was fixed in the 5.14.2 kernel? Only a brief search so I don't know when or what kernel version the problem first showed its ugly head. My APC UPS is still connected to a CentOS 7 system...

https://linux-kernel.vger.kernel.nar...ontrol-request
https://www.linuxquestions.org/quest...sd-4175700175/
 
Old 08-30-2022, 09:14 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,279

Rep: Reputation: 3658Reputation: 3658Reputation: 3658Reputation: 3658Reputation: 3658Reputation: 3658Reputation: 3658Reputation: 3658Reputation: 3658Reputation: 3658Reputation: 3658
Guess trying a new usb cable won't hurt, may not help either.
 
Old 09-01-2022, 11:07 PM   #6
81bones
Member
 
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jefro View Post
Guess trying a new usb cable won't hurt, may not help either.
I'll see if I can dig up an extra one of those weird APC UPS cables and give it a try (certainly won't hurt).
 
Old 09-01-2022, 11:12 PM   #7
81bones
Member
 
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by michaelk View Post
Looks like APC devices have a problem and that it was fixed in the 5.14.2 kernel? Only a brief search so I don't know when or what kernel version the problem first showed its ugly head. My APC UPS is still connected to a CentOS 7 system...

https://linux-kernel.vger.kernel.nar...ontrol-request
https://www.linuxquestions.org/quest...sd-4175700175/
I found some similar things in my searches as well. This bug seems to pop up every once in a while. It gets squashed, but after a few years seems to get reintroduced again.

Rookie question: the kernel on my install of AlmaLinux 9 is 5.14.0-70.22.1.el9_0.x86_64. If we assume that this issue is indeed fixed in kernel 5.14.2, what are the chances that this fix would make it into AlmaLinux 9 (or RockyLinux 9 or CentOS 9 Stream, etc)? I assume the RHEL folks would have to decide to backport this change into their kernel, since they do not actually upgrade kernels within a particular release?
 
Old 09-10-2022, 05:52 PM   #8
81bones
Member
 
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66

Original Poster
Rep: Reputation: 15
Minor update: after some additional tinkering, it looks like NUT (nut-2.7.4-44.el9.x86_64) is now able to see the UPS and interact with it. I'm not even sure what I did to make it work, and NUT doesn't have the same level of control over the UPS as apcupsd does, but it is able to report the battery life, load, and input voltage of the UPS. I haven't restarted the server yet, so it's possibly this may all magically go away again, but for now it would appear that it's at least possible to get it working.

So it seems like the actual issue here may be with apcupsd and the EL9 kernel. I guess I need to report it via Bugzilla and just hope that someone addresses it in an upcoming update?
 
Old 09-11-2022, 01:56 AM   #9
lvm_
Senior Member
 
Registered: Jul 2020
Posts: 1,383

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Once upon a time I had an issue with apcupsd reporting 'battery disconnected' after startup and refusing to communicate with UPS, which I was able to resolve simply by reseating the USB cable. Since in your original post you said they you tried unplugging the cable, I thought it couldn't be it, and yet could it?
 
Old 09-11-2022, 09:30 AM   #10
81bones
Member
 
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by lvm_ View Post
Once upon a time I had an issue with apcupsd reporting 'battery disconnected' after startup and refusing to communicate with UPS, which I was able to resolve simply by reseating the USB cable. Since in your original post you said they you tried unplugging the cable, I thought it couldn't be it, and yet could it?
It’s a good thought, and it occurred to me as well when troubleshooting. Unfortunately I have tried reseating it a few times, as well as trying different USB ports on the computer. No luck.

The only thing I haven’t tried yet is a new cable (still looking to see if I have another one somewhere). But since NUT seems to be able to communicate with the UPS via the current cable, I am less optimistic that a new cable will fix the apcupsd issues.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
APC UPS w/ USB signal cable - work in Linux? sirpimpsalot Linux - Hardware 5 06-21-2010 09:24 AM
APC UPS backup-ups ES RJ-45 augurseer Linux - Hardware 3 11-19-2009 12:32 AM
What is the difference between a 940-0024C and 940-0024D APC UPS cable? philip.gates LinuxQuestions.org Member Intro 0 09-03-2009 09:02 AM
APC UPS BX1000: USB connection in Fedora RottenMutt Linux - Hardware 8 05-06-2005 01:44 PM
USB Support for APC Battery back up UPS gway600 Linux - Hardware 2 08-06-2004 09:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration