Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

HOWTO: apcupsd with USB

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
119 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next
Author
Message
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

  • Quote

Post by whiskeypriest » Thu Mar 11, 2004 10:13 pm

Hope it remains stable for you...as stated above, that one redundant ";;" resulted in some seriously undesirable behavior on my systems.

As for your phantom outages: I'm no expert, but I have observed that some systems are more resilient than others when it comes to minor line fluctuations. There have been several occasions where my archaic Celeron-VIA-P.O.S. was still running after a brief power drop, while my “modern” P4-SiS workstation had rebooted itself...
Top
GTVincent
Tux's lil' helper
Tux's lil' helper
Posts: 91
Joined: Sat Oct 26, 2002 8:21 pm
Location: Las Vegas, NV

  • Quote

Post by GTVincent » Sun Mar 21, 2004 1:54 am

whiskeypriest wrote:Hope it remains stable for you...as stated above, that one redundant ";;" resulted in some seriously undesirable behavior on my systems.
I think I found the actual cause of my problems. It turns out that the SATA drive containing the root of my installation is on it's way to bit-heaven :( It rest in pieces and shall be RMA'd in the very near future.

In the mean time I've set up another computer as my router, gave it the UPS and I haven't had a problem with that one.

Yet ;-)
Top
t0mcat
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 111
Joined: Thu Feb 12, 2004 8:12 pm
Location: Catania, Italy
Contact:
Contact t0mcat
Website

  • Quote

Post by t0mcat » Wed Mar 31, 2004 6:09 pm

i'm having a different hang problem:

it happened two times, during rainy days, that, as usual where i live, there was a very quick lights-off-lights-on.
Theese two times it happened, the UPS (APC RS 800) did his work, but the pc crashed, the mouse freezed, no keys responding, and the keyboard leds blinking like an on-boot kernel panic.

the UPS works good with long blackouts, it correctly shutdown the system, but when occurs one of thoose nanosec energy failure, the PC hangs.

i've no stuff in every log of my pc, the failure is not reported in apcupsd log neither elsewhere, the kern.log appears like just deleted (but the old one stored by syslog-ng is 1 day old), there is no error reported in any other log, they are just interrupted.

the sys config is in the sign.

i've correctly followed the how-to, and corrected the apccontrol redundant ;;.

i've just recompiled the kernel with acpi battery as module (the other ACPI options are built-in, shall i recompile them as modules?), i'll see if the problem occurs again (but i guess i must wait another rainy day :P ).

i'm running also other services like apache, proftpd and postfix, but i don't think they are related to the problem.


hope my english is understandable
il gattaccio
a.k.a etienne
Top
shakti
Guru
Guru
User avatar
Posts: 358
Joined: Wed May 15, 2002 6:30 am
Location: omnipresent
Contact:
Contact shakti
Website

  • Quote

Post by shakti » Wed Mar 31, 2004 6:32 pm

a rapid on off of the power should not matter as the ups delays a bit before coming back on mains. Maybe adjust the sensitivity of you ups:
in /etc/apcupsd/apcupsd.conf:

Code: Select all

#    D 106 103 100 097
#    M 177 172 168 182
#    A 092 090 088 086
#    I 208 204 200 196     (default = 0 => not valid)
LOTRANSFER  208 #set this to something higher Italy is 220? go for 208
WAKEUP 60 #wait 1 minute before coming back online
SENSITIVITY H
Using Gentoo since 2002.
Top
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

  • Quote

Post by whiskeypriest » Fri Apr 02, 2004 6:34 pm

t0mcat:

I believe shakti’s got it right…it sounds as though apcupsd is trying to call the poweroff/mains-back events without enough delay between the two. The UPS itself should do a fine job of providing power through these brief outages without getting apcupsd involved – this is exactly what I bought my UPS units for, as brief drops are far more common in my area than extended outages. I’m not in front of my machines to check my settings at the moment, but it usually takes apcupsd about ten-to-fifteen seconds to acknowledge a power failure and a like amount of time to acknowledge a return to the mains. Following shakti’s recommendations should solve your problem.

Also, you may want to double-check the TIMEOUT value in your apcupsd.conf file, just to be certain it was reset to 0 after testing…anything else may be causing a premature shutdown-call that your machine is having difficulty recovering from.

Finally, if you want to test this theory without the rainy-day vector, you might try the time-honored tradition of breaker-off/breaker-on (if you have access to such things for your domicile). Failing that, there’s always the plug…please post here if you get the problem satisfactorily resolved.

shakti:

