Struggling to get NUT to talk to my UPS

nut-scanner can see my UPS which is connected via a USB cable.
Code:
# nut-scanner  
Scanning USB bus.
No start IP, skipping SNMP
Scanning XML/HTTP bus.
No start IP, skipping NUT bus (old connect method)
Scanning NUT simulation devices.
Scanning NUT bus (avahi method).
Failed to create Avahi client: Daemon not running
[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 = "013"
But when I try to query it I get the following error:
Code:
# /usr/local/libexec/nut/usbhid-ups -a nutdev-usb1 -D
Network UPS Tools - Generic HID driver 0.53 (2.8.2)
USB communication driver (libusb 1.0) 0.47
   0.000001     [D1] upsdrv_makevartable...
   0.000122     [D1] Using USB implementation: libusb-1.0.0 (API: 0x1000102)
   0.000888     [D1] Network UPS Tools version 2.8.2 (release/snapshot of 2.8.2) built with FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67); Target: x86_64-unknown-freebsd13.4; 
Thread model: posix and configured with flags: --sysconfdir=/usr/local/etc/nut --program-transform-name= --localstatedir=/var/db/nut --datadir=/usr/local/etc/nut --with-devd-dir=/usr/local/etc/devd --with-drvpath=/usr/local/libexec/
nut --with-statepath=/var/db/nut --with-altpidpath=/var/db/nut --with-pidpath=/var/db/nut --with-pkgconfig-dir=/usr/local/libdata/pkgconfig --with-user=nut --with-group=nut --with-python=/usr/local/bin/python3.11 --without-python2 -
-with-python3=/usr/local/bin/python3.11 --without-nut_monitor --with-ltdl --with-nut-scanner --with-avahi --with-cgi --with-cgipath=/usr/local/www/cgi-bin/nut --with-htmlpath=/usr/local/www/nut --with-gd-includes=-I/usr/local/includ
e --with-gd-libs='-L/usr/local/lib -lgd' --without-dev --with-freeipmi --without-ipmi --with-doc=man=auto --with-modbus --with-neon --without-nss --with-openssl --with-powerman --with-serial --with-snmp --with-usb=auto --prefix=/usr
/local --mandir=/usr/local/share/man --disable-silent-rules --infodir=/usr/local/share/info/ --build=amd64-portbld-freebsd13.4
   0.000913     [D1] debug level is '1'
   0.001499     [D1] Succeeded to become_user(nut): now UID=316 GID=316
   0.001555     [D1] upsdrv_initups (non-SHUT)...
   0.002239     libusb1: Could not open any HID devices: no USB buses found
   0.002249     No matching HID UPS found
   0.002271     upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it

Seems like its a permissions issue but I'm not sure how to rectify that.
 
I've altered the permissions on the usb port:

Code:
# ls -la /dev/usb*
crw-r--r--  1 root  operator  0x66 Feb  8 16:18 /dev/usbctl

/dev/usb:
total 1
dr-xr-xr-x   2 root  wheel      512 Feb  8 16:18 .
dr-xr-xr-x  11 root  wheel      512 Feb  8 16:18 ..
crw-------   1 root  operator  0x3d Feb  8 16:18 0.1.0
crw-------   1 root  operator  0x68 Feb  8 16:18 0.1.1
crw-------   1 root  operator  0xac Feb  8 16:18 0.2.0
crw-------   1 root  operator  0xae Feb  8 16:18 0.2.1
crw-------   1 root  operator  0xaf Feb  8 16:18 0.3.0
crw-------   1 root  operator  0xb1 Feb  8 16:18 0.3.1
crw-------   1 root  operator  0xb2 Feb  8 16:18 0.4.0
crw-------   1 root  operator  0xb4 Feb  8 16:18 0.4.1
crw-rw----   1 root  nut       0xab Feb 10 15:39 0.5.0
crw-------   1 root  operator  0xb6 Feb 10 15:39 0.5.1

Which gives me a different error:

