Charles Lepple
2022-Aug-11 02:01 UTC
[Nut-upsuser] NUT can't connect to USB UPS on OpenBSD
On Aug 10, 2022, at 9:15 PM, Marc-Andr? Harbec via Nut-upsuser wrote:> # These are all the USB devices on my machine > ? doas ls -l /dev/usb* > crw-r----- 1 root usb 61, 0 Jun 24 16:21 /dev/usb0 > crw-r----- 1 root usb 61, 1 Jun 24 16:21 /dev/usb1 > crw-r----- 1 root usb 61, 2 Jun 24 16:21 /dev/usb2 >I haven't done much initial configuration of USB devices on *BSD in a while, but I think you'll need a different device node for libusb. http://dant.net.ru/calomel/nut_ups.html implies that it is /dev/ugen* Does OpenBSD have an equivalent for FreeBSD's devd, to set permissions on a specific USB device node based on the USB IDs? We have some devd information here: https://github.com/networkupstools/nut/tree/master/scripts/devd https://github.com/networkupstools/nut/blob/master/tools/nut-usbinfo.pl#L181-L196 also implies that on FreeBSD, `chmod g+rw` is needed on the appropriate device node. If that fails, I'd recommend using ktrace to find out what is failing, such that you get the "no USB buses found" error.> _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
Charles Lepple via Nut-upsuser <nut-upsuser at alioth-lists.debian.net> writes:> If that fails, I'd recommend using ktrace to find out what is failing, > such that you get the "no USB buses found" error.Definitely. I would actually recommend ktrace first. Then just `kdump | egrep NAMI` will probably find the issue fast. I use nut on NetBSD, and have done "manual kludge udev" by knowing what serial port my UPS is going to be on and in rc.local chowning it to nut and linking it to /dev/tty.ups which is in the config. That's serial, not USB, but the same thing should work. And agreed on /dev/ugen; I have a USB printer on /dev/ugen1.01 I suspect that nut needs to read /dev/usbN (for the bus that the UPS is on) and read-write access to the ugen file for the HID endpoint, which might be ugen, or it might be /dev/uhid2 (assuming it's like NetBSD in this regard). -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 194 bytes Desc: not available URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20220811/7b8325fe/attachment.sig>