LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   APC UPC - cannot find UPS device (https://www.linuxquestions.org/questions/linux-hardware-18/apc-upc-cannot-find-ups-device-209299/)

Parksy 07-24-2004 09:35 PM

APC UPS - cannot find UPS device
 
I have installed apcupsd on my mdk10 system using rpms. It installs fine and starts fine using service apcupsd start. Unfortunately, after about 10 seconds, the following error pops up:
Code:

acupsd FATAL ERROR in linux-usb.c at line 751
Cannot open UPS device: "" --
For a link to detailed USB troubleshooting information,
please see <http://www.apcupsd.com/support.html>.

a
Here's the relevant clip from linux-usb.c:
Code:

if (!open_usb_device(ups)) {
        write_unlock(ups);
        Error_abort1(_("Cannot open UPS device: \"%s\" --\n"
          "For a link to detailed USB troubleshooting information,\n"
          "please see <http://www.apcupsd.com/support.html>.\n"), ups->device);
    }

I'm guesing this means that the usb device can't be opened, but I don't know how to fix the problem.

This is my simple config file (just the required basics):
Code:

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

I have also tried DEVICE /dev/usb/hiddev[0-15].

Here is some info about my device:
cat /proc/bus/usb/devices
Code:

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=051d ProdID=0002 Rev= 1.06
S:  Manufacturer=APC
S:  Product=Back-UPS ES 350 FW:800.e5.D USB FW:e5
S:  SerialNumber=AB0404245513 
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=hid
E:  Ad=81(I) Atr=03(Int.) MxPS=  6 Ivl=10ms

ls -l /dev/usb/h*
Code:

crw-r--r--  1 root root 180,  96 Jul 24 21:48 /dev/usb/hiddev0
crw-r--r--  1 root root 180,  97 Jul 24 21:48 /dev/usb/hiddev1
crw-r--r--  1 root root 180, 106 Jul 24 21:49 /dev/usb/hiddev10
crw-r--r--  1 root root 180, 107 Jul 24 21:49 /dev/usb/hiddev11
crw-r--r--  1 root root 180, 108 Jul 24 21:49 /dev/usb/hiddev12
crw-r--r--  1 root root 180, 109 Jul 24 21:49 /dev/usb/hiddev13
crw-r--r--  1 root root 180, 110 Jul 24 21:50 /dev/usb/hiddev14
crw-r--r--  1 root root 180, 111 Jul 24 21:50 /dev/usb/hiddev15
crw-r--r--  1 root root 180,  98 Jul 24 21:49 /dev/usb/hiddev2
crw-r--r--  1 root root 180,  99 Jul 24 21:49 /dev/usb/hiddev3
crw-r--r--  1 root root 180, 100 Jul 24 21:49 /dev/usb/hiddev4
crw-r--r--  1 root root 180, 101 Jul 24 21:49 /dev/usb/hiddev5
crw-r--r--  1 root root 180, 102 Jul 24 21:49 /dev/usb/hiddev6
crw-r--r--  1 root root 180, 103 Jul 24 21:49 /dev/usb/hiddev7
crw-r--r--  1 root root 180, 104 Jul 24 21:49 /dev/usb/hiddev8
crw-r--r--  1 root root 180, 105 Jul 24 21:49 /dev/usb/hiddev9

lsusb:
Code:

Bus 001 Device 002: ID 051d:0002 American Power Conversion Back-UPS Pro 500
Bus 001 Device 001: ID 0000:0000


ixe 08-06-2004 12:38 PM

I have the same problem with an APC Back-UPS Pro 500
Someone please help him :)

ixe 08-13-2004 08:02 PM

Solved it on my box...
 
Ok, well I don't know if this is going to be helpful to anyone or not, but I figured out what was wrong on my box. I was running mandrake's "secure" 2.6.3 kernel and realized when I did a "zcat /proc/config.gz"|grep -i devfs that devfs wasn't enabled. Switching to their standard kernel fixed everything.

When you do that zcat (assuming your kernel has CONFIG_IKCONFIG=y and CONFIG_IKCONFIG_PROC=y), you should see:
CONFIG_DEVFS_FS=y
CONFIG_DEVFS_MOUNT=y

