APC USB ups, Back-UPS ES series, 2.5.68

APC USB ups, Back-UPS ES series, 2.5.68

Post by David For » Sun, 04 May 2003 05:10:06



(Please cc: me on reply)

I'm wanting to get this new toy up and running.  I've installed apcupsd,
but it doesn't want to work well with my kernel (2.5.68) or somewhat.

When apcupsd tries to open the hiddev, open() gets an ENODEV.  Is
apcupsd doing something wrong or is 2.5.68 doing something wrong?

~# dmesg
hub 1-0:0: debounce: port 1: delay 100ms stable 4 status 0x301
hub 1-0:0: new USB device on port 1, assigned address 4
usb 1-1: new device strings: Mfr=3, Product=1, SerialNumber=2
usb 1-1: Product: Back-UPS ES 350 FW:800.e3.D USB FW:e3
usb 1-1: Manufacturer: APC
usb 1-1: SerialNumber: AB0238241677
usb 1-1: usb_new_device - registering interface 1-1:0
hid 1-1:0: usb_device_probe
hid 1-1:0: usb_device_probe - got id
drivers/usb/core/file.c: asking for 1 minors, starting at 96
drivers/usb/core/file.c: found a minor chunk free, starting at 96
hiddev96: USB HID v1.10 Device [APC Back-UPS ES 350 FW:800.e3.D USB
FW:e3] on usb-00:07.2-1

~# ls -l /dev/usb/hid
total 0
crw-r--r--    1 root     root     180, 192 Dec 31  1969 hiddev96
crw-r--r--    1 root     root     180, 193 Dec 31  1969 hiddev97