Code:
# /usr/local/libexec/nut/usbhid-ups -a nutdev-usb1 -D
Network UPS Tools - Generic HID driver 0.53 (2.8.2)
USB communication driver (libusb 1.0) 0.47
   0.000001     [D1] upsdrv_makevartable...
   0.000118     [D1] Using USB implementation: libusb-1.0.0 (API: 0x1000102)
   0.000874     [D1] Network UPS Tools version 2.8.2 (release/snapshot of 2.8.2) built with FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67); Target: x86_64-unknown-freebsd13.4; 
Thread model: posix and configured with flags: --sysconfdir=/usr/local/etc/nut --program-transform-name= --localstatedir=/var/db/nut --datadir=/usr/local/etc/nut --with-devd-dir=/usr/local/etc/devd --with-drvpath=/usr/local/libexec/
nut --with-statepath=/var/db/nut --with-altpidpath=/var/db/nut --with-pidpath=/var/db/nut --with-pkgconfig-dir=/usr/local/libdata/pkgconfig --with-user=nut --with-group=nut --with-python=/usr/local/bin/python3.11 --without-python2 -
-with-python3=/usr/local/bin/python3.11 --without-nut_monitor --with-ltdl --with-nut-scanner --with-avahi --with-cgi --with-cgipath=/usr/local/www/cgi-bin/nut --with-htmlpath=/usr/local/www/nut --with-gd-includes=-I/usr/local/includ
e --with-gd-libs='-L/usr/local/lib -lgd' --without-dev --with-freeipmi --without-ipmi --with-doc=man=auto --with-modbus --with-neon --without-nss --with-openssl --with-powerman --with-serial --with-snmp --with-usb=auto --prefix=/usr
/local --mandir=/usr/local/share/man --disable-silent-rules --infodir=/usr/local/share/info/ --build=amd64-portbld-freebsd13.4
   0.000899     [D1] debug level is '1'
   0.001489     [D1] Succeeded to become_user(nut): now UID=316 GID=316
   0.001547     [D1] upsdrv_initups (non-SHUT)...
   0.005495     interrupt pipe disabled (add 'pollonly' flag to 'ups.conf' to get rid of this message)
   0.005761     [D1] failed to detach kernel driver from USB device: Other error
   0.005775     [D1] failed to detach kernel driver from USB device: Other error
   0.005783     [D1] failed to detach kernel driver from USB device: Other error
   0.005791     [D1] failed to detach kernel driver from USB device: Other error
   0.005803     Can't claim USB device [051d:0003]@0/0/0: Other error
   0.005826     upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it
 
After rebooting it seems to work...

Code:
 # /usr/local/libexec/nut/usbhid-ups -a nutdev-usb1 -D 
Network UPS Tools - Generic HID driver 0.53 (2.8.2) 
USB communication driver (libusb 1.0) 0.47 
   0.000000     [D1] upsdrv_makevartable... 
   0.000114     [D1] Using USB implementation: libusb-1.0.0 (API: 0x1000102) 
   0.000884     [D1] Network UPS Tools version 2.8.2 (release/snapshot of 2.8.2) built with FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67); Target: x86_64-unknown-freebsd13.4; Thread model: posix and configured with flags: --sysconfdir=/