Oh, also, I don't know a lot about dev nodes, major and minor numbers, and all that, but I did notice that on mine it reports "crw-r--r-- 1 root root 180, 0 Dec 31 1969 hiddev0"
Your minor number for hiddev0 is much higher...if you want to take a shot in the dark, try pointing apcupds to look at the node that has the maj & min numbers 180 0 or if it doesn't exist maybe do a "mknod /dev/usb/MyUPS c 180 0" and point it to that..... don't blame me if this breaks something :) I've only been in the linux world for a few years and am still learning new things all the time. I'm sure making that node isn't the "Right Way" but it may be a clue for you to find your problem. Good luck

--Jacob

Parksy 08-13-2004 08:17 PM

Re: Solved it on my box...
 
Quote:

Originally posted by ixe
Ok, well I don't know if this is going to be helpful to anyone or not, but I figured out what was wrong on my box. I was running mandrake's "secure" 2.6.3 kernel and realized when I did a "zcat /proc/config.gz"|grep -i devfs that devfs wasn't enabled. Switching to their standard kernel fixed everything.
I've been using the secure kernel. I haven't tried changing it yet but I'll give it a shot (tonight or tomorrow morning) and I'll be back here with my results.

Thanks a lot for your suggestions. If you have any more helpful tips, let us know. :)


Edit: Seems to be working fine now! I haven't tested a full power failure, but service apcupsd status works and I've received events when I unplugged the ups from the line. All I did was change the kernel - didn't do anything with the minor numbers.

Thanks a bunch!

jonr 11-11-2004 08:41 PM

I'm having this same problem, with Mdk 10.1 that I finally got installed today (it's a long boring terrifying story).

Can one of you please tell me how to change to the "regular" kernel instead of the "secure" one so that I can get my apcupsd working and don't have to worry about bad shutdowns in case of power failure?

I'd very much appreciate step-by-step instructions. I know how to install a new kernel, but I don't know where to find the one you're talking about or if it's just a question of installing it like a kernel upgrade.

Thanks in advance!

Parksy 11-12-2004 12:11 AM

Quote:

Originally posted by jonr
I'm having this same problem, with Mdk 10.1 that I finally got installed today (it's a long boring terrifying story).

Can one of you please tell me how to change to the "regular" kernel instead of the "secure" one so that I can get my apcupsd working and don't have to worry about bad shutdowns in case of power failure?

I'd very much appreciate step-by-step instructions. I know how to install a new kernel, but I don't know where to find the one you're talking about or if it's just a question of installing it like a kernel upgrade.

Thanks in advance!

It should work just like an upgrade. Type
Code:

urpmi kernel
and you should get a long list of all the kernels available. You can pick almost any one that isn't secure - I would recommend just using a new 2.6 kernel.

It will have to download and install, and then I think you'll need to edit /etc/lilo.conf. Check that file before and after to see if the urpmi installation makes and changes to it. If the install makes changes itself, run
Code:

lilo
just to make sure that the changes are reread by your bootloader.

If the changes aren't done automatically, you will have to do them yourself. In lilo.conf, duplicate the entry for the kernel you are using. Edit the label (that's the name that will show up in the bootloader screen). Next look in /boot/ to see what new files are there. It's the vmlinuz, System.map and initrd files that will be created for your new kernel (I'm going from memory here). So go back to /etc/lilo.conf and edit the corresponding entries under your new label. You'll likely just have to edit the filenames for those three files.

If you want that kernel to load by default, go to the top of /etc/lilo.conf and changes the default entry to the label of your new kernel. Regardless of if you want the new kernel to be default or not, save the file and run
Code:

lilo
to read the changes you made.

Reboot and you should be able to boot up with your new kernel. If you have any problems post again and I should be able to figure out what I missed.

jonr 11-12-2004 01:01 AM

Just saw your reply on my way to bed--it turned out I was able to solve the apcupsd problem by changing one line in the apcupsd.conf file, to use what I guess is a new naming convention that resulted in a new path for finding the USB device. I got my clue from another thread in LQ.