~# strace -f apcupsd (trimmed)
[...]
open("/dev/usb/hid/hiddev95", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/dev/usb/hid/hiddev96", O_RDONLY) = -1 ENODEV (No such device)
open("/dev/usb/hid/hiddev97", O_RDONLY) = -1 ENODEV (No such device)
open("/dev/usb/hid/hiddev98", O_RDONLY) = -1 ENOENT (No such file or
directory)
write(2, "Couldn\'t find UPS device or no p"..., 43Couldn't find UPS
device or no permission.
) = 43
_exit(1)                                = ?

ref: http://www.sibbald.com/apcupsd/manual/usb.html
apcupsd version: 3.10.5
Linux kernel: 2.5.68

David
p.s. apcupsd needs patched to handle hiddev from 96 on (minor allocated by kernel)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

APC USB ups, Back-UPS ES series, 2.5.68

Post by Greg K » Sun, 04 May 2003 08:50:06



> (Please cc: me on reply)

> I'm wanting to get this new toy up and running.  I've installed apcupsd,
> but it doesn't want to work well with my kernel (2.5.68) or somewhat.

> When apcupsd tries to open the hiddev, open() gets an ENODEV.  Is
> apcupsd doing something wrong or is 2.5.68 doing something wrong?

> ~# dmesg
> hub 1-0:0: debounce: port 1: delay 100ms stable 4 status 0x301
> hub 1-0:0: new USB device on port 1, assigned address 4
> usb 1-1: new device strings: Mfr=3, Product=1, SerialNumber=2
> usb 1-1: Product: Back-UPS ES 350 FW:800.e3.D USB FW:e3
> usb 1-1: Manufacturer: APC
> usb 1-1: SerialNumber: AB0238241677
> usb 1-1: usb_new_device - registering interface 1-1:0
> hid 1-1:0: usb_device_probe
> hid 1-1:0: usb_device_probe - got id
> drivers/usb/core/file.c: asking for 1 minors, starting at 96
> drivers/usb/core/file.c: found a minor chunk free, starting at 96
> hiddev96: USB HID v1.10 Device [APC Back-UPS ES 350 FW:800.e3.D USB
> FW:e3] on usb-00:07.2-1

> ~# ls -l /dev/usb/hid
> total 0
> crw-r--r--    1 root     root     180, 192 Dec 31  1969 hiddev96
> crw-r--r--    1 root     root     180, 193 Dec 31  1969 hiddev97

Huh?  /dev/usb/hiddev0 is major 180, minor 96.  So the kernel asked for
minor 96 and it got it.  Why are you trying to connect to minor number
192?

For a list of the USB minor numbers see:
        http://www.linux-usb.org/usb.devices.txt

It's a bit different from Documentation/devices.txt, I need to send the
updates to lanana.org someday...

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

APC USB ups, Back-UPS ES series, 2.5.68

Post by David For » Sun, 04 May 2003 12:10:10


Yep...a simple fact that I overlooked.  This is a devfs created file so
the kernel is at fault.  Looks like it's off by 128.

David



>>(Please cc: me on reply)

>>I'm wanting to get this new toy up and running.  I've installed apcupsd,
>>but it doesn't want to work well with my kernel (2.5.68) or somewhat.

>>When apcupsd tries to open the hiddev, open() gets an ENODEV.  Is
>>apcupsd doing something wrong or is 2.5.68 doing something wrong?

>>~# dmesg
>>hub 1-0:0: debounce: port 1: delay 100ms stable 4 status 0x301
>>hub 1-0:0: new USB device on port 1, assigned address 4
>>usb 1-1: new device strings: Mfr=3, Product=1, SerialNumber=2
>>usb 1-1: Product: Back-UPS ES 350 FW:800.e3.D USB FW:e3
>>usb 1-1: Manufacturer: APC
>>usb 1-1: SerialNumber: AB0238241677
>>usb 1-1: usb_new_device - registering interface 1-1:0
>>hid 1-1:0: usb_device_probe
>>hid 1-1:0: usb_device_probe - got id
>>drivers/usb/core/file.c: asking for 1 minors, starting at 96
>>drivers/usb/core/file.c: found a minor chunk free, starting at 96
>>hiddev96: USB HID v1.10 Device [APC Back-UPS ES 350 FW:800.e3.D USB
>>FW:e3] on usb-00:07.2-1

>>~# ls -l /dev/usb/hid
>>total 0
>>crw-r--r--    1 root     root     180, 192 Dec 31  1969 hiddev96
>>crw-r--r--    1 root     root     180, 193 Dec 31  1969 hiddev97

>Huh?  /dev/usb/hiddev0 is major 180, minor 96.  So the kernel asked for
>minor 96 and it got it.  Why are you trying to connect to minor number
>192?

>For a list of the USB minor numbers see:
>    http://www.linux-usb.org/usb.devices.txt

>It's a bit different from Documentation/devices.txt, I need to send the
>updates to lanana.org someday...

>thanks,

>greg k-h

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

APC USB ups, Back-UPS ES series, 2.5.68

Post by David For » Wed, 07 May 2003 02:50:12


I haven't had time to look at it and try to debug it.  The 96 v.s. 192
minor look like it's exactly 128 too high.  Perhaps it's a simple fix?

David


> Yep...a simple fact that I overlooked.  This is a devfs created file
> so the kernel is at fault.  Looks like it's off by 128.

>>> ~# ls -l /dev/usb/hid
>>> total 0
>>> crw-r--r--    1 root     root     180, 192 Dec 31  1969 hiddev96
>>> crw-r--r--    1 root     root     180, 193 Dec 31  1969 hiddev97

>> Huh?  /dev/usb/hiddev0 is major 180, minor 96.  So the kernel asked for
>> minor 96 and it got it.  Why are you trying to connect to minor number
>> 192?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

APC USB ups, Back-UPS ES series, 2.5.68

Post by Greg K » Wed, 07 May 2003 06:40:07



> I haven't had time to look at it and try to debug it.  The 96 v.s. 192
> minor look like it's exactly 128 too high.  Perhaps it's a simple fix?

Can you try this patch and let me know if it works or not?

thanks,

greg k-h

--- a/drivers/usb/input/hiddev.c        Sun May  4 23:49:54 2003

        hiddev->hid = hid;
        hiddev->exist = 1;

-       sprintf(devfs_name, "usb/hid/hiddev%d", minor);
+       sprintf(devfs_name, "usb/hid/hiddev%d", minor - HIDDEV_MINOR_BASE);
        devfs_register(NULL, devfs_name, 0,
-               USB_MAJOR, minor + HIDDEV_MINOR_BASE,
+               USB_MAJOR, minor,
                S_IFCHR | S_IRUGO | S_IWUSR, &hiddev_fops, NULL);
        hid->minor = minor;
        hid->hiddev = hiddev;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. UPS Woes (APC Back-UPS Pro)

Does anyone have an APC UPS working properly with Linux?  I've been using
Tom Webster's Genpowerd, trying to figure out which serial lines do what.
APC is less than helpful, and I'd rather not sign a NDA and fork over $50,
just so I can make my UPS do what it was supposed to do in the first
place.

Has anyone had any luck, either with Genpowerd or Miguel's Powerd?  I'd
like to use either the Win95 cable or the NT cable, which shipped with the
UPS, rather than build my own (though I could build one if I had clear,
definite plans and assurance that it works).

Also, can anyone explain to me the difference between "smart" and "simple"
signaling modes, and how the UPS knows which mode to use?

My UPS is a Back-UPS Pro 280 (plug-and-pray).  Thanks for any hints anyone
can share with me.

--

                  http://marley.hag.housing.washington.edu/jeffgarr

    A hard heart is no infallible protection against a soft head.
                                     - C.S. Lewis, the Abolition of Man

2. terminfos and termcaps

3. APC Back-UPS 400, updated howto for UPS?

4. Tru64 Supported Hardware / IDE Hard Drive

5. APC Back-UPS 500 USB

6. Graphic quality is bad with Mach64

7. APC USB Back-UPS Pro ?

8. inode number to file name

9. 2.5.68 and 2.5.68-mm2

10. [2.5.68] kexec for 2.5.68 available

11. powerd with APC Back-UPS Pro?

12. APC Back-UPS 400 and its UNIX cable