Skip to content
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

Need Help with Windows NUT Server install #2598

Open
ScottReadTCF opened this issue Aug 20, 2024 · 14 comments
Open

Need Help with Windows NUT Server install #2598

ScottReadTCF opened this issue Aug 20, 2024 · 14 comments
Labels
impacts-release-2.7.3-or-older Issues reported against NUT release 2.7.3 or older, packaged or custom builds of code from that era question USB Windows

Comments

@ScottReadTCF
Copy link

ScottReadTCF commented Aug 20, 2024

Hi Everyone,

So the issue I have is when I install NUT-Installer-2.6.5-6.exe as admin I get the error message:-

NUT UPS driver installer.

Searching for known UPS...
No known UPS device found.
Try installing libUSB manually.
Hit enter to continue

I get the same error is I manually run wdi-simple.exe

The system is Windows 11 Pro with 23H2 and Intel(R) Core(TM) i7-10700KF CPU with 16.0 GB Memory (Mainboard is Gigabyte H410M H V2).

The UPS is a Riello Sentinel Dual 4kVA SDU 4000 and is connected via USB (this all works fine in the PowerShield software they suggest using). I've looked into this and tried to 'install' libUSB but this seems to be a a folder with "files" in it but no exe file to 'install' from looking at the NUT site it suggests that SDU 4000 is compatible using the [riello_usb] driver https://networkupstools.org/docs/man/riello_usb.html)

I'm not sure exactly what I need to do to get the NUT install to use the riello_usb and get the software to see the UPS.

Thank you so much if you can help and i'm sorry if this seems an obvious question.

@jimklimov jimklimov added question Windows USB impacts-release-2.7.3-or-older Issues reported against NUT release 2.7.3 or older, packaged or custom builds of code from that era labels Aug 20, 2024
@jimklimov
Copy link
Member

Hello, the 2.6.5 baseline is very old (Aug 2012, so ~12 years now), although unfortunately it is what the MSI installer was made from and now the community knowledge about that arcane magic got a bit lost. I am not certain which exact commits went into that package file, but riello_usb was only introduced shortly after NUT v2.6.5 "vanilla" release. The driver code is present and a few commits old in Windows-v2.6.5-6 tag (Mar 2014) though, at which point that side project fizzled out for a decade.

The NUT for Windows effort was revived a couple of years back, so there are builds of current codebase being built by Appveyor CI, with downloadable archives (no installer yet) as detailed at https://github.com/networkupstools/nut/wiki/NUT-for-Windows

You may still need a few tricks about getting libusb based drivers seen, as commented there.

With your existing installation, please see if a riello_ups.exe exists - maybe same tricks can help get it to run and see the device, even if the device detection tool in that build does not know of it...

@ScottReadTCF
Copy link
Author

ScottReadTCF commented Aug 20, 2024

Thanks for your help!

do you happen to know if there will be an installer soonish (before I try to force this to work?), I can survive for the short term if its "coming soon".

Also riello_ups.exe doesn't exist in the install.

@jimklimov
Copy link
Member

Unfortunately, probably not "soonish" -- needs some time from a determined developer to make it all come together on the platform, maybe with same or a different packaging technology. I had some interest about portable code base to get that it buildable and testable on the platform, and eventually merged, but struggled to find time for the finishing touches like the packager or certain known-missing equivalent code blocks.

@jimklimov
Copy link
Member

Also riello_ups.exe doesn't exist in the install.

Sorry, I fat-fingered - riello_usb.exe

@ScottReadTCF
Copy link
Author

Hmm, so not sure how I should proceed...

@jimklimov
Copy link
Member

Re-check if that driver is at all present in the old package you have; then we might try to somehow get it running and at least check if it sees your UPS.

Otherwise forgo the package and try to use the archived installation prepared by CI farm, per wiki.

@ScottReadTCF
Copy link
Author

I can confirm there is no file that starts with 'rie' in the 'NUT' folder structure, where is the archived installation located please? (sorry I feel like i'm missing something here)...

Thanks

@jimklimov
Copy link
Member

Per https://github.com/networkupstools/nut/wiki/NUT-for-Windows

Current NUT for Windows archives from CI are available at https://ci.appveyor.com/project/nut-travis/nut/build/artifacts - note this is a rolling URL for a "latest" build that may include PR checks; for a somewhat-stable codebase (PR merges to "master" branch) one needs to open the "History" tab (NOT "Current build") and find the newest AppVeyor build link from a green-ticked commit at https://github.com/networkupstools/nut/commits/master history. In AppVeyor Web UI, a master-branch build would have a small gray comment with only "master" branch name and a commit ID, without another branch name and commit as is done for pull request builds (they also have a gray title to that effect).

I've updated it with a screenshot to help navigate now.

@ScottReadTCF
Copy link
Author

ScottReadTCF commented Aug 22, 2024 via email

@jimklimov
Copy link
Member

At the moment that may be more flexible and functional :) But if you do try Windows builds - would be great to hear how it went in real life :)

@ScottReadTCF
Copy link
Author

I'd love to hear once the install is on a Microsoft install package :-)

@smith-48116
Copy link

I was able to install the NUT server on a Windows 7 machine successfully. I believe the instructions would be similar for Windows 10 with minor variations. I used the this build: NUT-for-Windows-x86_64-SNAPSHOT-2.8.2.2096-master.

In order to run the server I had to learn about libusb-win32 driver and all that comes with the installation using zadig-2.9.exe. In the end the driver from CyperPower (CP1500PFCLCD) was replaced with the libusb-win32 driver.

It was a painful learning curve to figure out how to hijack the existing UPS USB Driver using libusb-win32. Before installing NUT, I have never heard of libusb-win32 or the zadig-2.9.exe that is used replace the driver from CyperPower (CP1500PFCLCD) with the libusb-win32 driver.

DM libusb-win32

The only remaining mystery that I cannot figure out is whether upsdrvctl is supposed to self-terminate after it has started the usbhid-ups.exe process or whether it is supposed to hang around (doing what?). It states that it will exit but the console window hangs around. I can minimize it to the taskbar but it would be nice to have it go away if it is finished starting usbhid-ups.exe in another process space that it appears to be doing.

This is what the console shows after executing upsdrvctl in a console.

Network UPS Tools upsdrvctl - UPS driver controller 2.8.2.986.9-995-g943ed3c06 (development iteration after 2.8.2)
0.000000 [D1] upsdrvctl commanding all drivers (1 found): start
0.001000 [D1] Starting UPS: apc1500
Network UPS Tools driver 2.8.2.986.9-995-g943ed3c06 (development iteration after 2.8.2) - Generic HID driver 0.56
USB communication driver (libusb 0.1) 0.48
Using subdriver: CyberPower HID 0.81
45.018575 [D1] upsdrvctl: successfully finished
45.021575 [D1] Completed the job of upsdrvctl tool, cleaning up and exiting now
45.023575 [D1] Completed the job of upsdrvctl tool, clean-up finished, exiting now

I am starting it via the Task Scheduler but you could likely just drag a shortcut to a batch file into the Startup folder to accomplish the same thing. Note that Task Scheduler under Windows 7 has issues with starting batch processes that I can cover in a write-up.

The Windows netclient is a breeze to set up on Windows 10 having set up Linux and MacOS NUT packages in the past. It took only a few minutes and it was up and running. Windows 7 is not so nice and several issues prevent a successful installation. I spent a good part of a day debugging it.

As for an installer, really the only thing that is needed is to create the C:\Program Files\NUT folder and copy the files to it. After that, it should update the system PATH (add - C:\Program Files\NUT\bin and C:\Program Files\NUT\sbin).

I may do an installation write-up for how to use the Windows NUT package for Windows 7 and Windows 10. If I decide to do so, where could I post it? Can I add to your Wiki page?

https://github.com/networkupstools/nut/wiki/NUT-for-Windows

@smith-48116
Copy link

smith-48116 commented Aug 30, 2024

I should have added this comment. If you launch upsdrvctl from a .cmd file (Windows batch file) and close the console from which upsdrvctl is executing (and reportedly 'finished'), you will get an error message and the usbhid-ups.exe has crashed. My guess is that the usbhid-ups.exe is spawned as a child process of upsdrvctl.exe (or of the .cmd) rather than opening a new process environment. I have also tested launching upsdrvctl.exe directly from Task Scheduler with the same result.

Before closing the console (or taskeng window):

BeforeClose

After the close:

AfterClose

@jimklimov
Copy link
Member

Sounds great, thanks for the report. A Wiki page (maybe a new one linked from the one you mentioned) would be also great! :)

While at it, can you please check the nut.exe wrapper which is supposed to start upsd, upsmon and upsdrvctl for all driver(s) configured via ups.conf, or just upsmon (depending on MODE setting in nut.conf)? It should register as a Windows service, so having better privileges to run for an eventual UPS shutdown after user-space programs are killed (also headless - an area where I think Task Scheduler would be lacking).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impacts-release-2.7.3-or-older Issues reported against NUT release 2.7.3 or older, packaged or custom builds of code from that era question USB Windows
Projects
None yet
Development

No branches or pull requests

3 participants