-
-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to configure Nut with native macOS Sequoia UPS integration running #2827
Comments
Can you be more specific about how you are trying this? Are you using the macosx-ups driver, or trying to use one of the libusb-based ones? Did you build from source, or are you using something like Homebrew or MacPorts? A "connection refused" from |
Yes I have the macosx-ups driver running for the main ups integration into macOS I believe. I installed using homebrew and edited the corresponding files and started nut, which looked to successfully start. I'll post my files a bit later after work but followed a pretty straightforward install guide which seemed very comprehensive. |
Ahhh...I am not using the macosx-ups driver in nut, I'm using the USBHID driver default for an APC UPS, is it as simple as changing the config for NLUT to use this driver in place of the APC one? |
following this guide, loosely: https://www.youtube.com/watch?v=vyBP7wpN72c The ups.conf file contains now with your suggestion: [apc-network] I get the error code in the terminal of % upsc apc-network@localhost |
@EagleDTW : just to recap, I think Tim's guide also mentions that: NUT has a 3-layer architecture with NUT driver program(s) talking to devices with a vendor's protocol over some media on one side and to a NUT data server ( You can check NUT-related running processes with something like:
Note that the MacOS
The As for the NUT driver itself, you can start it in command line, with raised debug verbosity, to check how it sees the device:
NOTES:
NOTE: With your configuration as posted above, I think the service would also fail to start because |
Yes, as Jim mentioned, there are slightly different options for different drivers, and https://networkupstools.org/docs/man/macosx-ups.html shows that you can only specify
(You're using them correctly, but the reference for Due to difficulties in talking directly to USB devices, I can't personally recommend any of the USB drivers on macOS. |
Also, full disclosure, UPS hardware usually fails before the power fails here, so I have not done much testing with
Like USB drivers on macOS, you might need at least one |
Grep returned this: So looks like there is a cuspd isntance and the built in ups integration working Did your command above and got this output, at first said that vendorID was not allowed and dumped out, commented out deviceID, vendorID and Serial # and then got the below debug out of the driver command: 0.000001 [D1] testval_reloadable: setting 'pollinterval' exists and differs: new value '1' vs. '2' |
Used the straight command on the old driver and got this long printout: |
Thanks for the tests and info. Note the Looking at the logs, we now know that:
So the problem now is getting the chosen driver, The https://formulae.brew.sh/formula/nut page refers to "formula code" https://github.com/Homebrew/homebrew-core/blob/c86ae9295b67b242e73ba84d4608fb1413542a88/Formula/n/nut.rb (with
I can only guess this is the definition they provide (so just the monitoring client, nothing for driver(s) and data server), allowing out of the box to watch a remote NUT data server (e.g. running on a NAS appliance) but not a locally connected UPS (notably, the It seems you are on your own to define the driver and upsd services. Maybe a decent option is to clone the formula locally, add a
Hoping to find ready answers, I googled up the https://community.home-assistant.io/t/managing-an-apc-ups-with-nut-on-the-host-machine-without-passthrough-to-vm/767027/6 discussion, but you are apparently part of it :)
|
That makes sense...I'm using my normal user for my account with auto login methods - I wonder how it's pulling that user = nobody...that's probably at the heart of the issue (as I have seen files/programs for upsd and upsdrvctl) I will try setting the User set to root in the config file, can I also just use this setting to set the user as my login user as well to gain permissions to the running process? So like user = daniel... in the ups.conf file will work potentially, right then permissions may be set correctly? |
The Maybe consistently running as a Otherwise, NUT daemons have ways of overriding the built-in default user/group via CLI or config files. |
Could this be a permissions error like this thread? Also what would be my strategy to enable the default nut account to run this: |
Trying to check if the service is running and getting that the nut service is turned off, which now makes sense that the connection is refused |
Hi @jimklimov and @clepple, What would be the best strategy to configure the nut service to run and confirm that the service is indeed running before trying to upsc to it...I have my configs in the upper threads, would you mind perusing them and seeing if anything needs to be changed to get the service up and running - I would like to try for the usbhid-ups driver as I do imagine controlling the UPS features downstream (rather than the macosX driver that just monitors). If I'm not even getting the service to launch and show an up status, what are my most likely troubleshooting steps to resolve the service issue - is it driver config or multiple instances of the drivers using the same hardware? TIA! |
Sorry, can't help much beyond those notes and referring to google. My experience with the platform is limited by a few hours of making a build agent from a VM I was given access to. :\ |
Thanks Jim! much appreciated for the help...do you know if I can say runas: then my username instead of root or does that put it into a weird state where permissions will cause it to fail instantly (kind of like what I'm currently seeing)? |
ran the original command, but with the other driver that's configured and got: sudo /opt/homebrew/Cellar/nut/2.8.2/bin/usbhid-ups -a apc-network -d 1 -D Network UPS Tools - Generic HID driver 0.53 (2.8.2) |
Yeah, me too. I was getting the "Can't claim USB device [051d:0002]@0/0/0: Access denied (insufficient permissions)", and "upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it" from a "upsdrvctl start". Also got both errors from a "usbhid-ups -a myups". And a "ps -ef|grep ups" shows the Mac's driver: "/usr/libexec/ioupsd". You had mentioned that it quickly restarts when killed, so any other ideas on what to do? Thanks. |
Hi,
Trying to configure Nut with native macOS Sequoia UPS integration running, when I run upsc it comes back with connection refused.
TIA - Daniel
The text was updated successfully, but these errors were encountered: