Denis Hainsworth
2006-Sep-16 22:37 UTC
[Nut-upsuser] newhidups, udev, usb, and frustration
Hello, I hope someone can help me. I'm trying to get this all working without some stupid hack. So far no dice. Not sure if there is a new feature in CVS or something that might help. I'd appreciate any suggestions. Got a belkin F6C550-AVR. redhat FC3ish system libusb-0.1.8-3 nut-2.0.3-0.fc4.2 udev-039-10.FC3.8 Now first off while udev is nifty, but the whole usb udev subsystems were driving me crazy. add to that the fact that aparently my version of libusb doesnt pay attention to udev devices as well as the fact that for a while I had fc4 udev which installed fine on my system but apparently is broken in some way since I couldn't get any rules to apply. backrevving to fc3 udev and i am in a good place. if i plug the ups in i see it show up, udev follows my rules and updates the group and permissions for both /dev/hiddevX and /dev/usbdevX devices. I can also make udev create a symlink to usbdev if I wanted to. here's the part that has been driving me crazy. it seems like newhidups uses perhaps some library calls from libusb to discover usb devices?? it appears that it will only pay attention to /proc/bus/usb/XXX/YYY devices. since udev(or at least my version of it) doesnt do anything with these devices I can use udev rules to fix the persmissions and newhidups will only work if I run it as root. there are several things that could fix my situation and i was hoping someone would know if any exist. o can you tell nut through a conf file to run as root? i believe the package i am using from fc4 uses user "nut". I'd like to stick with the package I have then run my own version. this is the worst way to make this work but it will work. o is there a version of libusb and/or nut that would let me specifiy a /dev device for newhidusb to look at instead of scanning what seems to be /proc/bus/usb/XXX ? i cant tell udev to create a symlink and so I dont need newhidusb to scan for devices but nothing I seem to do appears to make it look at /dev/hiddev0 etc. this is my preferred way to make this work since i will be using standard udev configs and simply pointing nut at the devices i create. all very straight forward. Like I said at the beginning I have a somewhat monsterous distro that I upgrade as I need things. for example I only got udev working so I could use nut. udev seems to be completly functional now and now I discover newhidups doesn't even seem to use its devices. hopefully i am missing something simple, but i have combed the web for several days and experiemented for hours without being able to get it working how I would like. so I hope someone can help. thanks -denis -- ____________________________________________________________ Denis Alan Hainsworth | http://www.cs.brandeis.edu/~denis/ denis@alumni.brandeis.edu | "Life is just one big sad christmas."
Hi Denis, the /dev/hiddevX devices are used by kernel drivers and are mostly useful for things like mice and keyboards; libusb (and therefore newhidups) does not use them. As you have already found out, it only looks at /proc/bus/usb/XXX/YYY. There are two separate issues. One is, can you get the driver to work running as root? I.e., run upsdrvctl and upsd with "-u root". If this works, then the second issue is permissions. (If it doesn't, try the latest nut version from SVN; newhidups is being actively developed, and 2.0.3 is a relatively old version). The mechanism for automatically setting permissions of the /proc/bus/usb/XXX/YYY devices is "hotplugging"; see scripts/hotplug or scripts/hotplug-ng in the nut distribution. I have used this under Fedora Core 4, and it seems to work reasonably well. -- Peter Denis Hainsworth wrote:> > Hello, > I hope someone can help me. I'm trying to get this all working without > some stupid hack. So far no dice. Not sure if there is a new feature > in CVS or something that might help. I'd appreciate any suggestions. > > Got a belkin F6C550-AVR. > redhat FC3ish system > libusb-0.1.8-3 > nut-2.0.3-0.fc4.2 > udev-039-10.FC3.8 > > Now first off while udev is nifty, but the whole usb udev subsystems > were driving me crazy. add to that the fact that aparently my version > of libusb doesnt pay attention to udev devices as well as the fact that > for a while I had fc4 udev which installed fine on my system but > apparently is broken in some way since I couldn't get any rules to > apply. backrevving to fc3 udev and i am in a good place. if i plug the > ups in i see it show up, udev follows my rules and updates the group and > permissions for both /dev/hiddevX and /dev/usbdevX devices. I can also > make udev create a symlink to usbdev if I wanted to. here's the part > that has been driving me crazy. it seems like newhidups uses perhaps > some library calls from libusb to discover usb devices?? it appears > that it will only pay attention to /proc/bus/usb/XXX/YYY devices. since > udev(or at least my version of it) doesnt do anything with these devices > I can use udev rules to fix the persmissions and newhidups will only > work if I run it as root. there are several things that could fix my > situation and i was hoping someone would know if any exist. > > o can you tell nut through a conf file to run as root? i believe the > package i am using from fc4 uses user "nut". I'd like to stick with the > package I have then run my own version. this is the worst way to make > this work but it will work. > > o is there a version of libusb and/or nut that would let me specifiy a > /dev device for newhidusb to look at instead of scanning what seems to > be /proc/bus/usb/XXX ? i cant tell udev to create a symlink and so I > dont need newhidusb to scan for devices but nothing I seem to do appears > to make it look at /dev/hiddev0 etc. this is my preferred way to make > this work since i will be using standard udev configs and simply > pointing nut at the devices i create. all very straight forward. > > Like I said at the beginning I have a somewhat monsterous distro that I > upgrade as I need things. for example I only got udev working so I > could use nut. udev seems to be completly functional now and now I > discover newhidups doesn't even seem to use its devices. > > hopefully i am missing something simple, but i have combed the web for > several days and experiemented for hours without being able to get it > working how I would like. so I hope someone can help. > > thanks > -denis > > > > -- > ____________________________________________________________ > Denis Alan Hainsworth | http://www.cs.brandeis.edu/~denis/ > denis@alumni.brandeis.edu | "Life is just one big sad christmas." > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser@lists.alioth.debian.org > http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser >
Peter Selinger
2006-Sep-17 14:55 UTC
[Nut-upsuser] newhidups usb interface claiming warning
Denis Hainsworth wrote:> > > usb 1-1: usbfs: process 32652 (newhidups) did not claim interface 0 > > before use > > so I found two places where supposedly you guys have added code to > address the above issue I am having.Maybe you can tell us what two places you are talking about? -- Peter> As far as I can tell I have a > driver that is newer and should have the fixes. what am I missing? > this is the nut pkg from fc4 updates. > > nut-2.0.3-0.fc4.2 > > [23] christmas /home/denis% newhidups -V > Network UPS Tools: New USB/HID UPS driver 0.28 (2.0.3) > > ideas? > -denis >
Denis Hainsworth
2006-Sep-17 15:04 UTC
[Nut-upsuser] newhidups usb interface claiming warning
On Sun, Sep 17, 2006 at 11:54:32AM -0300, Peter Selinger wrote:> Denis Hainsworth wrote: > > > > > usb 1-1: usbfs: process 32652 (newhidups) did not claim interface 0 > > > before use > > > > so I found two places where supposedly you guys have added code to > > address the above issue I am having. > > Maybe you can tell us what two places you are talking about? -- Petersorry for being vague. I meant I saw at least two entries in the newhidups CHANGES file where in 2.0.3preX you guys addressed claim() issues. since I had 2.0.3 I was confused by why i would still be getting the mesage. obviously its a complex interaction of your driver, kernel stuff and aparently somthing from the util-linux package. -denis
Peter Selinger
2006-Sep-17 16:19 UTC
[Nut-upsuser] newhidups usb interface claiming warning
Denis Hainsworth wrote:> > On Sun, Sep 17, 2006 at 11:54:32AM -0300, Peter Selinger wrote: > > Denis Hainsworth wrote: > > > > > > > usb 1-1: usbfs: process 32652 (newhidups) did not claim interface 0 > > > > before use > > > > > > so I found two places where supposedly you guys have added code to > > > address the above issue I am having. > > > > Maybe you can tell us what two places you are talking about? -- Peter > > sorry for being vague. I meant I saw at least two entries in the > newhidups CHANGES file where in 2.0.3preX you guys addressed claim() > issues. since I had 2.0.3 I was confused by why i would still be > getting the mesage. obviously its a complex interaction of your driver, > kernel stuff and aparently somthing from the util-linux package.I see what change you are refering to (Jul 22, 2005, SVN revision 87). That change only affected what happens when reconnecting to a device after it has been disconnected. It does not fix the "bug" you experienced. Anyway, this is only of historical interest, because whatever caused those messages, does not seem to be present in the newest version of everything (usbdev, libusb, nut). -- Peter