Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: apcupsd with USB
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Hobbes-X
l33t
l33t


Joined: 04 Feb 2004
Posts: 823
Location: Seattle, WA

PostPosted: Sun Jun 10, 2007 7:20 pm    Post subject: Reply with quote

geforce wrote:
Can I connect many UPSes to one machine to monitor them (i only want to monitor) ?


If you want to have each UPS connected to only the one computer, you can run multiple instances of apcupsd. If each UPS will be connected to an individual computer, check out using apcupsd's net driver and running a master apcupsd with the others as slaves.
Back to top
View user's profile Send private message
geforce
l33t
l33t


Joined: 29 Dec 2003
Posts: 653
Location: Canada

PostPosted: Sun Jun 10, 2007 8:25 pm    Post subject: Reply with quote

I have 14 Upses...

Should i use another software like NUT ?
Back to top
View user's profile Send private message
trolley
Apprentice
Apprentice


Joined: 12 Jun 2002
Posts: 292
Location: Canada

PostPosted: Wed Jun 20, 2007 11:38 am    Post subject: [solved] Reply with quote

I think I have my kernel set up right, and I know the UPS is detected by the system, but I never get any logs in /var/log/messages and the apcupsd daemon doesn't detect the UPS. I see this if I run dmesg:

Code:

usb 1-2.5: new low speed USB device using ehci_hcd and address 9
usb 1-2.5: configuration #1 chosen from 1 choice
HID device not claimed by input or hiddev


Anyone know why?

EDIT:

Yet again I missed enabling a kernel option...


Last edited by trolley on Thu Jun 21, 2007 6:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
-Ben-
n00b
n00b


Joined: 23 Jan 2004
Posts: 73
Location: Worms

PostPosted: Thu Jun 21, 2007 6:38 pm    Post subject: Reply with quote

hm I get the following error in /var/log/messages

Code:

Jun 21 20:38:43 server apcupsd[8126]: apcupsd FATAL ERROR in linux-usb.c at line 597 Cannot find UPS device -- For a link to detailed USB trouble shooting information, please see <http://www.apcupsd.com/support.html>.
Jun 21 20:38:44 server apcupsd[8126]: apcupsd error shutdown completed


I don't understand why apcupsd doesn't find my ups.. it is in /dev/usb/hiddev0
dmesg shows the following

Code:

usb 1-2: USB disconnect, address 3
usb 1-2: new low speed USB device using uhci_hcd and address 4
usb 1-2: configuration #1 chosen from 1 choice
hiddev96: USB HID v1.11 Device [OMRON USB UPS] on usb-0000:00:07.2-2

_________________
AgainstTCPA don't let them take YOUR RIGHTS!!!
stophiphop.de
Back to top
View user's profile Send private message
boniek
Guru
Guru


Joined: 26 Mar 2005
Posts: 373

PostPosted: Thu Jun 21, 2007 7:20 pm    Post subject: Reply with quote

Both of you - make sure that you have
Code:
[*] /dev/hiddev raw HID device support

selected. It's in Device Drivers->USB Support->USB Human Interface Device (full HID) support
_________________
[HOWTO]New freetype subpixel font rendering for lcd monitors
Back to top
View user's profile Send private message
-Ben-
n00b
n00b


Joined: 23 Jan 2004
Posts: 73
Location: Worms

PostPosted: Thu Jun 21, 2007 7:22 pm    Post subject: Reply with quote

yes i have selected that.. otherweise I wouldn't get any /dev/usb/hiddev0 device....
I made this error before and didn't get this device.. now it is there and apcupsd still doesn't find the ups
_________________
AgainstTCPA don't let them take YOUR RIGHTS!!!
stophiphop.de
Back to top
View user's profile Send private message
boniek
Guru
Guru


Joined: 26 Mar 2005
Posts: 373

PostPosted: Thu Jun 21, 2007 7:23 pm    Post subject: Reply with quote

-Ben- wrote:
yes i have selected that.. otherweise I wouldn't get any /dev/usb/hiddev0 device....
I made this error before and didn't get this device.. now it is there and apcupsd still doesn't find the ups

Are you sure your USB cable is OK?
_________________
[HOWTO]New freetype subpixel font rendering for lcd monitors
Back to top
View user's profile Send private message
-Ben-
n00b
n00b


Joined: 23 Jan 2004
Posts: 73
Location: Worms

PostPosted: Thu Jun 21, 2007 7:25 pm    Post subject: Reply with quote

hmm no..
i have another ups of the same kind connected via an usb cable to my windows xp machine.. I'will use the other cable now to check that :)
_________________
AgainstTCPA don't let them take YOUR RIGHTS!!!
stophiphop.de
Back to top
View user's profile Send private message
trolley
Apprentice
Apprentice


Joined: 12 Jun 2002
Posts: 292
Location: Canada

PostPosted: Thu Jun 21, 2007 7:26 pm    Post subject: Reply with quote

boniek wrote:
Both of you - make sure that you have
Code:
[*] /dev/hiddev raw HID device support

selected. It's in Device Drivers->USB Support->USB Human Interface Device (full HID) support


That was my problem...just figured it out last night. Thanks though :)
Back to top
View user's profile Send private message
-Ben-
n00b
n00b


Joined: 23 Jan 2004
Posts: 73
Location: Worms

PostPosted: Thu Jun 21, 2007 7:28 pm    Post subject: Reply with quote

hm, checked it.. the usb cable is working...
what could be the problem?
my config file is

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

_________________
AgainstTCPA don't let them take YOUR RIGHTS!!!
stophiphop.de
Back to top
View user's profile Send private message
trolley
Apprentice
Apprentice


Joined: 12 Jun 2002
Posts: 292
Location: Canada

PostPosted: Thu Jun 21, 2007 7:31 pm    Post subject: Reply with quote

Try getting rid of the DEVICE line.

I used the standalone config from http://gentoo-wiki.com/HOWTO_APCUPSD and it worked.
Back to top
View user's profile Send private message
-Ben-
n00b
n00b


Joined: 23 Jan 2004
Posts: 73
Location: Worms

PostPosted: Thu Jun 21, 2007 7:34 pm    Post subject: Reply with quote

removing the device line doesn't change anything.. i don't understand this.. i got all the drivers necessary..

Code:

 ls -l /sys/bus/usb/drivers/
total 0
drwxr-xr-x 2 root root 0 Jun 21 21:16 hiddev
drwxr-xr-x 2 root root 0 Jun 21 21:16 hub
drwxr-xr-x 2 root root 0 Jun 21 21:16 usb
drwxr-xr-x 2 root root 0 Jun 21 21:16 usb-storage
drwxr-xr-x 2 root root 0 Jun 21 21:16 usbfs
drwxr-xr-x 2 root root 0 Jun 21 21:16 usbhid
drwxr-xr-x 2 root root 0 Jun 21 21:16 usblp


or did I miss something??
_________________
AgainstTCPA don't let them take YOUR RIGHTS!!!
stophiphop.de
Back to top
View user's profile Send private message
boniek
Guru
Guru


Joined: 26 Mar 2005
Posts: 373

PostPosted: Thu Jun 21, 2007 7:34 pm    Post subject: Reply with quote

I have
Code:
DEVICE /dev/ttyS0

and it works as well :)
-Ben- wrote:
hiddev96: USB HID v1.11 Device [OMRON USB UPS] on usb-0000:00:07.2-2

Are you sure you have APC UPS? Mine is seen as:
Code:
hiddev96: USB HID v1.10 Device [American Power Conversion Smart-UPS 1500 FW:601.3.I USB FW:1.5] on usb-0000:00:1d.0-2

_________________
[HOWTO]New freetype subpixel font rendering for lcd monitors
Back to top
View user's profile Send private message
-Ben-
n00b
n00b


Joined: 23 Jan 2004
Posts: 73
Location: Worms

PostPosted: Thu Jun 21, 2007 8:43 pm    Post subject: Reply with quote