usr/local/etc/nut --program-transform-name= --localstatedir=/var/db/nut --datadir=/usr/local/etc/nut --with-devd-dir=/usr/local/etc/devd --with-drvpath=/usr/local/libexec/nut --with-statepath=/var/db/nut --with-altpidpath=/var/db/nut --with-pidpath=/var/db/nut --with-pkgconfig-dir=/usr/local/
libdata/pkgconfig --with-user=nut --with-group=nut --with-python=/usr/local/bin/python3.11 --without-python2 --with-python3=/usr/local/bin/python3.11 --without-nut_monitor --with-ltdl --with-nut-scanner --with-avahi --with-cgi --with-cgipath=/usr/local/www/cgi-bin/nut --with-htmlpath=/usr/loc
al/www/nut --with-gd-includes=-I/usr/local/include --with-gd-libs='-L/usr/local/lib -lgd' --without-dev --with-freeipmi --without-ipmi --with-doc=man=auto --with-modbus --with-neon --without-nss --with-openssl --with-powerman --with-serial --with-snmp --with-usb=auto --prefix=/usr/local --man
dir=/usr/local/share/man --disable-silent-rules --infodir=/usr/local/share/info/ --build=amd64-portbld-freebsd13.4 
   0.000910     [D1] debug level is '1' 
   0.001459     [D1] Succeeded to become_user(nut): now UID=316 GID=316 
   0.001511     [D1] upsdrv_initups (non-SHUT)... 
   0.005129     interrupt pipe disabled (add 'pollonly' flag to 'ups.conf' to get rid of this message) 
   0.006983     Using subdriver: APC HID 0.100 
   0.006997     [D1] 60 HID objects found 
   0.007201     [D1] Path: UPS.PowerSummary.iProduct, Type: Feature, ReportID: 0x01, Offset: 0, Size: 8, Value: 2 
   0.007441     [D1] Path: UPS.PowerSummary.iSerialNumber, Type: Feature, ReportID: 0x02, Offset: 0, Size: 8, Value: 3 
   0.007689     [D1] Path: UPS.PowerSummary.iManufacturer, Type: Feature, ReportID: 0x03, Offset: 0, Size: 8, Value: 1 
   0.007939     [D1] Path: UPS.PowerSummary.iOEMInformation, Type: Feature, ReportID: 0x04, Offset: 0, Size: 8, Value: 1 
   0.008190     [D1] Path: UPS.PowerSummary.iDeviceChemistry, Type: Feature, ReportID: 0x05, Offset: 0, Size: 8, Value: 4 
   0.008437     [D1] Path: UPS.PowerSummary.Rechargeable, Type: Feature, ReportID: 0x06, Offset: 0, Size: 8, Value: 1 
   0.008450     [D1] Path: UPS.PowerSummary.CapacityMode, Type: Feature, ReportID: 0x06, Offset: 8, Size: 8, Value: 2 
   0.008688     [D1] Path: UPS.PowerSummary.DesignCapacity, Type: Feature, ReportID: 0x0e, Offset: 0, Size: 8, Value: 100 
   0.008701     [D1] Path: UPS.PowerSummary.FullChargeCapacity, Type: Feature, ReportID: 0x0e, Offset: 8, Size: 8, Value: 100 
   0.008938     [D1] Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID: 0x0c, Offset: 0, Size: 8, Value: 100 
   0.008950     [D1] Path: UPS.PowerSummary.RemainingCapacity, Type: Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 100 
   0.009188     [D1] Path: UPS.PowerSummary.CapacityGranularity1, Type: Feature, ReportID: 0x10, Offset: 0, Size: 8, Value: 1 
   0.009200     [D1] Path: UPS.PowerSummary.CapacityGranularity2, Type: Feature, ReportID: 0x10, Offset: 8, Size: 8, Value: 1 
   0.009438     [D1] Path: UPS.PowerSummary.WarningCapacityLimit, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 8, Value: 50 
   0.009688     [D1] Path: UPS.PowerSummary.RemainingCapacityLimit, Type: Feature, ReportID: 0x11, Offset: 0, Size: 8, Value: 10 
   0.009939     [D1] Path: UPS.PowerSummary.ManufacturerDate, Type: Feature, ReportID: 0x09, Offset: 0, Size: 16, Value: 20795 
   0.010189     [D1] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x0d, Offset: 0, Size: 16, Value: 5532 
   0.010202     [D1] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, ReportID: 0x0d, Offset: 0, Size: 16, Value: 5532 
   0.010437     [D1] Path: UPS.PowerSummary.DelayBeforeShutdown, Type: Feature, ReportID: 0x12, Offset: 0, Size: 16, Value: -1 
   0.010688     [D1] Path: UPS.PowerSummary.DelayBeforeReboot, Type: Feature, ReportID: 0x13, Offset: 0, Size: 24, Value: -1 
   0.010939     [D1] Path: UPS.PowerSummary.RemainingTimeLimit, Type: Input, ReportID: 0x08, Offset: 0, Size: 24, Value: 120 
   0.010952     [D1] Path: UPS.PowerSummary.RemainingTimeLimit, Type: Feature, ReportID: 0x08, Offset: 0, Size: 24, Value: 120 
   0.011189     [D1] Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x0a, Offset: 0, Size: 16, Value: 120 
   0.011439     [D1] Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x0b, Offset: 0, Size: 16, Value: 132.3 
   0.011688     [D1] Path: UPS.PowerSummary.AudibleAlarmControl, Type: Input, ReportID: 0x14, Offset: 0, Size: 8, Value: 2 
   0.011701     [D1] Path: UPS.PowerSummary.AudibleAlarmControl, Type: Feature, ReportID: 0x14, Offset: 0, Size: 8, Value: 2 
   0.011940     [D1] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Input, ReportID: 0x07, Offset: 0, Size: 1, Value: 0 
   0.011953     [D1] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x07, Offset: 0, Size: 1, Value: 0 
   0.011963     [D1] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Input, ReportID: 0x07, Offset: 1, Size: 1, Value: 0 
   0.011973     [D1] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x07, Offset: 1, Size: 1, Value: 0 
   0.011983     [D1] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x07, Offset: 2, Size: 1, Value: 1 
   0.011992     [D1] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x07, Offset: 2, Size: 1, Value: 1 
   0.012003     [D1] Path: UPS.PowerSummary.PresentStatus.BatteryPresent, Type: Input, ReportID: 0x07, Offset: 3, Size: 1, Value: 1 
   0.012013     [D1] Path: UPS.PowerSummary.PresentStatus.BatteryPresent, Type: Feature, ReportID: 0x07, Offset: 3, Size: 1, Value: 1 
   0.012023     [D1] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Input, ReportID: 0x07, Offset: 4, Size: 1, Value: 0 
   0.012034     [D1] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x07, Offset: 4, Size: 1, Value: 0 
   0.012043     [D1] Path: UPS.PowerSummary.PresentStatus.ShutdownRequested, Type: Input, ReportID: 0x07, Offset: 5, Size: 1, Value: 0 
   0.012053     [D1] Path: UPS.PowerSummary.PresentStatus.ShutdownRequested, Type: Feature, ReportID: 0x07, Offset: 5, Size: 1, Value: 0 
   0.012063     [D1] Path: UPS.PowerSummary.PresentStatus.ShutdownImminent, Type: Input, ReportID: 0x07, Offset: 6, Size: 1, Value: 0 
   0.012072     [D1] Path: UPS.PowerSummary.PresentStatus.ShutdownImminent, Type: Feature, ReportID: 0x07, Offset: 6, Size: 1, Value: 0 
   0.012081     [D1] Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Input, ReportID: 0x07, Offset: 7, Size: 1, Value: 0 
   0.012091     [D1] Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Feature, ReportID: 0x07, Offset: 7, Size: 1, Value: 0 
   0.012100     [D1] Path: UPS.PowerSummary.PresentStatus.CommunicationLost, Type: Input, ReportID: 0x07, Offset: 8, Size: 1, Value: 0 
   0.012109     [D1] Path: UPS.PowerSummary.PresentStatus.CommunicationLost, Type: Feature, ReportID: 0x07, Offset: 8, Size: 1, Value: 0 
   0.012119     [D1] Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Input, ReportID: 0x07, Offset: 9, Size: 1, Value: 0 
   0.012128     [D1] Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Feature, ReportID: 0x07, Offset: 9, Size: 1, Value: 0 
   0.012137     [D1] Path: UPS.PowerSummary.PresentStatus.Overload, Type: Input, ReportID: 0x07, Offset: 10, Size: 1, Value: 0 
   0.012146     [D1] Path: UPS.PowerSummary.PresentStatus.Overload, Type: Feature, ReportID: 0x07, Offset: 10, Size: 1, Value: 0 
   0.012174     [D1] Path: UPS.PowerSummary.PresentStatus.VoltageNotRegulated, Type: Input, ReportID: 0x07, Offset: 11, Size: 1, Value: 0 
   0.012183     [D1] Path: UPS.PowerSummary.PresentStatus.VoltageNotRegulated, Type: Feature, ReportID: 0x07, Offset: 11, Size: 1, Value: 0 
   0.012195     [D1] Path: UPS.PowerSummary.PresentStatus.ff860080, Type: Input, ReportID: 0x07, Offset: 12, Size: 1, Value: 0 
   0.012205     [D1] Path: UPS.PowerSummary.PresentStatus.ff860080, Type: Feature, ReportID: 0x07, Offset: 12, Size: 1, Value: 0 
   0.012768     nut_libusb_get_report: No device 
   0.012817     [D1] Can't retrieve Report 89: Interrupted system call 
   0.012830     [D1] Path: UPS.ff8600fd, Type: Input, ReportID: 0x89, Offset: 0, Size: 8 
   0.013392     nut_libusb_get_report: No device 
   0.013403     [D1] Can't retrieve Report 90: Interrupted system call 
   0.013411     [D1] Path: UPS.ff8600fc, Type: Output, ReportID: 0x90, Offset: 0, Size: 8 
   0.013647     [D1] Path: UPS.ff8600f1, Type: Feature, ReportID: 0x96, Offset: 0, Size: 8, Value: 0 
   0.013898     [D1] Path: UPS.ff8600f7, Type: Feature, ReportID: 0x8d, Offset: 0, Size: 8, Value: 0 
   0.014146     [D1] Path: UPS.ff8600f6, Type: Feature, ReportID: 0x8e, Offset: 0, Size: 8, Value: 0 
   0.014397     [D1] Path: UPS.ff8600f3, Type: Feature, ReportID: 0x93, Offset: 0, Size: 8, Value: 129 
   0.014646     [D1] Path: UPS.ff8600f2, Type: Feature, ReportID: 0x94, Offset: 0, Size: 8, Value: 193 
   0.014896     [D1] Path: UPS.ff8600f4, Type: Feature, ReportID: 0x92, Offset: 0, Size: 8, Value: 3 
   0.014940     [D1] Detected a UPS: American Power Conversion /Smart-UPS X 2200 FW:UPS 07.4 / ID=01003 
   0.017319     [D1] upsdrv_initinfo... 
   0.017345     [D1] upsdrv_updateinfo... 
   0.017351     [D1] Not using interrupt pipe... 
   0.017358     [D1] Quick update... 
   0.017642     Running as foreground process, not saving a PID file 
   0.017674     [D1] Driver initialization completed, beginning regular infinite loop 
   0.017682     upsnotify: failed to notify about state 2: no notification tech defined, will not spam more about it 
   0.017692     [D1] upsdrv_updateinfo... 
   0.017698     [D1] Not using interrupt pipe... 
   0.017704     [D1] Quick update... 
   2.086608     [D1] upsdrv_updateinfo... 
   2.086642     [D1] Not using interrupt pipe... 
   2.086655     [D1] Quick update... 
   4.184275     [D1] upsdrv_updateinfo... 
   4.184308     [D1] Not using interrupt pipe... 
   4.184319     [D1] Quick update... 
   6.294839     [D1] upsdrv_updateinfo... 
   6.294871     [D1] Not using interrupt pipe... 
   6.294882     [D1] Quick update...
 
Hmm maybe not working

Code:
 # upsd -F 
Network UPS Tools upsd 2.8.2 
fopen /var/db/nut/upsd.pid: No such file or directory 
Could not find PID file '/var/db/nut/upsd.pid' to see if previous upsd instance is already running! 
/usr/local/etc/nut/upsd.conf is world readable 
listening on ::1 port 3493 
listening on 127.0.0.1 port 3493 
Can't connect to UPS [nutdev-usb1] (usbhid-ups-nutdev-usb1): No such file or directory 
Found 1 UPS defined in ups.conf 
/usr/local/etc/nut/upsd.users is world readable 
Running as foreground process, not saving a PID file 
upsnotify: failed to notify about state 2: no notification tech defined, will not spam more about it
 
Back
Top