4

I think this is a usb issue.

I have a APC UPS, model "Back-UPS 700". It has a usb port and two phone ports, no network port. It has 4 sockets to deliver power and 1 to receive mains. It seems to follow the chart in the manual notes for flashing lights and bleeps when powering up and supplying power. The manual has three or four separate entries reflecting an expectation that it will talk over usb to a pc.

I am using 'old kit' here: a socket 939 motherboard and an opteron 185 (fastest thing that will go in this mobo - released in March 2006).

Ubuntu 20.02.

I have followed a few different tutorials, but I am getting no usb signal to or from the ups. After configuring, I pulled the power on it and waited. After 15 mins it went to rapid beeping the dropped power to the server. ZFS scrub indicated no data damage. I have tried different usb sockets and different cables, mouse and keyboard work in all the sockets.

If I run lsusb then I get:

Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 046d:c046 Logitech, Inc. RX1000 Laser Mouse
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
chris@PMS1:~$ 

It's not there.

Settings in the apcupsd.conf,

UPSCABLE usb
UPSTYPE usb
DEVICE

and apcaccess status only reveals:

chris@PMS1:~$ apcaccess status
APC      : 001,018,0438
DATE     : 2021-03-26 22:23:43 +0000  
HOSTNAME : PMS1
VERSION  : 3.14.14 (31 May 2016) debian
UPSNAME  : APC700
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2021-03-26 22:23:32 +0000  
STATUS   : COMMLOST 
MBATTCHG : 5 Percent
MINTIMEL : 6 Minutes
MAXTIME  : 1 Seconds
NUMXFERS : 0
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
STATFLAG : 0x05000100
END APC  : 2021-03-26 22:23:43 +0000  
chris@PMS1:~$ 

Where other tutorials indicate it should reveal a lot more.

If I stop the apcupsd, then run the acptest command I get :

chris@PMS1:~$ apctest
2021-03-26 22:26:01 apctest 3.14.14 (31 May 2016) debian
Checking configuration ...
sharenet.type = Network & ShareUPS Disabled
cable.type = USB Cable
mode.type = USB UPS Driver
Setting up the port ...
apctest FATAL ERROR in apctest.c at line 319
Unable to open UPS device.
  If apcupsd or apctest is already running,
  please stop it and run this program again.
apctest error termination completed
chris@PMS1:~$

How do I trouble shoot the usb? I will try in on a new machine to check it is not the hardware.

Thanks

====

Ok done some more: Now running Ubuntu 20.04 on this celeron integrated itx board. Configured as above. Above I forgot to mention I set configured= yes in /etc/defaults/apcupsd.

chris@chris-desktop:~$ sudo apctest
2021-03-28 13:59:45 apctest 3.14.14 (31 May 2016) debian
Checking configuration ...
sharenet.type = Network & ShareUPS Disabled
cable.type = USB Cable
mode.type = USB UPS Driver
Setting up the port ...
apctest FATAL ERROR in apctest.c at line 319
Unable to open UPS device.
  If apcupsd or apctest is already running,
  please stop it and run this program again.
apctest error termination completed

So it is not connecting to the ups by usb, on any usb socket of two machines with 2 different cables.

chris@chris-desktop:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 13ba:0018 PCPlay Barcode PCP-BCG4209
Bus 001 Device 002: ID 0781:5567 SanDisk Corp. Cruzer Blade
Bus 001 Device 005: ID 046d:c05b Logitech, Inc. M-U0004 810-001317 [B110 Optical USB Mouse]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
chris@chris-desktop:~$ 

So I think it is connecting usb as "PCPlay Barcode PCO-BCG4209"...

chris@chris-desktop:~$ apcaccess status
APC      : 001,017,0428
DATE     : 2021-03-28 13:57:21 +0100  
HOSTNAME : chris-desktop
VERSION  : 3.14.14 (31 May 2016) debian
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2021-03-28 13:56:41 +0100  
STATUS   : COMMLOST 
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 1 Seconds
NUMXFERS : 0
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
STATFLAG : 0x05000100
END APC  : 2021-03-28 13:57:40 +0100  
chris@chris-desktop:~$

Again this is substantially smaller than what the tutorials indicate and it is all from the config file not the device. When I run the apcaccess command it waits for 10-20s then presents this as if waiting for the ups to respond but times out.

Brand new usb ups, packaging in good condition on arrival, functions as it should in other respects. I've read the whole manual sheet, nothing to suggest I should 'activate' usb on the ups device at all. Any thoughts anyone?

Only thing I can think of is to somehow use the modem port on the back to access then device. The instructions say they are modem/phone/network ports, but they are not network RJ45 ports. I would need modem/serial cable, never done this. Is this over the top, or normal practice for managing a ups?

The User guide does talk about accessing the devices embedded webpage, but it would need an RJ45 port...

...There is a windows usb client for accessing the device... ...could try that. (Using windows to fix a Linux problem, it used to be the other way round.)

===