never mind, i got it working with NUT now...
maybe my ups simply wasn't supported.. doesn't matter nut works :)
_________________
AgainstTCPA don't let them take YOUR RIGHTS!!!
stophiphop.de
Back to top
View user's profile Send private message
kowal
n00b
n00b


Joined: 23 Apr 2003
Posts: 40

PostPosted: Mon Aug 06, 2007 12:38 am    Post subject: Reply with quote

Flebool wrote:
I can't emerge apcupsd, neither version 3.10.17 or 3.10.18

the program emerge fine, but doesn't install any /usr/bin/apcupsd executable. there's no trace of it in the emerge log (scrolling the console, the last things it points out are the files it installs)

Obviously, trying to run the init script "/etc/init.d/apcupsd start" it fails miserably, with the error: "stat /usr/sbin/apcupsd: No such file or directory"

the system is an amd64 machine, but installed like a x86.

my USE flag emerging apcupsd is:

USE="apache2 ncurses nls usb -cgi -doc -snmp -threads"

I've tried disabling apache2 or adding all others, but it doesn't emerge any executable.

Any help?

Next step will be installing manually..


I'm on amd64 and had same issue. This helped:
Code:
USE="-* usb" emerge -v apcupsd
Back to top
View user's profile Send private message
nightkhaos
n00b
n00b


Joined: 21 Dec 2007
Posts: 1

PostPosted: Fri Dec 21, 2007 12:10 am    Post subject: /usr on lvm2 Reply with quote

Hi, So I followed your guide and everything works fine BUT one thing.

I came to test it using the TIMEOUT 30 and yanking the power cable out the back of the UPS to see if it worked.

it worked fine right up until AFTER it unmounted all my logical volumes and tried to execute something in /usr/sbin.

Now, is there a setting I can edit that'll make the script run /sbin/halt instead of the apcaccess command that tells the UPS to kill power to the machine?

Thanks.

NightKhaos
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2405
Location: Edmonton, AB

PostPosted: Tue Jul 15, 2008 8:24 pm    Post subject: Reply with quote

[quote="mark_lagace"]
Quote:
...[snip]

To do this, you'll need to modify 3 files. First, edit /etc/apcupsd/powerout (in my case, it's symlinked to /etc/apcupsd/onbattery). Add the following line prior to the exit 0 line:
Code:
touch /etc/apcupsd/powerfail

This will create the file /etc/apcupsd/powerfail when apcupsd detects loss of power.

Now edit the file /etc/apcupsd/mainsback and add the following command before the exit 0 line:
Code:
rm -rf /etc/apcupsd/powerfail

This will get rid of that file if the power comes back. N.B. The default init script for apcupsd automatically deletes the /etc/apcupsd/powerfail file upon apcupsd startup, so you don't have to worry about modifying any startup scripts to get rid of it.

The last thing to do, is to get your shutdown scripts to call /etc/apcupsd/apccontrol killpower when they are done shutting everything down. Edit the file /etc/init.d/halt.sh and add the following commands at the end of it:
Code:
# Attempting to add APCUPSD's killpower function here
if [ -f /etc/apcupsd/powerfail ]; then
        ewarn "Powerfail situation - shutting off the UPS"
        /etc/apcupsd/apccontrol killpower
        sleep 120
        exit 1
fi


The "sleep 120" line is required to give apcupsd enough time to send the commands to the UPS. You may need to increase this value if it's too low for your system.


Is this still valid configuration ? I'm using "apcupsd-3.12.4"
When I added line to file /etc/apcupsd/onbattery:
touch /etc/apcupsd/powerfail

the file: powerfail was not created when I pulled the power cord.
_________________
#Joseph
Back to top
View user's profile Send private message
Wraith
n00b
n00b


Joined: 02 May 2008
Posts: 4

PostPosted: Sun Nov 16, 2008 12:06 am    Post subject: Beware, all ye who enter here. Reply with quote

A quick word of caution - as ESR states in chapter 4 of his UPS HOWTO, simply pulling the plug on the UPS creates a floating ground, which can damage your computer (and yourself!). Unlikely it may be, but it can happen, so be careful.

Other than that, this is a great resource for those of us who have APC UPS's. Good work!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum