# USB Hiddev problems, Belkin UPS

## upgrdman

I just bought a nice Belkin UPS, and I can use the monitoring software for it by using VMware inside of gentoo linux, but being as they provide Linux software, that is kind of annoying and pointless.

I installed the linux programs provided on the linux folder of the CD belkin provided in the box, but it seems as though the upsd daemon can't connect to my UPS.

I checked my kernel, and enabled USB HID, and the "/dev/hiddev raw HIS device support" which according to the help for that option, is useful for UPS's.

I copied the bzImage over to /boot, rebooted, and now i have a /dev/usb/hid/hiddev0:

```
root@farrell root # ls -l /dev/usb/hid/

total 0

crw-r--r--  1 root root 180, 96 Dec 31  1969 hiddev0

root@farrell root # 
```

but when i start the daemon, I get this:

```
root@farrell root # /etc/init.d/bulldog start

Bulldog Plus : Copyright (c) 2001, Belkin Components.

Starting upsd ... done.

root@farrell root #

Broadcast message from root (Fri Sep 17 03:46:55 2004):

UPS Disconnect! Cannot get information from UPS.
```

 :Sad:  So I tried dmesg, and all I get is a bunch of this one same line, and nothing else:

```
drivers/usb/input/hid-core.c: ctrl urb status -32 received

```

Can anyone help me out? I'm using 2.6.8-gentoo-r3.

Thanks,

--Farrell F.

----------

## hecatomb

Does the kernel notice the UPS when connected to the USB bus?

What does lsusb show you? There should be an entry for your UPS!

----------

## upgrdman

farrell root # lsusb

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 003: ID 050d:1100 Belkin Components

Bus 002 Device 002: ID 046d:c506 Logitech, Inc.

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 001: ID 0000:0000

farrell root #

the logitech thinggy is my wireless mouse. the belkin line is for my UPS

----------

## hecatomb

Sorry for my late reply had a weekend without inet!  :Wink: 

I'm not very familiar with this UPS devices but IMHO there may be a config where you can specify which device the upsd should use to communicate with the UPS.

 *Quote:*   

> 
> 
> ```
> drivers/usb/input/hid-core.c: ctrl urb status -32 received
> ```
> ...

 

I think the daemon isn't really "talking" to the right device.

Or the hiddev kernel module (if not compiled in kernel) is not loaded.

----------

## Xaid

Hi, I got a Belkin UPS yesterday and I didn't try the software on the CD but went and used www-apps/nut which partially works, and it gives me this output:

```

battery.charge: 100

battery.chemistry: Unknown

battery.runtime: 120

driver.name: hidups

driver.parameter.port: /dev/usb/hiddev0

driver.version: 2.0.1-pre4

ups.mfr: Unknown

ups.model: Unknown

ups.serial: Unknown

ups.status: OL

```

its not much, but at least its something. The weird thing is that after a while, it seems that something makes the kernel think that the device got disconnected, here's the message from dmesg:

```

...

drivers/usb/input/hid-core.c: ctrl urb status -71 received

usb 3-1: USB disconnect, address 2

usb 3-1: new low speed USB device using uhci_hcd and address 4

hiddev96: USB HID v1.11 Device [Belkin UPS] on usb-0000:00:1d.1-1

```

did you figure out what was the cause/fix for the "ctrl urb status -32 recieved" ?

----------

## hecatomb

Hi!

I've searched with google and found this about "status -31":

http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/2.5/usb-uhci-2.5.50.patch

For "status -71" I haven't found very much. The message is printed in this function at line 1199:

http://lxr.linux.no/source/drivers/usb/input/hid-core.c#L1179

Hope you have more luck when searching!

Best regards,

hecatomb

----------

## Xaid

Hi hecatomb,

I didn't find much about status -71 either, I saw some -31, some -75 but no -71.

I assume you have a Belkin UPS as well? I posted a couple of messages on the NUT mailinglist and it seems there's hope in getting the Belkin UPS F6C550-AVR (maybe other Belkin UPS'es that are USB based) working with the "newhidups" driver.

I took a look at the newhidups.h and I think I added the correct entry for Belkin there, and I'm hoping to get some help on writing belkin-hid.h from the mailinglist.

Check on the mailing list for more details, and I'll post back if there are any good news.

Regards,

Zaid

----------

## Xaid

Hi,

I'm trying to add support for USB-based Belkin UPS'es to www-apps/nut , so if anyone has any Belkin UPS'es that are USB based, could you paste the output of:

```

lsusb -v

```

So that I can add it to the list of supported models.

And I could use a hand in debugging/writing the driver, its not doing much right now, it detects the UPS, and finds the "charge" percentage, but I'm having some problems getting the other values.

If anyone is interested in helping, post back.

----------

## fryfrog

I know it is a little late, but I am just looking into this after buying a F6C1500-TW-RK and thought I might try providing what you asked for :)

 *Quote:*   

> 
> 
> Bus 001 Device 002: ID 050d:0751 Belkin Components
> 
> Device Descriptor:
> ...

 

----------

## Xaid

Hi fryfrog,

Thanks for the tree dump but at this stage you should subscribe to the NUT-upsdev mailing list since we have a working Belkin-hid driver now.   :Very Happy: 

The changes are not all commited into CVS yet (the last time I checked), so you'll have to apply the patches manually.

Check the threads for this month and August. The patches were written by Peter Selinger (the same person who wrote the belkinunv driver) and we tested it on two Belkin models so far and they work fine (except the problem that we cant seem to make the UPS do a softshutdown).

I would say get the patches and apply them (instructions are provided in August & September threads) and give it a test and see what you get, then post the results on the mailing list.

If you need any more info either post back here or on the mailing list.

Edit: I just checked, and I think the patches made it into CVS.

Zaid

----------

## gmtl3

Would the belkin-hid driver work for a F6H375-USB model belking UPS as well?  If so, I'll be checkin' the nut mailing list as well.  Here's the relevant snippit of my lsusb -v 

```
Bus 002 Device 005: ID 050d:0375 Belkin Components

Device Descriptor:

  bLength                18

  bDescriptorType         1

  bcdUSB               1.10

  bDeviceClass            0 (Defined at Interface level)

  bDeviceSubClass         0

  bDeviceProtocol         0

  bMaxPacketSize0         8

  idVendor           0x050d Belkin Components

  idProduct          0x0375

  bcdDevice            0.01

  iManufacturer           4 Belkin

  iProduct               20 Belkin UPS

  iSerial                 0

  bNumConfigurations      1

  Configuration Descriptor:

    bLength                 9

    bDescriptorType         2

    wTotalLength           34

    bNumInterfaces          1

    bConfigurationValue     1

    iConfiguration          0

    bmAttributes         0xc0

      Self Powered

    MaxPower               20mA

    Interface Descriptor:

      bLength                 9

      bDescriptorType         4

      bInterfaceNumber        0

      bAlternateSetting       0

      bNumEndpoints           1

      bInterfaceClass         3 Human Interface Devices

      bInterfaceSubClass      0 No Subclass

      bInterfaceProtocol      0 None

      iInterface              0

        HID Device Descriptor:

          bLength                 9

          bDescriptorType        33

          bcdHID               1.11

          bCountryCode           33

          bNumDescriptors         1

          bDescriptorType        34 Report

          wDescriptorLength     455

cannot get report descriptor

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x81  EP 1 IN

        bmAttributes            3

          Transfer Type            Interrupt

          Synch Type               none

        wMaxPacketSize          8

        bInterval             248

  Language IDs: (length=4)

     0409 English(US)

```

Thanks,

----------

