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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-28-2022, 11:34 PM
|
#1
|
Member
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66
Rep:
|
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?
|
|
|
08-29-2022, 09:14 AM
|
#2
|
Senior Member
Registered: Aug 2016
Posts: 3,345
|
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.
|
|
|
08-30-2022, 06:37 PM
|
#3
|
Member
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66
Original Poster
Rep:
|
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.
|
|
|
08-30-2022, 09:14 PM
|
#5
|
Moderator
Registered: Mar 2008
Posts: 22,279
|
Guess trying a new usb cable won't hurt, may not help either.
|
|
|
09-01-2022, 11:07 PM
|
#6
|
Member
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66
Original Poster
Rep:
|
Quote:
Originally Posted by jefro
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).
|
|
|
09-01-2022, 11:12 PM
|
#7
|
Member
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66
Original Poster
Rep:
|
Quote:
Originally Posted by michaelk
|
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?
|
|
|
09-10-2022, 05:52 PM
|
#8
|
Member
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66
Original Poster
Rep:
|
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?
|
|
|
09-11-2022, 01:56 AM
|
#9
|
Senior Member
Registered: Jul 2020
Posts: 1,383
|
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?
|
|
|
09-11-2022, 09:30 AM
|
#10
|
Member
Registered: Oct 2006
Location: Chicago, IL
Distribution: Almalinux
Posts: 66
Original Poster
Rep:
|
Quote:
Originally Posted by lvm_
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.
|
|
|
All times are GMT -5. The time now is 04:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|