Thanks for the quick response on this. I’m actually in the midst of installing a poor-man’s access floor in my main computer room, and as such only have sporadic access to my email currently…
Top
t0mcat
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 111
Joined: Thu Feb 12, 2004 8:12 pm
Location: Catania, Italy
Contact:
Contact t0mcat
Website

  • Quote

Post by t0mcat » Fri Apr 02, 2004 8:26 pm

mmm, that was strange:

i've changed sens from H to M.

when i've restarted APCUPSD i've got the same crash!

i had to reboot, as usual, with a total shutdown (reset didn't worked).

now i have apcupsd running with sens M. i've tried a fast plug-off-plug-on with the power switch, and it seems to be ok, but i think that a rainy day will be a more realistic test.

i'll report it as soon as it will come!
il gattaccio
a.k.a etienne
Top
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

apcupsd-3.10.10-r1 now available...

  • Quote

Post by whiskeypriest » Thu Apr 22, 2004 5:52 pm

Just a quick update: I noticed apcupsd-3.10.10-r1 in portage earlier today, and have upgraded/tested all installations without incident.

Remember not to overwrite your apcupsd.conf file and you should be fine.
Top
mazirian
Apprentice
Apprentice
User avatar
Posts: 273
Joined: Thu Jun 26, 2003 12:55 pm
Location: Yarmouth, ME

  • Quote

Post by mazirian » Thu Apr 22, 2004 9:45 pm

I, on the other hand, was not able to update easily:

Code: Select all

tardis root # /etc/init.d/apcupsd start
 * Starting APC UPS daemon...
start-stop-daemon: stat /usr/sbin/apcupsd: No such file or directory     [ !! ]
Oops. Where'd the executable go?
Top
mazirian
Apprentice
Apprentice
User avatar
Posts: 273
Joined: Thu Jun 26, 2003 12:55 pm
Location: Yarmouth, ME

  • Quote

Post by mazirian » Thu Apr 22, 2004 9:55 pm

Oh, I see it's a bug already

46354
Top
mazirian
Apprentice
Apprentice
User avatar
Posts: 273
Joined: Thu Jun 26, 2003 12:55 pm
Location: Yarmouth, ME

  • Quote

Post by mazirian » Thu Apr 22, 2004 9:59 pm

..and now the ebuild is fixed.

Ok, sorry, nevermind me, just passing through. Nothing to see here...
Top
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

  • Quote

Post by whiskeypriest » Thu Apr 22, 2004 11:47 pm

Again, it's always nice when these things resolve themselves before I've even read the post...let me know if anyone runs into any further difficulties with this release.
Top
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

  • Quote

Post by whiskeypriest » Wed May 26, 2004 10:35 pm

Found apcupsd-3.10.10-r2 in portage just now; upgrade/testing ran normally on all systems.
Top
shanenin
Guru
Guru
User avatar
Posts: 579
Joined: Fri Nov 28, 2003 4:43 pm
Location: Rochester, MN U.S.A

  • Quote

Post by shanenin » Fri Jun 04, 2004 9:11 pm

thanks alot for the "how to" . It is nice being able to read a nice doc while trying to set something up, no need for endless searching. I had it setup, including a new kernel recompile in about 1/2 -1 hour.

edit/added

my alarm is not going off, which I guess is not all that important. If I read my apcupsd.conf correctly it should be going off immediatley after powerfaliure(default setting). The alarm is working when I have windows booted(hardly ever).. Maybe something is set wrong in my apcupsd.conf .

If it matters, I am running 2.6.4 . During the kernel config i think I followed all of your options exactly, except all of my usb modules are compiled directly into the kernel.
http://brighteyedcomputer.com
Top
shanenin
Guru
Guru
User avatar
Posts: 579
Joined: Fri Nov 28, 2003 4:43 pm
Location: Rochester, MN U.S.A

  • Quote

Post by shanenin » Sat Jun 05, 2004 12:20 am

I am happy enough with my ups behavior, but not totally. Below is a section from my apcupsd.conf

Code: Select all

# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter 
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 106 103 100 097
#    M 177 172 168 182
#    A 092 090 088 086
#    I 208 204 200 196     (default = 0 => not valid)
LOTRANSFER 97  
#
# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter 
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 127 130 133 136
#    M 229 234 239 224
#    A 108 110 112 114
#    I 253 257 261 265     (default = 0 => not valid)
HITRANSFER 136
It does not seem to have any effect on my results in apcaccess status if I uncomment the high and low tolerence settings for voltage. The figures that are shown in apcaccess status are the same ones that I set when I was running my ups in windows.
http://brighteyedcomputer.com
Top
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

  • Quote

Post by whiskeypriest » Sat Jun 05, 2004 2:46 am

Interesting. I've never had any issues with my UPS alarms (both chirp at me on a regular basis this time of year) but then, it also appears you're down in the EEPROM section of apcupsd.conf (which I routinely leave commented out).

The reason for this is twofold: one, neither of my UPS units (a Back-UPS CS350 and a Back-UPS XS1000) support EEPROM programming from apcupsd. If I run the appropriate command to check for the EEPROM output:

Code: Select all

# apcaccess eeprom
FATAL ERROR in apcaccess.c at line 225
Your model does not support EPROM programming.
The second reason I don't touch this stuff is because it seems to be vestigial in apcupsd-3.10.10-x; according to the apcupsd User’s Manual apcupsd.conf no longer configures the EEPROM (unless you choose to have it do so specifically from the appropriate utility). I won't go into the process for this as it's well very documented here...but I will draw your attention to the following from the aforementioned page:
In general, for the moment, we do not recommend that you change your EEPROM values unless absolutely necessary. There have been several reported cases of problems setting the Low Transfer Voltage. Consequently, if at all possible, do not attempt to change this value.

If despite these warnings, you must change your EEPROM, we recommend connecting your UPS to a Windows or NT machine running PowerChute and making the changes.

So while I can't explain your lack of alarm (though I'd start by commenting out the BEEPSTATE line and see where that gets you) your problems may stem from the fact that either you don't have a UPS that supports EEPROM programming, or you haven't used the correct command to update the EEPROM. This would also explain why your values haven't changed from where you set them while using PowerChute under your Windows installation.