Ok using a dell laptop and down loading win10 powere chute from the apc website - fails on install, 2 errors: switch off active power management and make sure the device is plugged in. Tried 2 cable is each of 2 ports - all known to work, no better. Tried finding Active Power Managment in Win10. It is never named in your system what it is named in the tutorials, so finding the closest sounding thing - battery management in the device manager - disabling, still no better - same error. Request for help submitted to APC homepage.

So far I can only conclude the usb on this usp is dead.

I struggle to believe this, It can't just be 'dead' usb but work in every other respect?

2021-03-29 20:09:21 +0100  Communications with UPS lost.
2021-03-29 20:19:34 +0100  Communications with UPS lost.
2021-03-29 20:29:46 +0100  Communications with UPS lost.
2021-03-29 20:39:59 +0100  Communications with UPS lost.
2021-03-29 20:41:58 +0100  apcupsd exiting, signal 15
2021-03-29 20:41:58 +0100  apcupsd shutdown succeeded
2021-03-29 20:41:58 +0100  apcupsd 3.14.14 (31 May 2016) debian startup succeeded
2021-03-29 20:43:10 +0100  Communications with UPS lost.
2021-03-29 20:45:44 +0100  apcupsd exiting, signal 15
2021-03-29 20:45:44 +0100  apcupsd shutdown succeeded
^C
chris@PMS1:/var/log$ 

This interestingly shows some causes. Following the usb checking instructions, if I run udevadm monitor --udev then I get miles of output for any usb device but NOTHING for the UPS. Like I am plugging in a loose cable. usb socket seems a tiny bit... ...loose? Bit tempted to get a screwdriver.... ...talk me out of it I need to confirm it has usb and if not then RMA it.

===

The APCUPSD page says do cat /proc/bus/usb/devices but this is not a place in 20.04? Th command above the equivalent substitute?

Clexp
  • 53

2 Answers2

16

Based on the comments, I edited the /etc/apcupsd/apcupsd.conf and found the following line: 

DEVICE /dev/ttyS0

Then commented it out and added a new line for just DEVICE with no value:

#DEVICE /dev/ttyS0
DEVICE

Save the file. Restart the apcupsd service with:

sudo systemctl restart apcupsd

Now the connection responds with full details:

apcaccess

APC : 001,036,0890 DATE : 2022-05-19 12:32:31 -0500
HOSTNAME : <removed> VERSION : 3.14.14 (31 May 2016) debian UPSNAME : <removed, same as hostname> CABLE : USB Cable DRIVER : USB UPS Driver UPSMODE : Stand Alone STARTTIME: 2022-05-19 12:32:28 -0500
MODEL : Back-UPS ES 600M1 STATUS : ONLINE LINEV : 118.0 Volts LOADPCT : 49.0 Percent BCHARGE : 100.0 Percent TIMELEFT : 12.1 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds SENSE : Medium LOTRANS : 92.0 Volts HITRANS : 139.0 Volts ALARMDEL : 30 Seconds BATTV : 13.5 Volts LASTXFER : No transfers since turnon NUMXFERS : 0 TONBATT : 0 Seconds CUMONBATT: 0 Seconds XOFFBATT : N/A SELFTEST : NO STATFLAG : 0x05000008 SERIALNO : 4B2146P30067
BATTDATE : 2021-11-21 NOMINV : 120 Volts NOMBATTV : 12.0 Volts NOMPOWER : 330 Watts FIRMWARE : 928.a9 .D USB FW:a9 END APC : 2022-05-19 12:32:33 -0500

Also, I had to use sudo apctest for it to work after the conf change, just doing apctest gave the same FATAL ERROR as before.

apctest

2022-05-19 12:53:45 apctest 3.14.14 (31 May 2016) debian Checking configuration ... sharenet.type = Network & ShareUPS Disabled cable.type = USB Cable mode.type = USB UPS Driver Setting up the port ... apctest FATAL ERROR in apctest.c at line 319 Unable to open UPS device. If apcupsd or apctest is already running, please stop it and run this program again. apctest error termination completed

sudo apctest

2022-05-19 12:54:15 apctest 3.14.14 (31 May 2016) debian Checking configuration ... sharenet.type = Network & ShareUPS Disabled cable.type = USB Cable mode.type = USB UPS Driver Setting up the port ... Doing prep_device() ...

You are using a USB cable type, so I'm entering USB test mode Hello, this is the apcupsd Cable Test program. This part of apctest is for testing USB UPSes.

Getting UPS capabilities...SUCCESS

Please select the function you want to perform.

  1. Test kill UPS power
  2. Perform self-test
  3. Read last self-test result
  4. View/Change battery date
  5. View manufacturing date
  6. View/Change alarm behavior
  7. View/Change sensitivity
  8. View/Change low transfer voltage
  9. View/Change high transfer voltage
  10. Perform battery calibration
  11. Test alarm
  12. View/Change self-test interval

Q) Quit

Select function number:

Austin
  • 125
1

Sorry everyone, it was a config issue, I didn't have the apcupsb.conf file quite right. I had gone over it so many times I was blind to my mistake, just follow the tutorials you see out there. Tested and will send the shutdown signal.

Thanks everyone.

Clexp
  • 53