[Nut-upsuser] Still trying to make nut work, failing miserably

Gene Heskett gheskett at wdtv.com
Wed Nov 12 04:40:10 UTC 2014

On Tuesday 11 November 2014 22:35:58 Charles Lepple did opine
And Gene did reply:
> On Nov 11, 2014, at 9:41 PM, Gene Heskett <gheskett at wdtv.com> wrote:
> > Can't claim USB device [050d:0751]: could not detach kernel driver
> > from interface 0: Operation not permitted
> > Driver failed to start (exit status=1)
> > 
> > In /dev/ttyUSB0 is owned by root. /dev/usb/hiddev3, the last one, has
> > a slow data marching out of it if I sudo cat /etc/dev/usb/hiddev3
> Hi Gene,
> I wish we had a good way to print a more specific error message (libusb
> doesn't return enough information to do so), but it's none of the
> above.
> The Linux box only has a serial UPS attached at the moment, but we'll
> pretend my mouse is the UPS:
> $ lsusb -d 046d:
> Bus 001 Device 008: ID 046d:c03d Logitech, Inc. M-BT96a Pilot Optical
> Mouse
> (In your case, you would run "lsusb -d 050d:0751")
> The "Bus 001 Device 008" part maps to names under /dev/bus/usb. In this
> case:

And I get:
gene at coyote:/usr/local/ups/etc$ lsusb -d 050d:0751
Bus 001 Device 002: ID 050d:0751 Belkin Components 
> $ ls -l /dev/bus/usb/001/008
> crw-rw-r-T 1 root root 189, 7 Nov  4 19:53 /dev/bus/usb/001/008

And I get:
gene at coyote:/usr/local/ups/etc$ ls -l /dev/bus/usb/001/002
crw-rw-r-- 1 root root 189, 1 2014-11-05 10:03 /dev/bus/usb/001/002
> This is the /dev node that needs to be owned by the NUT user.

That 050d:0751 identifier is in /lib/udev/rules.d/52-nut-usbups.rules, I 
changed the group from "nobody" to "nut" and issued a "sudo service udev 
restart", but the port is still owned by root:root.

> There is a udev rules file that, when installed to someplace like
> /etc/udev/rules.d, should change the permissions of the /dev/bus/usb
> file automatically. I can never keep track of what needs to be
> unplugged and/or restarted to get that to work, though. The FAQ
> suggests that unplugging and re-plugging the USB cable after
> installing the udev file should be sufficient, but older udev daemons
> might need to be restarted.

I'll try the cable unplug.  Thats better, dmesg reports:
[565202.435364] usb 1-10: new low-speed USB device number 3 using ohci-pci
[565202.717927] usb 1-10: New USB device found, idVendor=050d, 
[565202.717931] usb 1-10: New USB device strings: Mfr=4, Product=20, 
[565202.717934] usb 1-10: Product: Belkin UPS
[565202.717936] usb 1-10: Manufacturer: Belkin 
[565203.459524] hid-generic 0003:050D:0751.0008: hiddev0,hidraw6: USB HID 
v1.11 Device [Belkin  Belkin UPS] on usb-0000:00:02.0-10/input0

And gene at coyote:/etc/init.d$  /usr/local/ups/sbin/upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.2
Network UPS Tools - Generic HID driver 0.38 (2.7.2)
USB communication driver 0.32
Using subdriver: Belkin HID 0.16

No errors, although the last time I got this far, it started bonging the 
speakers at about 10 minute intervals.  So I will throttle the volume 
control for the night, and see how much further I can get in the morning.
But no noises or -walls issued, so I ran 
/usr/local/ups/bin/upsc myups at localhost

And got a full status report from it!  So at this point, once upsmon is 
configured, I should be off to the races.

Thank you Charles.

Cheers, Gene Heskett
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS

More information about the Nut-upsuser mailing list