apcupsd problem

Having some problems starting apcupsd , followed the manual on the apcupsd site, basically just installed the package with ‘zypper in apcupsd’ , then edited the apcupsd.conf file, deleted everything that was inside and placed this instead :


## apcupsd.conf v1.1 ##
UPSCABLE usb
UPSTYPE usb
DEVICE
LOCKFILE /var/lock
UPSCLASS standalone
UPSMODE disable

executed ‘apcupsd start’ as root , nothing was reported, but the driver isn’t running, ‘tail /var/log/messages’ gives this :


Feb  5 02:36:57 linux-kjcm apcupsd[22073]: apcupsd FATAL ERROR in linux-usb.c at line 614
Feb  5 02:36:57 linux-kjcm apcupsd[22073]: apcupsd error shutdown completed

Obviously manual on that site is somewhat old, but anyhow ‘cat /proc/bus/usb/devices’ isn’t working on newer kernels and I don’t know how to proceed further.

‘lsusb’ produces this :


Bus 002 Device 002: ID 0471:0815 Philips (or NXP) eHome Infrared Receiver
Bus 003 Device 002: ID 192f:0416 Avago Technologies, Pte. 
Bus 003 Device 003: ID 0463:ffff MGE UPS Systems UPS
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Am I missing something ?

My question is why do this to the config file? There is a lot more in the file that is not remarked out than what you show. I normally set the top three you have and leave the rest alone as default and mine is working. Other things is in runlevel, YaST / System / System Services and I enable the service apcupsd for levels 1 2 3 5 and then start it. Last I start the GUI and let it appear in the icon tray at KDE / Menu / System / Monitor / APCUPSD Monitor. You need to enable it and check the system tray for use in KDE. I also autostart the APCUPSD icon tray application on each bootup of the KDE desktop.

Thank You,

Can we check whether “apcupsd” shows up in YaST==>RunLevel=>Expert Mode ? It might need to be set up there.
I would also believe you have installed apcupsd-gui to setup things

Your config changes look weird. The changes that I made are shown in this “diff” output:


--- apcupsd.conf        2011/11/23 04:31:44     1.1
+++ apcupsd.conf        2011/11/23 04:33:03     1.1.0.1
@@ -26,7 +26,7 @@
 #     940-1524C, 940-0024G, 940-0095A, 940-0095B,
 #     940-0095C, M-04-02-2000
 #
-UPSCABLE smart
+UPSCABLE usb
 
 # To get apcupsd to work, in addition to defining the cable
 # above, you must also define a UPSTYPE, which corresponds to
@@ -73,8 +73,8 @@
 #                            passphrase are the credentials for which the card 
 #                            has been configured.
 #
-UPSTYPE apcsmart
-DEVICE /dev/ttyS0
+UPSTYPE usb
+# DEVICE /dev/ttyS0
 
 # POLLTIME <int>
 #   Interval (in seconds) at which apcupsd polls the UPS for status. This

Or, to summarize, I changed the UPSCABLE to “usb”, changed the UPSTYPE to usb, and commented out the DEVICE line.

Beyond that, I activate in Yast runlevel services.

I will note that I filed a bug report for 12.3 Beta1, because there is no longer an entry in the Yast runlevel services for 12.3 Beta1, and nothing in the installed documentation on how to start. Reported as Bug 801312. I’m guessing that there is a magic systemd incantation needed somewhere.

I changed the config file later when I noticed that daemon wouldn’t start.
In the original config file I just changed upscable and upstype to usb and commented out device line, like the manual said.
New config file I took from the manual here : APCUPSD User Manual
Same thing in both cases, daemon can’t start and log is showing this :

apcupsd FATAL ERROR in linux-usb.c at line 614
apcupsd error shutdown completed

In Yast->System services, apcupsd is enabled (runlevels 1,2,3,5)

apcupsd-gui is installed but can’t do much with it if daemon can’t start.

I don’t know, maybe it’s the kernel (can’t think of anything else) , I’m on 3.7.4-1
Though everything else on the system works absolutely fine, except apcupsd.

Checking my logs, here are some recent records for apcupsd:


