0

I bought myself a old APC Back-UPS CS650 uninterruptible power supply, and replaced the accumulator in it with a large lead-acid one, it coincides in voltage with the stock accumulator. I connected the uninterruptible power supply via USB to the PC, and when I pull the power cable out of the socket, the PC will almost instantly turn off, and then the uninterruptible power supply turns off. If I stop the apcupsd daemon, this does not happen, and the uninterruptible power supply works until the accumulator sits down. To see the reason for the shutdown in logs, I commented out the commands for poweroff in the apccontrol file. Here is what is output in journalct-u apcupsd

Power failure on UPS invilso-systemproductname. Running on batteries. 
Remaining battery runtime below limit on UPS invilso-systemproductname. Doing shutdown. 
UPS invilso-systemproductname initiated Shutdown Sequence
Continuing with shutdown.

Here is the apcupsd config:

UPSCABLE usb

UPSTYPE usb
DEVICE /dev/usb/hid/hiddev[0-9]
LOCKFILE /run/apcupsd
SCRIPTDIR /etc/apcupsd


PWRFAILDIR /etc/apcupsd

NOLOGINDIR /etc



ONBATTERYDELAY 0


BATTERYLEVEL 0

MINUTES 9999

TIMEOUT 60

ANNOY 300


ANNOYDELAY 60


NOLOGON disable


KILLDELAY 0


NETSERVER on


NISIP 0.0.0.0


NISPORT 3551


EVENTSFILE /var/log/apcupsd.events


EVENTSFILEMAX 10


UPSCLASS standalone


UPSMODE disable


STATTIME 0

STATFILE /var/log/apcupsd.status


LOGSTATS off


DATATIME 0


#FACILITY DAEMON


#UPSNAME UPS_IDEN

# BATTDATE 09/29/23


#SENSITIVITY H


#WAKEUP 60


#SLEEP 180


#LOTRANSFER  208


#HITRANSFER 253


#RETURNCHARGE 15


#BEEPSTATE T


#LOWBATT 2


#OUTPUTVOLTS 230


#SELFTEST 336

It would be nice if you could completely disable the apcupsd automation, and leave only apcsuccess status to be able to control your script based on voltage, here is the actual output of apcsuccess status:

APC      : 001,045,1081
DATE     : 2023-10-04 14:52:53 +0300  
HOSTNAME : invilso-systemproductname
VERSION  : 3.14.14 (31 May 2016) unknown
UPSNAME  : invilso-systemproductname
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2023-10-04 14:52:44 +0300  
MODEL    : Back-UPS CS 650 
STATUS   : ONLINE 
LINEV    : 230.0 Volts
LOADPCT  : 34.0 Percent
BCHARGE  : 15.0 Percent
TIMELEFT : 2.9 Minutes
MBATTCHG : 0 Percent
MINTIMEL : 9999 Minutes
MAXTIME  : 99999 Seconds
OUTPUTV  : 230.0 Volts
SENSE    : Medium
DWAKE    : 0 Seconds
DSHUTD   : 0 Seconds
LOTRANS  : 160.0 Volts
HITRANS  : 278.0 Volts
RETPCT   : 0.0 Percent
ITEMP    : 29.2 C
ALARMDEL : 30 Seconds
BATTV    : 13.4 Volts
LINEFREQ : 50.0 Hz
LASTXFER : Low line voltage
NUMXFERS : 0
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STESTI   : None
STATFLAG : 0x05000008
MANDATE  : 2004-06-09
SERIALNO : QB0424134379  
BATTDATE : 2023-09-29
NOMOUTV  : 230 Volts
NOMINV   : 230 Volts
NOMBATTV : 12.0 Volts
NOMPOWER : 400 Watts
FIRMWARE : 817.v2.I USB FW:v2
END APC  : 2023-10-04 14:52:55 +0300

I will be very grateful if you can help me.

P.S. I extended the cables to the accumulator, but I extended them with a cable of 16mm2 and a length of 50 cm, there should not be a strong voltage drop even at full load.

6
  • when I pull the power cable out of the socket, the PC will almost instantly turn off, and then the uninterruptible power supply turns off .......... It most likely does not know about the replacement battery. Try a stock replacement battery, OR, if you need more uptime, perhaps a bigger UPS.
    – anon
    Commented Oct 4, 2023 at 13:07
  • @John I updated the battery change date and also did a battery calibration via apctest, at 50% load the calibration lasted about 1.5 hours which is great for my battery. I don't think after that ups didn't realize the battery had been replaced.
    – invilso
    Commented Oct 4, 2023 at 13:13
  • I am not sure what else. Perhaps a hardware or firmware issue with the older UPS? I have an APC 750XL UPS and have replaced the batteries with stock APC batteries and no issue
    – anon
    Commented Oct 4, 2023 at 13:23
  • @John I don't know. I'll try reinstalling apcupsd and resetting all configurations, and see if that helps solve my problem. If not, I will try to remove all commands from the sh files and control the PC with a Python script. In any case thank you for your time.
    – invilso
    Commented Oct 4, 2023 at 13:33
  • It might be simplest to leave the UPS USB cable unplugged unless you want to check battery status, if the software does not shut down the PC on unplugging cable. Commented Oct 4, 2023 at 16:09

1 Answer 1

0

To fix the fast shutdown of the PC and UPS, I had to set all configurations to default values, and then the PC worked for about 15 minutes. After searching the net for a few hours, I found this article, which explained how to make apcupsd unable to control PC power. It was necessary to comment out in the apccontrol file the paths to the PC shutdown and the wall command. But the problem was that the status remained: SHUTTING DOWN To remove it when power is restored from the mains, I managed to use this code in Python:

result = await aioapcaccess.request_status(host='localhost', port=3551)
if float(aioapcaccess.split_unit(result["LINEV"])[0]) > 170 and result['STATUS'] == 'SHUTTING DOWN':
    subprocess.run('sudo systemctl restart apcupsd.service', shell=True, check=True)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .