New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

[Solved] HID device that used to work on bubba2 fails on b3

Got problems with your B2 or B3? Share and get helped!
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

[Solved] HID device that used to work on bubba2 fails on b3

Post by Cheeseboy »

Dear linux boffins,

I have a APC Back-UPS CS 350, and have installed the apcupsd package on my bubba2.
I was pleasantly surprised at the time that the device was recognized by the software without any modifications to the bubba2. I've set it up to hibernate my ubuntu workstation 10 minutes after power failure, and then shutdown the bubba2 when 5% remains of the UPS battery. This works like a treat. I even hacked some scripts in the apcupsd installation to send a WOL package to my Ubuntu machine to wake it up when power resumes.

When I tried to migrate this solution to the b3, I ran into trouble.
The apcupsd software does not recognize the device.
I reckon it is because it is not showing up in /dev/usb as a hiddev, but rather in /dev as a hidraw (see below).

bubba2:
/var/log/syslog (or dmesg):

Code: Select all

Dec  3 19:11:46 bubba2 kernel: usb 1-1.2: new low speed USB device using fsl-ehci and address 23
Dec  3 19:11:46 bubba2 kernel: usb 1-1.2: configuration #1 chosen from 1 choice
Dec  3 19:11:48 bubba2 kernel: generic-usb 0003:051D:0002.0002: hiddev96: USB HID v1.10 Device [American Power Conversion Back-UPS CS 350 FW:807.q8.I USB FW:q8] on usb-fsl-ehci.0-1.2/input0
I can see it as /dev/usb/hiddev0:

Code: Select all

ls -l /dev/usb
crw-rw---- 1 root root 180, 96 2010-12-03 19:20 hiddev0

b3:
/var/log/syslog (or dmesg):

Code: Select all

Dec  3 19:18:17 b3 kernel: [166622.763824] usb 1-1.1: new low speed USB device using orion-ehci and address 3
Dec  3 19:18:19 b3 kernel: [166624.508978] generic-usb 0003:051D:0002.0001: hidraw0: USB HID v1.10 Device [American Power Conversion Back-UPS CS 350 FW:807.q8.I USB FW:q8] on usb-orion-ehci.0-1.1/input0
I can see it as /dev/hidraw0:

Code: Select all

ls -l /dev/hid*
crw------- 1 root root 252, 0 Dec  3 19:18 /dev/hidraw0
This is what the manual says:
Problem
2.6 kernels use udev and some distributions to not configure it to automatically create /dev/usb/hiddev?? as they should, causing apcupsd to fail to locate the UPS.
Workaround
Edit the file /etc/udev/rules.d/50-udev.rules, and add the following:
KERNEL="hiddev*", NAME="usb/hiddev%n"
I'm not sure about this. On the bubba2 there was only /etc/udev/rules.d.
This exists on the b3 as well, but there is also /lib/udev/rules.d, and the syntax seems to have changed.

Any pointers on what I can do to make the b3 recognize the device as /dev/usb/hiddev*?

Cheers,

Cheeseboy
Last edited by Cheeseboy on 26 Feb 2012, 08:27, edited 1 time in total.
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: HID device that used to work on bubba2 fails on b3

Post by DanielM »

I have the exact same model of APC ups and it's working like a charm on my B3 :-)

I have not tried apcupsd though, I use nut. I could give you my nut config files if you're interested?

/Daniel
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: HID device that used to work on bubba2 fails on b3

Post by Cheeseboy »

Hi Daniel,

Yes please.
I'd prefer to get apcupsd working, as I have already spent quite a bit of time to set it up.
But if that fails, I'll read up on nut.

Thanks!

/Cheeseboy

EDIT:
It would also be interesting to see if you only see a hidraw in /dev rather than a hiddev...
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: HID device that used to work on bubba2 fails on b3

Post by DanielM »

Cheeseboy wrote:It would also be interesting to see if you only see a hidraw in /dev rather than a hiddev...
Already mailed you, missed this one. In fact, a "ls /dev/h*" returns nothing at all for me. Maybe it's apcupsd fiddling with udev rules?

/Daniel
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: HID device that used to work on bubba2 fails on b3

Post by Cheeseboy »

That is interesting.
What about:
ls -l /dev/usb
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: HID device that used to work on bubba2 fails on b3

Post by DanielM »

Code: Select all

root@b3:/etc/nut# ls -l /dev/usb*
crw------- 1 root root 189, 0 17 nov 06.44 /dev/usbdev1.1
crw------- 1 root root 189, 1 17 nov 06.44 /dev/usbdev1.2
crw------- 1 root root 189, 2 17 nov 06.44 /dev/usbdev1.3
crw------- 1 root root 189, 3 17 nov 06.44 /dev/usbdev1.4
/Daniel
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: HID device that used to work on bubba2 fails on b3