Jan 26 16:58:15 nwr2 apcupsd[948]: Power is back. UPS running on mains.
Jan 27 08:07:46 nwr2 apcupsd[910]: apcupsd 3.14.8 (16 January 2010) suse startup succeeded
Jan 29 00:36:13 nwr2 apcupsd[918]: apcupsd FATAL ERROR in linux-usb.c at line 614
Jan 29 00:36:13 nwr2 apcupsd[918]: apcupsd error shutdown completed
Jan 29 06:42:53 nwr2 apcupsd[887]: apcupsd FATAL ERROR in linux-usb.c at line 614
Jan 29 06:42:53 nwr2 apcupsd[887]: apcupsd error shutdown completed
Jan 29 08:17:46 nwr2 apcupsd[879]: apcupsd 3.14.8 (16 January 2010) suse startup succeeded
Jan 30 05:45:27 nwr2 apcupsd[879]: Power failure.
Jan 30 05:45:30 nwr2 apcupsd[879]: Power is back. UPS running on mains.
Jan 31 23:02:01 nwr2 apcupsd[879]: Power failure.
Jan 31 23:02:04 nwr2 apcupsd[879]: Power is back. UPS running on mains.
Feb  1 06:25:24 nwr2 apcupsd[879]: Power failure.
Feb  1 06:25:27 nwr2 apcupsd[879]: Power is back. UPS running on mains.

It so happens that I was having other problems with this computer from Jan 27-29.

Those two “FATAL ERROR” messages occurred when the computer had been moved for checking. At that time, the USB connector to the UPS was not plugged in.

My suggestion - check your cables.

An additional comment about this.

If you are using KDE, then check the power indicator (battery monitor) in the tray. If you have turned that off, you might need to turn it back on to check. And it will probably show up as a hidden icon.

When the USB connection to the UPS is plugged in, that battery monitor says “100% charged (not plugged in)”.
When the USB is not plugged in, there’s a red X on the icon, and it says “not plugged in”.

This happens, whether or not apcupsd is running, so you can use it as a check for the cable status.

I have not checked what happens in Gnome or other desktop. I seem to recall that the Gnome power manager does report the UPS status, without apcupsd running, but that’s a memory from several years ago and Gnome has changed a lot since then.

Cables and UPS itself are fine, as I dual-boot with windows7 it works there fine, even without any drivers at all but the built-in ones.

As I provided earlier, UPS is found by the system (Bus 003 Device 003: ID 0463:ffff MGE UPS Systems UPS) , so my guess is that cables are fine :slight_smile:

apctest gives this :


2013-02-05 15:46:18 apctest 3.14.8 (16 January 2010) suse
Checking configuration ...
Attached to driver: usb
sharenet.type = DISABLE
cable.type = USB_CABLE

You are using a USB cable type, so I'm entering USB test mode
mode.type = USB_UPS
Setting up the port ...
apctest FATAL ERROR in linux-usb.c at line 614
Cannot find UPS device --
For a link to detailed USB trouble shooting information,
please see <http://www.apcupsd.com/support.html>.
apctest error termination completed

On 2013-02-05 16:06, nrickert wrote:
> I have not checked what happens in Gnome or other desktop. I seem to
> recall that the Gnome power manager does report the UPS status, without
> apcupsd running, but that’s a memory from several years ago and Gnome
> has changed a lot since then.

I’m using xfce in 12.1 and it has such an applet running (xfce power
manager). Gnome 3 should have an equivalent thing, gnome 2 did.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Well, uninstalled apcusd and tried my luck with NUT, worked perfectly :slight_smile:


linux-kjcm:~ # rcupsd status
redirecting to systemctl
upsd.service - LSB: UPS monitoring software (remote/local)
          Loaded: loaded (/etc/init.d/upsd)
          Active: active (running) since Tue, 05 Feb 2013 17:19:38 +0100; 3s ago
         Process: 19137 ExecStop=/etc/init.d/upsd stop (code=exited, status=0/SUCCESS)
         Process: 19157 ExecStart=/etc/init.d/upsd start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/upsd.service
                  ├ 19193 /usr/lib/ups/driver/usbhid-ups -a Eaton-650
                  ├ 19197 /usr/sbin/upsd -u upsd
                  ├ 19200 /usr/sbin/upsmon
                  └ 19201 /usr/sbin/upsmon

Feb 05 17:19:38 linux-kjcm usbhid-ups[19193]: Startup successful
Feb 05 17:19:38 linux-kjcm upsd[19157]: Starting NUT UPS drivers ..done
Feb 05 17:19:38 linux-kjcm upsd[19196]: listening on ::1 port 3493
Feb 05 17:19:38 linux-kjcm upsd[19196]: listening on 127.0.0.1 port 3493
Feb 05 17:19:38 linux-kjcm upsd[19196]: Connected to UPS [Eaton-650]: usbhid-ups-Eaton-650
Feb 05 17:19:38 linux-kjcm upsd[19197]: Startup successful
Feb 05 17:19:38 linux-kjcm upsd[19157]: Starting NUT UPS server ..done
Feb 05 17:19:38 linux-kjcm upsmon[19200]: Startup successful
Feb 05 17:19:38 linux-kjcm upsd[19197]: User upsmaster@::1 logged into UPS [Eaton-650]
Feb 05 17:19:38 linux-kjcm upsd[19157]: Starting NUT UPS monitor ..done