Meanwhile I did install another kernel and then my mouse didn't work right. Luckily I knew from experience recently how to fix that (wrong type of mouse reported, and wrong button assignments).

After reading your post, I tried "urpmi kernel" and got one of my few laughs of the day when after thinking it over for a while, urpmi reported back:

Code:

Everything already installed
With that I'm heading the rest of the way to bed. Enough for today! :rolleyes:

S.Fart 11-25-2004 03:20 PM

[QUOTE]Originally posted by jonr
[B]Just saw your reply on my way to bed--it turned out I was able to solve the apcupsd problem by changing one line in the apcupsd.conf file, to use what I guess is a new naming convention that resulted in a new path for finding the USB device. I got my clue from another thread in LQ.
<snipped>

Hi jonr I have a similar problem with apcupsd and mdk 10.1 any chance you could post the line you changed or post the txt of your apcupsd.conf file
rgds S.F

jonr 11-25-2004 06:28 PM

[QUOTE]Originally posted by S.Fart
[B]
Quote:

Originally posted by jonr
Just saw your reply on my way to bed--it turned out I was able to solve the apcupsd problem by changing one line in the apcupsd.conf file, to use what I guess is a new naming convention that resulted in a new path for finding the USB device. I got my clue from another thread in LQ.
<snipped>

Hi jonr I have a similar problem with apcupsd and mdk 10.1 any chance you could post the line you changed or post the txt of your apcupsd.conf file
rgds S.F

Here is the section in question. The line I changed is the one that reads "DEVICE /dev/hiddev0"

I think it used to be something like "DEVICE /dev/usb0" or similar.



# Here a table of the possible devices related with the UPS drivers:
#
# Driver Device Description
# dumb /dev/tty** Serial character device
# apcsmart /dev/tty** Serial character device
# net hostname:port Network link to a master apcupsd
# through NIS
# snmp hostname:port:vendor:community
# SNMP Network link to an SNMP-enabled
# UPS device. Vendor is the MIB used by
# the UPS device: can be "APC" or "RFC"
# where APC is the powernet MIB and RFC
# is the IETF's rfc1628 UPS-MIB.
# Port is usually 161.
DEVICE /dev/hiddev0


(Note: the little happy faces are where the text says "colon p" as you might guess.) :p

S.Fart 11-26-2004 12:31 PM

Thanks jonr
I will give that a try, I think its got me on the right track anyway. This 10.1 has been lously to install where as 10.0 was a sweet install.
rgds S.F.

jonr 11-26-2004 12:33 PM

Quote:

Originally posted by S.Fart
Thanks jonr
I will give that a try, I think its got me on the right track anyway. This 10.1 has been lously to install where as 10.0 was a sweet install.
rgds S.F.

Let us know if it works... Hope it does.

S.Fart 11-27-2004 11:47 AM

Hi Jon
No luck I an afraid I think it has something to do with the new usb udev. I and going to leave it for a day or two and read about udev and also try to get my scsi stuff working I think its a similar problem
rgds S.F

jonr 11-27-2004 11:53 AM

Quote:

Originally posted by S.Fart
Hi Jon
No luck I an afraid I think it has something to do with the new usb udev. I and going to leave it for a day or two and read about udev and also try to get my scsi stuff working I think its a similar problem
rgds S.F

I don't have any actual scsi devices, but I know that under kernel =>2.6 scsi emulation is no longer required--and sure enough I didn't have to fix up that emulation stuff under 10.1 and the new kernel.

Sorry it didn't work. It always seems like every "upgrade" takes five or six steps backwards. :(

S.Fart 11-27-2004 01:14 PM

Ah I suppose its all part of the learning process, its just a bit frustrating at times.
I do like the new kde stuff, much more stable I haven't had kpilot or knotes crash yet.
I am beginning to think my scsi prob might an install issue I remember seeing something about a perl error and something to do with scsi. Other than the scsi and ups probs its fine. Wasn't impressed with their unfinished incorporation of NUTS though.
rgds S.F


All times are GMT -5. The time now is 07:27 PM.