Solved Trying to get NUT to work...

FreeBSD 11.0 AMD64, NUT 2.7.4 from packages

I installed the package without any errors.

Config files are as follows:

nut.conf
Code:
MODE=standalone

ups.conf
Code:
[cpups]
        driver = "usbhid-ups"
        port = auto
        desc = "cp-ups"

upsd.conf
Code:
LISTEN 127.0.0.1 3493

upsd.users
Code:
[monmaster]
  password  = upsmasterpswd
  upsmon master

[monuser]
  password  = upsuserpswd
  upsmon slave

[admin]
  password = bigpswd
  actions = SET
  instcmds = ALL

upsmon.conf
Code:
MONITOR cpups@127.0.0.1  1 monmaster upsmasterpswd master


I set all the NUT config files in /usr/local/etc/nut to uucp:uucp.

When I try to start NUT, I see:
Code:
# service nut onestart
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
No matching HID UPS found
Driver failed to start (exit status=1)
/usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut



So I try just upsd:
Code:
# upsd -DD
Network UPS Tools upsd 2.7.4
   0.000000     fopen /var/db/nut/upsd.pid: No such file or directory
   0.000602     /usr/local/etc/nut/upsd.conf is world readable
   0.001108     listening on 127.0.0.1 port 3493
   0.001687     Can't connect to UPS [cpups] (usbhid-ups-cpups): No such file or directory


... and I am stumped.

What is the magical incantation that I need to recite in order to get NUT to run? :)
 
Thanks for the reply.

I added vendorid and productid to upsd.conf. I got the same result.

There was one change I did that yielded different results, though:

Before:
Code:
# upsdrvctl start cpups
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
No matching HID UPS found
Driver failed to start (exit status=1)


After:
Code:
# upsdrvctl -u root start cpups
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
Using subdriver: CyberPower HID 0.4


So it looks like there is a permission problem somewhere with the default NUT uucp userid. I've looked but have not seen anything that looks suspicious.

I'm still baffled... :(
 
I had a lot of problems with nut setup... and then in desperation I rebooted and my USB UPS became visible.

Before I did that, I found some advice to update /etc/devfs.rules to set permissions. Mine looks like this:

Code:
[nut_usb=10]
add path 'ugen0.3' group wheel user uucp mode 0770
add path 'usb/0.3.0' group wheel user uucp mode 0770

Note that your port identifiers will depend on which port you're using. And I am not sure this is required since I was shotgunning at the end.

Hmm, when I check my usb devices with usbconfig I see that my UPS isn't even on ugen0.3! Hilarious. I must have changed ports while troubleshooting.

Code:
ugen0.2: <CP1500PFCLCD CPS> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (2mA)

So, my advice would be to reboot first and cross your fingers. If that doesn't work investigate manually setting permissions on your USB ports. You should not have to use -u root args to get nut to run, mine is working with the default startup scripts in /usr/local/etc/rc.d.

You may find this thread helpful.

https://forums.freebsd.org/threads/35205/
 
Back
Top