Post by Cheeseboy »

The apcupsd package is no longer installed on my b3...

This is really annoying!
It could be that your device has a different firmware than mine, but I don't see any way of upgrading it from the manufacturer's web page...

Could I ask you to do another thing? (please replace your home directory as appropriate):

Code: Select all

root@b3:/lib/udev/rules.d# cd /etc/udev/rules.d/
root@b3:/etc/udev/rules.d# tar -czf /home/niklas/etc.udev.rules.d.tgz *
root@b3:/etc/udev/rules.d# cd /lib/udev/rules.d/
root@b3:/lib/udev/rules.d# tar -czf /home/niklas/lib.udev.rules.d.tgz *
Then send the files to me?

Thanks in advance!
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: HID device that used to work on bubba2 fails on b3

Post by DanielM »

I have never upgraded my ups in any way.

It identifies itself as 051d:0002, and a quick search for 0512 in the udev rules only gives one rule:

Code: Select all

ATTR{idVendor}=="051d", ATTR{idProduct}=="0002", MODE="664", GROUP="nut"
(in /lib/udev/rules.d/52-nut-usbups.rules)

To be honest I have no idea where in /dev the node ends up though...

/Daniel
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: HID device that used to work on bubba2 fails on b3

Post by Cheeseboy »

Hi Daniel,

Did you install nut from the debian repository, or did you install a different version manually?

/Cheeseboy
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: HID device that used to work on bubba2 fails on b3

Post by DanielM »

Cheeseboy wrote:Did you install nut from the debian repository, or did you install a different version manually?
Straight from official repository. Just used apt-get using the repositories included with B3.

/Daniel
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: HID device that used to work on bubba2 fails on b3

Post by Cheeseboy »

Thanks Daniel!

I got some unexpected results, but then I realized I didn't know what I was doing (copy/paste is dangerous).
So I will take a step back and redo it when I have time to read up properly.

I'd still like to migrate my existing implementation of apcupsd if possible.
If any experts on udev and/or linux hardware detection out there want to add any suggestions, they will be much appreciated.

/Ostpojke
a1n
Posts: 18
Joined: 18 Jan 2011, 05:41
Location: Netherlands

Re: HID device that used to work on bubba2 fails on b3

Post by a1n »

Hi, did you solve the problem? I have someting comparable. I cannot get nut to login to my ups (an Eaton Ellipse) through usb-hid. I have set up the udev rules, but they don't seem to make any difference, the rights are not changed after I reconnect the ups.
/a1n
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: HID device that used to work on bubba2 fails on b3

Post by Cheeseboy »

Hi, did you solve the problem? I have someting comparable. I cannot get nut to login to my ups (an Eaton Ellipse) through usb-hid. I have set up the udev rules, but they don't seem to make any difference, the rights are not changed after I reconnect the ups.
No, I kinda gave up, or rather left it for later.
My tries to change udev rules where also inconclusive.
So now my original solution with the bubba2 is still in place (the only reason bubba2 is still active).
It is on my todo-list though, but I never seem to get around to looking into it further...

It would be good to find a guide on how udev has changed between the versions...
aardric
Posts: 10
Joined: 04 Jul 2009, 15:01

Re: HID device that used to work on bubba2 fails on b3

Post by aardric »

Hail,
I am not sure whether I should be adding to this thread or starting a new one.
I installed NUT on bubba3 (obtained from the bubba3 repositories) and
upon running upsdrvctl :
/etc/nut# upsdrvctl start
Network UPS Tools - UPS driver controller 2.4.3
Can't start /lib/nut/usb-hid-ups: No such file or directory
I do have
/etc/nut# ls -l /lib/nut/
total 2040
-rwxr-xr-x 1 root root 112280 Dec 30 00:46 usbhid-ups

Why is the name different? Others appear to have NUT working on the
bubba3 so I must be doing something silly.
I expect, as usual, a solution will eventually bubble up over time.

cheers,
aardric
aardric
Posts: 10
Joined: 04 Jul 2009, 15:01

Re: HID device that used to work on bubba2 fails on b3

Post by aardric »

Hail,
My last show stopper was due to a typo in ups.conf.
Now the driver won't load and I receive the following message:
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
Can't claim USB device [051d:0002]: could not detach kernel driver from interface 0: Operation not permitted
0.010556 Driver failed to start (exit status=1)
This seems to be a commonly encountered error message so I'll poke around forums and
experiment a bit. When I resolve this, I'll post the solution in case anyone else has run into it.

aardric
Post Reply