[Nut-upsuser] Installing and running NUT on OpenBSD
Ben Short
ben at benshort.co.uk
Mon Feb 10 15:11:53 GMT 2025
Hi,
I've just found the following in /usr/local/share/doc/pkg-readmes/nut
Special notice for APC USB devices
----------------------------------
Some APC USB devices are reported to only work with NUT if the device is
attached to ugen(4). Normally these devices attach to upd(4) to provide
system power sensors (see "sysctl hw.sensors"). If you are having problems
using such a device with NUT, you may need to prevent this attachment.
The option with fewest side-effects is to add the following entries to
the table in /sys/dev/usb/usb_quirks.c and build a new kernel:
{ USB_VENDOR_APC, USB_PRODUCT_APC_UPS, ANY, { UQ_BAD_HID }},
{ USB_VENDOR_APC, USB_PRODUCT_APC_UPS5G, ANY, { UQ_BAD_HID }},
Alternatively, if you do not use a USB keyboard/mouse, you could simply
disable the upd and uhidev drivers. The following line creates a new kernel
with the relevant changes:
printf 'disable uhidev\ndisable upd\nquit\n' | config -e -o
/bsd.no-uhid /bsd
So I'll have to investigate that.
Ben
On 10/02/2025 15:01, Jim Klimov wrote:
> Hello, sorry and puzzled to hear about that.
>
> My guess would be permissions - while nut-scanner remains `root` (if
> started as one) and sees everything, drivers default to dropping
> privileges and may not see the devfs nodes (not sure OTOH which paths
> are involved on OpenBSD). One experimental workaround can be adding
> `user=root` to `ups.conf` entry for the device. But properly - tame
> whichever subsystem is responsible for that (devd?) to let the packaged
> run-time user see the device node.
>
> Also to cobfirm tge hypothesis, you can run the driver start attempt
> with higher debug verbosity, e.g.
>
> :; upsdrvctl -DDDDDD -d start
>
> On Mon, Feb 10, 2025, 15:55 Ben Short <ben at benshort.co.uk
> <mailto:ben at benshort.co.uk>> wrote:
>
> Hi,
>
> I'm trying to get NUT running.
>
> I've installed it with pkg_add nut
>
> I can see my UPS as follows:
>
> # nut-scanner
> Cannot load SNMP library (libnetsnmp.so) : file not found. SNMP search
> disabled.
> Cannot load XML library (libneon.so) : file not found. XML search
> disabled.
> Cannot load AVAHI library (libavahi-client.so) : file not found. AVAHI
> search disabled.
> Scanning USB bus.
> No start IP, skipping NUT bus (old connect method)
> Scanning NUT simulation devices.
> [nutdev-usb1]
> driver = "usbhid-ups" # alternately: apc_modbus
> port = "auto"
> vendorid = "051D"
> productid = "0003"
> product = "Smart-UPS X 2200 FW:UPS 07.4 / ID=01003"
> serial = "AS2039254737"
> vendor = "American Power Conversion"
> # bus = "000"
> # device = "005"
> # busport = "004"
>
> I've added the details to /etc/nut/ups.conf
>
> But get the following error:
>
> # upsdrvctl start
> Network UPS Tools - UPS driver controller 2.8.2
> Network UPS Tools - Generic HID driver 0.53 (2.8.2)
> USB communication driver (libusb 1.0) 0.47
> libusb1: Could not open any HID devices: no USB buses found
> No matching HID UPS found
> upsnotify: failed to notify about state 4: no notification tech
> defined,
> will not spam more about it
> Driver failed to start (exit status=1)
>
> Any ideas?
>
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at alioth-lists.debian.net <mailto:Nut-upsuser at alioth-
> lists.debian.net>
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
> <https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser>
>
More information about the Nut-upsuser
mailing list