linux-kjcm:~ # upsc Eaton-650
battery.charge: 100
battery.charge.low: 30
battery.runtime: 1620
battery.type: PbAc
device.mfr: MGE UPS SYSTEMS
device.model: Nova 625 AVR
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.vendorid: 0463
driver.version: 2.6.3
driver.version.data: MGE HID 1.27
driver.version.internal: 0.35
outlet.1.status: on
output.voltage: 230.0
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 19
ups.mfr: MGE UPS SYSTEMS
ups.model: Nova 625 AVR
ups.power.nominal: 625
ups.productid: ffff
ups.status: OL CHRG
ups.timer.shutdown: -1
ups.timer.start: -10
ups.vendorid: 0463

Anyways, thanks guys for trying :slight_smile:

In the meantime I found out that apcupsd is working only with APC models , that’s why my UPS wasn’t found.
NUT is supporting almost every model, very easy configuration, great support and nice GUI tools, like this one KNutClient (available in KDE:Extra repo)

I UPC is from APC, so that might be why I have not had problems.

Thanks for mentioning NUT - maybe I will give that a try when 12.3 is released. Does the GUI applet work with NUT, or is there a NUT specific GUI applet?

You can find all the GUI clients for NUT here
I only tried KNutClient , made a screenshot earlier while I was making previous post but haven’t posted that picture, so here it is now :

Client is sitting in the tray, hovering over it will give that info below the tray icon from the picture above, single click on tray icon will open the main interface, you can see how that looks in the picture above.
You can configure it to your liking, what is displayed etc.

Thanks again. That actually looks more informative than the “gapcmon” that I am using.

NUT seems to seems to web interface.

nut-cgi - Network UPS Tools Web Server Support (UPS Status Pages)
Web server support package for the Network UPS Tools.
Predefined URL is http://localhost/nut/index.html

I’ve installed Nut and Knutclient to try it with my APC UPS.

In the “preferences”, something called “UPS address” is needed. I’d be grateful if someone could tell me where to find it.

/usr/bin/lsusb gives me “Bus 007 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply” but I don’t think this is it.

In the above image ups address reads 127.0.0.1

It’s 127.0.0.1

But first make sure that after installation you configure things right.
It’s pretty simple actually, first you need to locate your model, just go here , then either narrow it down via combo boxes on the left to select your model, or just scroll down the page to locate your UPS, most likely you’re gonna find it, what you need is the driver name on the right, you’re gonna need that. It’s probably gonna be this one : usbhid-ups
Now, the config files are in the */etc/ups/ *directory.
Edit nut.conf first and put this : MODE = standalone
Next edit ups.conf , you configure here your model, this is mine :

[MGE-625]
driver = usbhid-ups
port = auto
desc = “Eaton MGE Nova 625 AVR”

You can put whatever you want in the brackets and desc , make sure the driver matches though for your model and that port is auto.

upsd.conf :
Uncomment this line : LISTEN 127.0.0.1 3494

upsd.users :
[upsmaster]
password = yourpassword (change this to your pass obv)
allowfrom = localhost
upsmon master

upsmon.conf :
MONITOR MGE-625@localhost 1 upsmaster yourpassword master

So here, instead of MGE-625 put whatever you put in the ups.conf above that is in the brackets, and change yourpassword with your password from upsd.users

And that’s it basically, you can go now in Yast->Services and enable upsd.

From the terminal you can issue this for example and get the info from the UPS : upsc MGE-625@localhost
Again, replace MGE-625 with whatever you placed for your model, APC or something.

In Knutclient you just add the UPS , again make sure the name matches (MGE-625 in my case) , address is 127.0.0.1, username is upmaster and password is your password.

Many thanks for that - I’ll have time to try it this evening.

Well I’m not having much success here. I’ve made all the changes (double checked) but when I try to start upsd, I get:

/etc/init.d/upsd start returned 6 (program not configured).

I notice that in the text for upsd.conf, the port number is given as 3493, whereas you quote 3494. But neither seems to work.

I’m stuck :(, but at least the red cross has gone from the Knutclient icon so it looks as if that bit’s ok.