Hope this goes some way towards answering your questions on this; EEPROM programming is not something I'm horribly familiar with (because my UPS units don't support it) so I'd be interested to hear what you come up with.

Best of luck, and glad the rest of the HOWTO was of use to you...
Top
shanenin
Guru
Guru
User avatar
Posts: 579
Joined: Fri Nov 28, 2003 4:43 pm
Location: Rochester, MN U.S.A

  • Quote

Post by shanenin » Sat Jun 05, 2004 3:01 am

Code: Select all

shane@marsala shane $ /usr/sbin/apcaccess eeprom
FATAL ERROR in apcaccess.c at line 225
Your model does not support EPROM programming
mine must not support eeprom either. To be honest I do not understand what eeprom is. Is it to do with the settings in the lower part of my apcupsd.conf?

Thanks for the link to the manual, I am sure I will find some answers there.
http://brighteyedcomputer.com
Top
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

  • Quote

Post by whiskeypriest » Sat Jun 05, 2004 5:38 am

From en.wikipedia.org, because I wasn't entirely sure myself:
An EEPROM, or Electrically-Erasable Programmable Read-Only Memory, is a non-volatile storage chip used in computers and other devices. Unlike an EPROM, an EEPROM can be programmed and erased multiple times electrically. It may be erased and reprogrammed only a certain number of times, ranging from 100,000 to 1,000,000, but it can be read an unlimited number of times. Flash memory is a later form of EEPROM. In the industry, there is a convention to reserve the term EEPROM to byte-wise writable memories compared to block-wise writable flash memories. EEPROM takes more die area than flash memory for the same capacity because each cell usually needs both a read and a write transistor where flash memory needs only one.
What does this mean to us? Not much, beyond what I mentioned earlier. You're correct that the EEPROM settings are (or rather, were) configured in the last section of your apcupsd.conf file. Since this functionality has been transferred to the apctest utility, those lines at the bottom of apcupsd.conf have essentially become superfluous, which (I'd imagine) is why they're commented out in the default configuration.

All of which is a moot point since I can't program the thing with apcupsd anyway. Personally, I make sure there's a nice # in front of every line from...

Code: Select all

# ========== Configuration statements used in updating the UPS EPROM ==========
...to the end of the apcupsd.conf file. Since my UPS units do not support this functionality, it's my preference to leave everything pertaining to it out of the configuration apcupsd uses.

Try it, restart apcupsd and see if your alarm is functioning as expected. If your particular situation absolutely requires tweaking of the EEPROM, I'd take the manual's advice and do it from your Windows installation. Just my $0.02 – again, this isn't something I'm familiar with, so I'd be interested in what you find...and if someone else with more expertise on the brainstem functions of the APC UPS wants to weigh in here, please feel free.
Top
bruor
Apprentice
Apprentice
Posts: 239
Joined: Tue Jul 08, 2003 8:12 am

  • Quote

