# apcupsd usb problem [CLOSED]

## bumpert

Hi i emerge apcupsd to be able to have details from my ups

when i try to start apcupsd with the apcupsd command i got this error:

FATAL ERROR in linux-usb.c at line 656

Cannot open UPS device:

how can i solve this? is it because my usb port isnt detected correctly? Maybe because i have a pci card to give me more usb port?

thxLast edited by bumpert on Fri Dec 30, 2005 9:36 pm; edited 1 time in total

----------

## zhen

Usually, when USB is not working, the first place to look is your kernel to make sure you have the correct controller type installed (EHCI, OHCI, UHCI, etc). Read the kernel documentation for those to see which you need (they are all under the USB section).

If you have the correct host adapter and the problem persists, then make sure that you have all USB HID (Human Interface Device) support compiled into the kernel as well. Your UPS is considered a HID device.

----------

## bumpert

hi, all the controller si in the kernel and all  the HID too  :Sad: 

----------

## bumpert

my problem isn't solved, could someone could help me? thx

----------

## A Hired Goon

You need to have only the one controller in the kernel. I have heard reports that if more then one are in USB does not work. so only compile the driver you actually need for your system (lspci should help).

A Hired Goon

----------

## bumpert

000:00:00.0 Host bridge: Intel Corp. 82865G/PE/P DRAM Controller/Host-Hub Interface (rev 02)

0000:00:01.0 PCI bridge: Intel Corp. 82865G/PE/P PCI to AGP Controller (rev 02)

0000:00:1d.0 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #1 (rev 02)

0000:00:1d.1 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #2 (rev 02)

0000:00:1d.2 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #3 (rev 02)

0000:00:1d.3 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #4 (rev 02)

0000:00:1d.7 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02)

0000:00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB/EB/ER Hub interface to PCI Bridge (rev c2)

0000:00:1f.0 ISA bridge: Intel Corp. 82801EB/ER (ICH5/ICH5R) LPC Bridge (rev 02)

0000:00:1f.1 IDE interface: Intel Corp. 82801EB/ER (ICH5/ICH5R) Ultra ATA 100 Storage Controller (rev 02)

0000:00:1f.2 IDE interface: Intel Corp. 82801EB (ICH5) Serial ATA 150 Storage Controller (rev 02)

0000:00:1f.3 SMBus: Intel Corp. 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)

0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)

0000:01:00.0 VGA compatible controller: nVidia Corporation NV25 [GeForce4 Ti 4200] (rev a3)

0000:02:00.0 USB Controller: NEC Corporation USB (rev 41)

0000:02:00.1 USB Controller: NEC Corporation USB (rev 41)

0000:02:00.2 USB Controller: NEC Corporation USB 2.0 (rev 02)

0000:02:01.0 Multimedia audio controller: Creative Labs SB Audigy (rev 04)

0000:02:01.1 Input device controller: Creative Labs SB Audigy MIDI/Game port (rev 04)

0000:02:01.2 FireWire (IEEE 1394): Creative Labs SB Audigy FireWire Port (rev 04)

0000:02:08.0 Ethernet controller: Intel Corp. 82562EZ 10/100 Ethernet Controller (rev 02)

which controller do i need?

sorry i'm newbie  :Smile: 

(but it's weird cause my printer that is on usb work well)

----------

## bumpert

nothing?

----------

## whiskeypriest

I'll add one more post to this thread in the hopes we can put it to bed.

First, what kernel are you using?  I only ask because there are still kernels out there (e.g. gaming-sources) which fall below the recommended version of 2.4.22.  From the USB Subsystem section of the apcupsd User's Manual:

 *Quote:*   

> One common cause is having a Linux kernel older than 2.4.22 (such as a stock RedHat 9 kernel). If this is the case for your system, please upgrade to at least kernel version 2.4.22 and try again.

 

If you're still below the recommended version, I'd upgrade as advised.

Second, since you mention that your printer is working, have you tried swapping USB ports?  Plug the UPS into the port your printer occupies and see if you get a response after restarting apcupsd.

Finally, to answer the question most recently asked: the USB host controller driver you need in the kernel is either UHCI (if you plug your UPS in directly) and/or OHCI (if you plug it into your USB PCI card, which I'm assuming is the NEC USB Controller listed in your previous post).  I myself haven't heard about the problems AHG mentioned with multiple USB drivers, but if your problem persists, that may be the cause and you should choose your driver accordingly.

I've written a HOWTO on exactly this subject if you're looking for a step-by-step walkthrough.  For the sake of convenience, however, here's what your kernel configuration might want to resemble:

```
USB support  --->

    <M> Support for USB

    [ ]   USB verbose debug messages

    --- Miscellaneous USB options

    [*]   Preliminary USB device filesystem

    [ ]   Enforce USB bandwidth allocation (EXPERIMENTAL)

    --- USB Host Controller Drivers

    < >   EHCI HCD (USB 2.0) support (EXPERIMENTAL)

    <M>   UHCI (Intel PIIX4, VIA, ...) support

    < >   UHCI Alternate Driver (JE) support

    <M>   OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support

    < >   SL811HS Alternate (x86, StrongARM, isosynchronous mode)

    < >   SL811HS (x86, StrongARM) support, old driver

    --- USB Device Class drivers

    < >   USB Audio support

    < >   USB Bluetooth support (EXPERIMENTAL)

    < >   USB MIDI support

    ---   SCSI support is needed for USB Storage

    < >   USB Modem (CDC ACM) support

    < >   USB Printer support

    --- USB Human Interface Devices (HID)

    <M>   USB Human Interface Device (full HID) support

    ---     Input core support is needed for USB HID input layer or HIDBP

    [*]     /dev/hiddev raw HID device support

    < >   USB HIDBP Keyboard (basic) support

    < >   USB HIDBP Mouse (basic) support

    < >   Aiptek 6000U/8000U tablet support

    < >   Wacom Intuos/Graphire tablet support

    < >   KB Gear JamStudio tablet support

    < >   Griffin Technology PowerMate support
```

Hope this helps.

----------

## bumpert

thx for the reply, sorry for the late answer...

i have a newer version of the kernel: 2.4.25-gentoo-r4

the usb port is workling, i tried on the printer usb port

my kernel options looks like this, so i'll check your tutorial and give you feedback

thx

----------

## bumpert

i tried your tutorial and when i tried to start it i had problem...  :Sad: 

apcupsd FATAL ERROR in linux-usb.c at line 686

Cannot open UPS device:

weird.. is there a way to see if my ups is really detected?

maybe energizer ups isnt supported by apcusd

----------

## ctford0

its called apcupsd for a reason.  it's for apc brand ups systems.  Take a look at the apcupsd website for supported hardware.

chris

----------

## bumpert

oh.... sorry for the trouble.. someone know a program for energizer ups?

thx

----------

## whiskeypriest

ctford0 is correct, unfortunatelyI didnt realize you were using a non-APC UPS unit.

You might have a look at NUT (Network UPS Tools).  A cursory glance doesnt seem to indicate support for Energizer UPS units, but I could be wrong.

Good luck with it; Im afraid thats the best guidance I can offer at this time.

----------

## bumpert

 *whiskeypriest wrote:*   

> ctford0 is correct, unfortunatelyI didnt realize you were using a non-APC UPS unit.
> 
> You might have a look at NUT (Network UPS Tools).  A cursory glance doesnt seem to indicate support for Energizer UPS units, but I could be wrong.
> 
> Good luck with it; Im afraid thats the best guidance I can offer at this time.

 

i'll give a check, and give you feedback... but my ups isn't listed in the supported one

thx

----------

## bumpert

sorry for the late answer, i'm very busy, i'll give a check and give you feedback

thx

----------

## bumpert

Energizer isn't supported by nut, so i'll give a check, if somone could give me a hint on energizer ups... thx

----------

## ctford0

try a google search...

energizer ups linux

if you dont find anything then it probably isnt supported.

chris

----------

## bumpert

yes already did this, found something: http://www.vttoth.com/ER-OF800.htm

didn't have time to check, but i'll give you feedback

----------

## ctford0

 *Quote:*   

> Update (September 2, 2003): A driver I wrote for the Energizer UPS is now officially part of the NUT (Network UPS Tools) system (starting with version 1.5.4). It is recommended that you use NUT instead of the experimental code below with your Energizer UPS.

 

I think this is your answer.  Good luck!

chris

----------

## bumpert

ok i'll try NUT when i'll be at home

thx

----------

## bumpert

i emerged nut but didn't find any doc or howto on how make it work, somebody?

thx for help

----------

## bumpert

nobody?

----------

## ctford0

 *bumpert wrote:*   

> i emerged nut but didn't find any doc or howto on how make it work, somebody?
> 
> thx for help

 

The website that you posted a few posts above tells you how to configure it.  What to type in on the cl to see that it is working properly and how to make it run in the background.  It says that everything right now should be considered very experimental but it's better than nothing I suppose.  Maybe you could write an init script if there isn't one already.

chris

----------

## bumpert

lol it's true, i'll give a check as soon as i have time and give you feedback

thx

----------

## bluesea

For what it's worth, I'm having a similar problem.  I have an APC UPS which was working flawlessly with 2.6.8-gentoo-r3.  Ever since my upgrade to 2.6.9-gentoo-r1, I get a USB error message on boot, and fgrep -i usb /var/log/messages looks like this:

```

Oct 25 23:41:00 ouzo usbcore: registered new driver usbfs

Oct 25 23:41:00 ouzo usbcore: registered new driver hub

Oct 25 23:41:00 ouzo usbcore: registered new driver ub

Oct 25 23:41:00 ouzo USB Universal Host Controller Interface driver v2.2

Oct 25 23:41:00 ouzo uhci_hcd 0000:00:1f.2: Intel Corp. 82801BA/BAM USB (Hub #1)

Oct 25 23:41:00 ouzo uhci_hcd 0000:00:1f.2: new USB bus registered, assigned bus number 1

Oct 25 23:41:00 ouzo hub 1-0:1.0: USB hub found

Oct 25 23:41:00 ouzo uhci_hcd 0000:00:1f.4: Intel Corp. 82801BA/BAM USB (Hub #2)

Oct 25 23:41:00 ouzo uhci_hcd 0000:00:1f.4: new USB bus registered, assigned bus number 2

Oct 25 23:41:00 ouzo hub 2-0:1.0: USB hub found

Oct 25 23:41:00 ouzo SLPB PCI0 HUB0 USB0 USB1 MODM UAR1 UAR2

Oct 25 23:41:00 ouzo usb 1-1: new low speed USB device using address 2

Oct 25 23:41:00 ouzo usb 1-2: new full speed USB device using address 3

Oct 25 23:41:04 ouzo ohci_hcd: 2004 Feb 02 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)

Oct 25 23:41:43 ouzo apcupsd[7500]: apcupsd FATAL ERROR in linux-usb.c at line 781 Cannot find UPS device -- For a link to detailed USB trouble shooting information, please see <http://www.apcupsd.com/support.html>.

Oct 26 18:28:44 ouzo usb 1-2: USB disconnect, address 3

Oct 26 18:28:51 ouzo usb 1-2: new full speed USB device using address 4

```

Kernel config changes relevant to USB:

```

boot # diff config-2.6.8-gentoo-r3 config-2.6.9-gentoo-r1| fgrep -i usb

> # CONFIG_SND_USB_USX2Y is not set

> # CONFIG_USB_SUSPEND is not set

> # CONFIG_USB_OTG is not set

< # CONFIG_USB_PWC is not set

```

It seems that 2.6.9-r1 has definitely done something to USB... ?

Thanks

-Mike.

----------

## whiskeypriest

A couple thoughts

First, which version of apcupsd are you using?

Second, it looks like youve got two USB hubs: one using the UHCI controller (an onboard Intel, I gather) and one using the OHCI controller (a PCI card, if Im not mistaken).  Which one is the UPS connected to?  Have you tried reversing the connection (i.e. plugging into the PCI card if it was connected directly before, or vice-versa)?

Finally, what does your apcupsd.conf file look like?  It looks like there might be a problem with device allocation; you can try commenting out the DEVICE line in your configuration file (see here for the reason why).

Like you, I answered no to all the new USB options in gentoo-dev-sources-2.6.9-r1, but my system is functioning as expected.

Finally, since this thread is actually about bumpert trying to get an Energizer UPS working with NUT, we might wish to move this discussion over to the Troubleshooting apcupsd with USB thread.

----------

## bluesea

Thanks for the input.  Before trying all those things, I had a thought based on your comment about saying "No" to all the new USB kernel options. It occurred to me that there was one _new_ USB-related item which I did _not_ say "no" to: CONFIG_BLK_DEV_UB.  The help message for this item claims that it helps with USB memory sticks/keys.  Since I use those (with no problem until 2.6.9-r1   :Smile:  ) I figured it couldn't hurt to say "yes".  My new rule for new kernels:  if it's not broken... etc, etc..

anyway - recompiled the kernel withOUT CONFIG_BLK_DEV_UB, and everything's fine again.

apcupsd is working again, as is my USB memory stick (which had also stopped working).

For some reason CONFIG_BLK_DEV_UB prevented the creation of /dev/usb/hid/hiddev0 (among other things).  Note that I'm not using udev yet (if it's not broken.... and yes, I know someday I'll have to convert).

Anyway - bottom line, got rid of CONFIG_BLK_DEV_UB and my /dev/usb/ came back and the devices could all be found.

Thanks for your input.

----------

## whiskeypriest

Happy to be of service (whether directly or not)and good catch on CONFIG_BLK_DEV_UB.  Since I didnt see it in your diff output, I forgot all about saying no to it.  Glad its all sorted.

We now return you to your regularly scheduled thread, already in progress

----------

## bumpert

is someone able to download the package offered into this link: http://www.vttoth.com/ER-OF800.htm

i'm not able

thx

----------

## bumpert

nobody? it could be the solution i need

thx

----------

## bumpert

i was finally able to download it, so when i'll have some spare time i'll try to make it work, and give you feedback

thx

----------

## bumpert

maybe you could help, i was trying to use this package. I do all the step in the installation guide, but i had problem with the step 5, i did the step 6, and come back to step 5 without success. It didn't seems to find my UPS

thx

----------

## bumpert

nobody?

----------

## bumpert

 :Sad: 

----------

## saghi

Hi,

I emerged Nut 2.0.0-r1 which, according to Viktor Toth, includes the driver for the Energizer ER-OF800 UPS.

Well, I don't see it in there at all!  In the driver's directory (/usr/lib/nut) there's nothing which comes close to the Energizer.  Here's a list:

apcsmart

belkin

belkinunv

bestuferrups

bestups

blazer

cyberpower

cyberpower1100

esupssmart

etapro

everups

fentonups

genericups

ippon

isbmex

liebert

masterguard

mge-shut

mge-utalk

oneac

powercom

safenet

sms

tripplite

tripplitesu

upsdrvctl

victronups

Shouldn't I be seeing an "Energizer Family" driver?  Everything up to this step has worked wonderfully for me, the "qups /dev/usb/hid/hiddev0 I" works, it reports the presence of my UPS, I just have no idea what to set my "driver" to in the /etc/nut/ups.conf.

Any help would be appreciated.

Thanks!

Oh yeah, I compiled all the USB specific stuff in the kernel itself and not as modules, would that be a problem?

----------

## bumpert

I hope you'll get help. For my part, i stop searching for this, cause my UPS is now dead  :Smile: 

thx for all who tried to help me. Good luck saghi...

----------

## saghi

Thanks, I hope so too.

Actually, Vikto just wrote me back and confirmed what I was kind of afraid of - that I'd have to compile the source code as it's not built into the Nut suite.  Normally I have no trouble compiling anything, but I've not had to compile a suite or segment of a suite since I embraced Gentoo, since I just use emerge.  No big deal I guess, I just need to take my time and make sure I do everything right.  I'm pretty sure I'm going to have to rewrite some of the paths of the include's.  

Did you go throught that?  Having to compile "energizerups.c"?

----------

## josh

Sorry to rehash this.

saghi: If you add "usb" to your USE flags for nut then it will compile energizerups (which is the driver you need). 

I'm trying to get my ER-OF800 UPS working with linux. Everything seems kosher but it just doesn't create the device or I just don't know where it is. When I plug it in it shows up in /proc/bus/usb/devices as it should. But it says this in /var/log/messages

```
Feb 18 22:13:49 lotuseaters HID device not claimed by input or hiddev
```

How could I make one of them take responsibility? I'm thinking that I"m missing a usb kernel option Or I have one too many. I've been over the kernel Options about a billion times. I have CONFIG_BLK_DEV_UB unset and I also have CONFIG_INPUT_HIDINPUT unset but I have the rest of the appropriate usb options as per the website. In fact, that is all I have since this is the only usb device I use. Have you gotten anywhere with this saghi?

----------

## josh

Duh. Forgot to enable /dev/hiddev support. Now the device shows up as /dev/usb/hiddev0 But it still complains that it can't 'talk' to it. If I use the qups tool from V Toth's website then it will seemingly "work" but I get no output. But there is no error either. Example:

```
lotuseaters eups # ./qups /dev/usb/hiddev0 I

lotuseaters eups # ./qups /dev/psaux I

Error in SUSAGE
```

----------

