[Nut-upsuser] libusb not recognized?

Charles Lepple clepple at gmail.com
Wed Nov 16 13:01:51 UTC 2011

On Nov 16, 2011, at 3:55 AM, Andrew Min Chang wrote:

> Hi, Charles,
> libusb-0.1.12 did not work, too.
> Do you mean the testlibusb.c as attached? I compiled it by:
> # cc -c testlibusb.c
> # cc -o test testlibusb.o -lusb
> Because there's gcc on my target board. 
> but ./test prints nothing. I looked into the source and fount that "usb_busses" is zero.
> I had a usb hardisk and a APC smart-ups connected to my board through usb. The hardisk was recognized and automatically mounted to system. While smart-ups was not recognized by Linux, but Linux knew that that was a usb device. 
> I am not familar with usb drive. But I guess if libusb is correctly installed, testlibusb should list all usb device. So libusb was not correctly installed. However, gcc recognized the usb.h provided by libusb. That seemed strange to me.

Yes, that's the one. Two issues:

1) If testlibusb does not print anything when you run it, then NUT probably won't see any USB devices, either. Does your board have /dev/bus/usb or a similar usbdevfs mounted?

2) Since testlibusb.c runs, you should be able to re-run the NUT configure script, and it should detect libusb-0.1.12. I am not sure if libusb-compat will get in the way, though.

More information about the Nut-upsuser mailing list