Post by bruor » Sun Jul 18, 2004 9:07 pm

im still getting a problem that was mentioned earlier on.

Code: Select all

 # /etc/init.d/apcupsd start
 * Starting APC UPS daemon...
start-stop-daemon: stat /usr/sbin/apcupsd: No such file or directory      [ !! ]
i have tried an unmerge/remerge, as well as 10.9, (currenctly 10.10-r2) even tried 10.13

i always get this compile error.

Code: Select all

gcc -g -O  apcupsd.o apcoptd.o apcnet.o apcreports.o apcaction.o apcnis.o apcdevice.o /var/tmp/portage/apcupsd-3.10.10-r2/work/apcupsd-3.10.10/src/drivers/libdrivers.a /var/tmp/portage/apcupsd-3.10.10-r2/work/apcupsd-3.10.10/src/lib/libapc.a  -lpthread    -o apcupsd
apcupsd.o(.text+0x33f): In function `main':
: undefined reference to `attach_driver'
collect2: ld returned 1 exit status
gmake[1]: *** [apcupsd] Error 1
but the emerge reports success for every version, if anyone has an idea of whats going on that would be great, else if someone wants to just give me a link to the already built file, im sure itll run no problem ;)
Top
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

  • Quote

Post by whiskeypriest » Wed Jul 21, 2004 8:29 pm

I’ve been researching your problem for the past few days, and besides this thread (which you’ve already found) I’ve come up completely empty.

I hate to raise the ugly specter of remerging glibc, and gcc, but are your versions up-to-date? Have you recompiled glibc against the latest kernel-headers? Please keep in mind I’m not advocating this, just taking the proverbial shot in the dark.

I also noticed that your most recent post (to the aforementioned thread) mentions a few USB-related issues while compiling. Could this be a problem with your kernel configuration or USE flags? Again, just guessing…

If anyone else has any experience with or solution to this problem, please feel free to chime in…I’m buffaloed.
Top
bruor
Apprentice
Apprentice
Posts: 239
Joined: Tue Jul 08, 2003 8:12 am

  • Quote

Post by bruor » Thu Jul 22, 2004 4:22 am

thanks for your response, im using gentoo-dev-sources 2.6.5, bttv is broken in 2.6.7, as far as mythtv goes anyway. linux-headers is a matching version, as well the linux26-headers do not compile for me.

i did re-merge glibc just in case that would have an effect, as well, they are all up to date _stable_ releases. only use flags effecting the build are usb and apache2, snmp is off by default.

on a side note, i had a frien emerge -OK apcupsd-10.13 for me, i got the bzip2 and i untarred it in /

all the files i needed are now there, and apcupsd is working properly. im hoping after a few versions of other things get changed that stuff will work a little better. let me know if you uncover anything ;)

thanks again.
Top
webnoelle
n00b
n00b
Posts: 50
Joined: Tue Apr 06, 2004 10:18 pm

  • Quote

Post by webnoelle » Wed Jul 28, 2004 4:39 pm

great guide :) worked great for me!! thnx!!
Top
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

  • Quote

Post by whiskeypriest » Fri Jul 30, 2004 9:00 pm

bruor:

Sorry for the late reply; I’ve been on the road and my access has been sporadic, to say the least. I’ll post here if I find something relevant…meanwhile, I hope the next iteration of apcupsd treats you better.

webnoelle:

Glad you found it useful!
Top
bruor
Apprentice
Apprentice
Posts: 239
Joined: Tue Jul 08, 2003 8:12 am

  • Quote

Post by bruor » Fri Jul 30, 2004 9:56 pm

thanks for the reply, i think after some other stuff out there gets updated an emerge -u world will resolve some things fi i find a finite solution ill post it here.
Top
whiskeypriest
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 91
Joined: Thu Feb 05, 2004 6:18 pm

  • Quote

Post by whiskeypriest » Wed Aug 25, 2004 10:44 pm

As of earlier today, apcupsd-3.10.13 is available in portage.

All installations updated/tested without incident.
Top
elpierco
n00b
n00b
User avatar
Posts: 59
Joined: Sun Sep 28, 2003 7:47 am
Location: Lawrence Kansas

Got it my ES 500 APC working

  • Quote

Post by elpierco » Fri Aug 27, 2004 9:29 pm

So I had to compile usb support directly into the kernel to get the APC to work. I am using a 2.6 kernel...the guide is for 2.4 if I am not mistaken. So my question is anyone get the web application to work so that you can log into the web and check on the status??? Thanks El
Top
Post Reply

119 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic