Giter VIP home page Giter VIP logo

winnut-client's Introduction

NUT.Net

A .Net client library for communicating with Network UPS Tools servers.

What is NUT

Network UPS Tools is a project dedicated to supporting power devices, such as uninterruptible power supplies. The software is built to control and monitor many features of power devices and provides a common protocol for communicating to other devices across a network.

What this project does

Inspired by the WINNut client, this project intends to create a compliant and efficient .Net library that can be used by any .Net application to communicate with, retrieve data from and send commands to a NUT server managing one or more UPSs. This project is written using the .Net Standard Framework, version 2.0.

Current Features

  • Most of the NUT protocol, including
    • GET commands to retrieve information from the server
    • LIST commands for listing information from a server or UPS
    • SET VAR command, to change a variable on a UPS
    • INSTCMD to run a command on a UPS
    • USERNAME and PASSWORD to run commands and retrieve information that are privileged
    • LOGIN and LOGOUT to indicate dependency on a UPS
    • VER and NETVER to retrieve basic information from the NUT server
  • Logical data model that represents a connection to a NUT server, and each UPS on the server along with its properties
  • Error handling as they're returned from the server
  • Created alongside a mockup server with unit testing to achieve accurate results

References

Network UPS Tools GitHub project

jNut - A NUT client written in Java

WinNUT Client GitHub project

Extra Links

NuGet.org Package

winnut-client's People

Contributors

andriibratanin avatar g-cranston avatar gawindx avatar gbakeman avatar jcsmook avatar lineflyer avatar martinkurtz avatar maxmadcc avatar nonpointer avatar pvanderp avatar supersmile2009 avatar yrctw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

winnut-client's Issues

Unable to overwrite current installation

Hi, I'm trying to update between v2.2.8255.34401 to v2.2.8286-installer

Windows installer shows with the following error:
image

It should properly overwrite, existing install.

I had to uninstall old version, to upgrade

Setting short date format in windows makes WinNut crash

I have my short date set to yyyy-MM-dd as it removes the confusion of the default dd/MM/yyyy format given occasional reversed date formats. WinNut is confirmed to crash with any short date format that starts with a year. The day/month/year formats all work, as does the month/date/year formats, but they leave a developer guessing the meaning of any short date. I am hoping this is a quick fix, but for the meantime, dd/MMM/yyyy works fine and achieves a similar result.

Hibernation stop not working

Imported from gawindx/WinNUT-Client#89

When I configure WinNUT to Hibernate my computer the Shutdown GUI will display when the NUT Server sends the FSD signal. The Shutdown GUI will perform the countdown and then hang. When configured to Shutdown instead of hibernate, the shutdown process executes properly.

Steps to reproduce:

Configure WinNUT Shutdown Options as follows

Type of Stop = Hibernate
Delay to SHutdown (sec) = 15
Shutdown on Nut's FSD Signal = Checked

Disconnect UPS from AC power, wait for NUT Server to send FDS
Shutdown GUI will appear, wait for counter to reach zero
Shutdown GUI will hang and computer will stay powered on

I suspect this has something to do with the calls to SetSystemPowerState in the Select Cast statement at line 979 in WinNUT.vb. It looks a bit odd passing a Boolean value when the function is declared as expecting an integer. https://www.tek-tips.com/viewthread.cfm?qid=1086465 talks about similar code only passing integers 1 and 0 instead of Booleans. It has been years since I messed with VB.Net so passing a Boolean could be valid, it just looks off.

My computer is running Windows 10 21H1, NUT Server is the built in Synology NUT server, running latest version of WinNUT

WinNUT ignores Shutdown on FSD Signal option, always shuts down

Hi there,

I've installed NUT on a RPi and connected it to an APC Backups UPS.
For testing purposes I've set override.battery.charge.low = 95 and it shut's down once it hits 95% or lower.
On the WinNut side (running Pre-Release v2.2.8331), I've set a laptop to shutdown once battery drops below 98%. This works.
However, when I plug the UPS back in to grid power, I boot up my laptop and run WinNut. The UPS reports correctly as online and not on battery, but the battery is still obviously below 95%, in my case 91%, so the laptop shuts down again. Shouldn't it be the case that if the UPS is Online, even though the battery is low and charging that the device running Winnut then doesn't shutdown or have I misconfigured something?

Thanks

Unable to establish connection (pfsense plugin NUT)

I have an APC Back-UPS BX2200 connected and configured in pfSense as "Master".
I downloaded WinNUT-Client version 2.2.8356.28290, but it doesn't fetch data from Master.
All ports are open, so the problem is elsewhere.
I also tried to put the pfSense credentials.
Where am I doing wrong?

Setting up Continuous Integration, GitHub Actions and Automated Builds

I'd like to setup Continuous Integration builds to help automate compiling and distributing builds of WinNUT. This should simplify creating (pre)releases, but since I'm planning on retiring this iteration of WinNUT, this will mostly serve as my own learning tool for future projects.

Problems

WinNUT has evolved from a long line of legacy code and operating system support, and some aspects are not friendly to the default GitHub build environments.

Toasts

Initially, it became apparent that there is a fairly substantial hack to allow the solution to compile. WinNUT is built on the .NET Framework version 4.7.2, which is supported down to Windows 7 SP1. WinNUT supports sending Toast Notifications, which is a feature specific to Windows 10 and up. Due to the cross-platform design of the .NET Framework, this should not have been possible. (Related StackOverflow question) Several libraries were manually included (see here for example) which build based off of libraries available on Windows 10 operating systems, and not from any official software development kits. As a result, the GitHub automated build would fail with errors like ... WinNUT-Client_Common\ToastPopup.vb(39,30): error BC30002: Type 'Windows.UI.Notifications.ToastTemplateType' is not defined.

Solution

The solution has been provided by Microsoft, in the article titled Send a local toast notification from C# apps. A NuGet package is provided in the Microsoft Toolkit library, called Microsoft.Toolkit.Uwp.Notifications. We already target a supported Framework, so no work was necessary there. I removed the previous references and then added in the NuGet package. I was then able to easily modify our ToastNotification class to use the new package. (I also moved the class into the main WinNUT project since toasts seem specific to the UI.) After adding in NuGet package support to the build script, it appears that builds are no longer failing on this issue alone.

.vdproj MSI Packaging Project

Visual Studio Installer Project appears to be a legacy extension for building MSIs, and is not supported with msbuild (see this issue.) After researching this for quite some time, I don't see a straightforward solution to this besides redoing the packaging for WinNUT which will likely be a different issue. For now, we'll only build Debug builds.

Related: Pull #28

Uknown UPS (Synology NAS DSM), with latest 2.2.8254 18205

After installed latest WinNUT...

obrazek

And I'm getting Unknown UPS reported suddenly, while previous version just worked fine and I did no config. change except of installing latest version.
Also got this error upon shutdown...but looks like it might be useful also for this kind of error.

`WinNUT Bug Report
Os Version : 6.2.9200.0
WinNUT Version : 2.2.8254.18205

WinNUT Parameters :
{
"Delay": 5000,
"AutoReconnect": "True",
"MinInputVoltage": 220,
"MaxInputVoltage": 250,
"FrequencySupply": 0,
"MinInputFrequency": 40,
"MaxInputFrequency": 60,
"MinOutputVoltage": 210,
"MaxOutputVoltage": 250,
"MinUPSLoad": 0,
"MaxUPSLoad": 100,
"MinBattVoltage": 6,
"MaxBattVoltage": 18,
"MinimizeToTray": "True",
"MinimizeOnStart": "True",
"CloseToTray": "True",
"StartWithWindows": "True",
"UseLogFile": "False",
"Log Level": 0,
"ShutdownLimitBatteryCharge": 0,
"ShutdownLimitUPSRemainTime": 0,
"ImmediateStopAction": "False",
"Follow_FSD": "False",
"TypeOfStop": 1,
"DelayToShutdown": 15,
"AllowExtendedShutdownDelay": "False",
"ExtendedShutdownDelay": 15,
"VerifyUpdate": "True",
"VerifyUpdateAtStart": "True",
"DelayBetweenEachVerification": 1,
"StableOrDevBranch": 0,
"LastDateVerification": "06.08.2022 21:22:48"
}

Error Message :
Exception type: System.NullReferenceException
Exception message: Odkaz na objekt není nastaven na instanci objektu.
Exception stack trace:
v WinNUT_Client.About_Gui.About_Gui_Load(Object sender, EventArgs e)
v System.Windows.Forms.Form.OnLoad(EventArgs e)
v System.Windows.Forms.Form.OnCreateControl()
v System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
v System.Windows.Forms.Control.CreateControl()
v System.Windows.Forms.Control.WmShowWindow(Message& m)
v System.Windows.Forms.Control.WndProc(Message& m)
v System.Windows.Forms.ScrollableControl.WndProc(Message& m)
v System.Windows.Forms.Form.WmShowWindow(Message& m)
v System.Windows.Forms.Form.WndProc(Message& m)
v System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
v System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
v System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Last Events :
07.08.2022 21:56:27 Pid: 19164 WinNUT : Initialisation Globals Variables Complete
07.08.2022 21:56:27 Pid: 19164 WinNUT : Initialisation Params Complete
07.08.2022 21:56:27 Pid: 19164 WinNUT : Loaded Params Complete
07.08.2022 21:56:27 Pid: 19164 WinNUT : Logging is configured.
07.08.2022 21:56:27 Pid: 19164 WinNUT : NotifyIcons Initialised
07.08.2022 21:56:27 Pid: 19164 WinNUT : Windows 10 Toast Notification Not Available. Too Old Windows Version
07.08.2022 21:56:27 Pid: 19164 WinNUT : Windows App Use Light Theme
07.08.2022 21:56:27 Pid: 19164 WinNUT : Windows Use Dark Theme
07.08.2022 21:56:27 Pid: 19164 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
Not Connected
07.08.2022 21:56:27 Pid: 19164 WinNUT : Status Icon Changed
07.08.2022 21:56:27 Pid: 19164 WinNUT : New Icon Value For Systray : 1216
07.08.2022 21:56:27 Pid: 19164 WinNUT : New Icon Value For Gui : 1152
07.08.2022 21:56:27 Pid: 19164 WinNUT : Update Icon at Startup
07.08.2022 21:56:27 Pid: 19164 WinNUT : Run Automatic Update
07.08.2022 21:56:27 Pid: 19164 Update_Gui : Verify Update
07.08.2022 21:56:27 Pid: 19164 WinNUT : Main Gui Has Focus
07.08.2022 21:56:27 Pid: 19164 WinNUT : Update Icon
07.08.2022 21:56:27 Pid: 19164 WinNUT : Update Icon
07.08.2022 21:56:27 Pid: 19164 WinNUT : Minimize WinNut On Start
07.08.2022 21:56:27 Pid: 19164 WinNUT : Update Icon
07.08.2022 21:56:27 Pid: 19164 WinNUT : Minimize Main Gui To Notify Icon
07.08.2022 21:56:27 Pid: 19164 WinNUT : Main Gui Lose Focus
07.08.2022 21:56:27 Pid: 19164 WinNUT : Update Icon
07.08.2022 21:56:27 Pid: 19164 WinNUT : Auto-connecting to UPS on startup.
07.08.2022 21:56:27 Pid: 19164 UPS_Device : Beginning connection: [email protected]:3493, Name: UPS [AutoReconnect]
07.08.2022 21:56:27 Pid: 19164 Nut_Socket : Attempting TCP socket connection to 10.0.0.11:3493...
07.08.2022 21:56:27 Pid: 19164 Nut_Socket : Connection established and streams ready for 10.0.0.11:3493
07.08.2022 21:56:27 Pid: 19164 Nut_Socket : Attempting authentication...
07.08.2022 21:56:27 Pid: 19164 Nut_Socket : Authenticated successfully.
07.08.2022 21:56:27 Pid: 19164 Nut_Socket : NUT server reports VER: DSM7-1-42464-211216 NETVER: 1.2
07.08.2022 21:56:27 Pid: 19164 UPS_Device : TCP Socket Created
07.08.2022 21:56:27 Pid: 19164 UPS_Device : Given UPS Name is unknown
07.08.2022 21:56:27 Pid: 19164 WinNUT : Update Icon
07.08.2022 21:56:27 Pid: 19164 WinNUT : Status Icon Changed
07.08.2022 21:56:27 Pid: 19164 WinNUT : New Icon Value For Systray : 1216
07.08.2022 21:56:27 Pid: 19164 WinNUT : New Icon Value For Gui : 1216
07.08.2022 21:56:27 Pid: 19164 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
Unknown UPS Name
07.08.2022 21:56:27 Pid: 19164 WinNUT : Cannot Connect : Unknow UPS Name
07.08.2022 21:56:27 Pid: 19164 String : New Log to CB_Current Log : Unknown UPS Name
07.08.2022 21:56:27 Pid: 19164 WinNUT : Update Icon
07.08.2022 21:56:27 Pid: 19164 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
Unknown UPS Name
07.08.2022 21:56:27 Pid: 19164 WinNUT : Cannot Connect : Unknow UPS Name
07.08.2022 21:56:27 Pid: 19164 String : New Log to CB_Current Log : Unknown UPS Name
07.08.2022 21:56:27 Pid: 19164 WinNUT : Completed WinNUT_Shown
07.08.2022 21:56:31 Pid: 19164 WinNUT : Restore Main Gui On Mouse Click Notify Icon
07.08.2022 21:56:31 Pid: 19164 WinNUT : Main Gui Has Focus
07.08.2022 21:56:31 Pid: 19164 WinNUT : Update Icon
07.08.2022 21:56:33 Pid: 19164 WinNUT : Open About Gui From Menu
07.08.2022 21:56:33 Pid: 19164 WinNUT : Main Gui Lose Focus
07.08.2022 21:56:33 Pid: 19164 WinNUT : Update Icon
`

ArgumentOutOfRangeException for de-DE users due to string over-length

Imported from gawindx/WinNUT-Client#74, gawindx/WinNUT-Client#81, gawindx/WinNUT-Client#114, and gawindx/WinNUT-Client#135

Hi there,

everything works fine until I disconnect the 230V plug from the UPS:

Errormessage:

  • [Id 10: 04.03.2021 22:10:32] Failed to connect to Nut Host 192.168.xxx.xxx: 3493: Text must be less than 64 characters.

  • Parametername: Text

  • The actual value was WinNUT - 2.0

  • Connected

  • Batterie (80%)

  • Batterie OK.

WINnut then cannot connect to the Synology UPS server because a text field value is too large (longer than 64 characters). Can I force English to test this? Do you need any other information?

Legacy and Future of WinNUT

Welcome, and I'm glad you've found the current home for WinNUT. WinNUT has had a long and rich history as a project dedicated to presenting information from a NUT server to a Windows computer, and offering critical automation to make sure your system is safe from a power outage. This repository was migrated from gawindx/WinNUT-Client and work has continued to make sure WinNUT is in a stable state for users around the world.

WinNUT was migrated to where it is today in its Windows Forms and Visual Basic .Net form thanks to the dedication and hard work of @gawindx and other contributors. However, WinNUT is collecting technical debt, and the technology it was built upon is aging and nearing deprecation from Microsoft.

The future of WinNUT

As you can see, WinNUT now lives under the nutdotnet GitHub Organization, which I intend to be the home of all .Net software for NUT and UPS interaction. Work has already been completed to create a modern .Net library (currently at Minimum Viable Product status) with the sole purpose of maintaining a connection to and interacting with a NUT server. All that's left is to build a UI ontop of that library, and so the time has arrived to create the next generation of desktop NUT monitoring software.

Introducing Coco.Nut

I've already created a new repository with the working name of Coco.Nut (https://github.com/nutdotnet/Coco.Nut), and I intend for this to replace WinNUT entirely. It will be written in Microsoft's C# language (same as the Nut.Net library), and written for a modern cross-platform UI toolkit (most likely MAUI) with the intent that it will run on any traditional personal computer, and potentially mobile devices as well. Please star the Coco.Nut repository, follow it and join in the discussions by adding your feedback and ideas for features you'd like to see added into the program.

WinNUT will continue to have bug fixes or important features added to it as necessary. This project is always open to pull requests, but I discourage anyone from putting too much of their time into a new feature. I'm committed to a stable 2.2 release soon, and potentially a final stable 2.3 release with bugfixes thereafter. At that point, the WinNUT repository will enter a legacy state and development will wind down to only accepting translation and bug fixes.

Thank you for your support, and I hope you'll join us for WinNUT's next generation.

WinNUT 2.2.8303 GUI failure when interval=0

I've upgraded an earlier WinNUT 2.0.x release to latest beta Winnut 2.2.8303.
Now everytime I launch the GUI, I get the follwoing error message, roughly translating to value '0' is not valid for interval.

Exception type: System.ArgumentOutOfRangeException
Exception message: La valeur '0' n'est pas valide pour Interval. Interval doit être supérieur à 0.
Nom du paramètre : Interval
Exception stack trace: 
   à System.Windows.Forms.Timer.set_Interval(Int32 value)
   à WinNUT_Client_Common.UPS_Device.set_PollingInterval(Int32 value)
   à WinNUT_Client_Common.UPS_Device..ctor(Nut_Parameter& Nut_Config, Logger& LogFile, Int32 pollInterval)
   à WinNUT_Client.WinNUT.UPS_Connect()
   à WinNUT_Client.WinNUT.WinNUT_Shown(Object sender, EventArgs e)
   à System.Windows.Forms.Form.OnShown(EventArgs e)
   à System.Windows.Forms.Form.CallShownEvent()
   à System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   à System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   à System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   à System.Windows.Forms.Control.InvokeMarshaledCallbacks()

I've managed to update the interval value directly in registry path `HKEY_CURRENT_USER\SOFTWARE\WinNUT\Connexion\Delay' from 0x00000000 to 0x000001388 (5000 ms I guess ?).
The software runs now.
But what baffles me is that it's possible to set the interval again to zero in the GUI, rendering the GUI unusable on next run.

Crash when upsd sends DATA-STALE response

Note: NUT is running on OpenWRT, and reports fine....

image

inNUT Bug Report
Os Version : 6.2.9200.0
WinNUT Version : 2.2.8255.34401

WinNUT Parameters :
{
"Delay": 30000,
"AutoReconnect": true,
"MinInputVoltage": 80,
"MaxInputVoltage": 145,
"FrequencySupply": 1,
"MinInputFrequency": 56,
"MaxInputFrequency": 64,
"MinOutputVoltage": 108,
"MaxOutputVoltage": 132,
"MinUPSLoad": 0,
"MaxUPSLoad": 100,
"MinBattVoltage": 24,
"MaxBattVoltage": 28,
"MinimizeToTray": true,
"MinimizeOnStart": true,
"CloseToTray": true,
"StartWithWindows": true,
"UseLogFile": true,
"Log Level": 3,
"ShutdownLimitBatteryCharge": 0,
"ShutdownLimitUPSRemainTime": 0,
"ImmediateStopAction": true,
"Follow_FSD": false,
"TypeOfStop": 2,
"DelayToShutdown": 0,
"AllowExtendedShutdownDelay": false,
"ExtendedShutdownDelay": 0,
"VerifyUpdate": true,
"VerifyUpdateAtStart": true,
"DelayBetweenEachVerification": 1,
"StableOrDevBranch": 0,
"LastDateVerification": "10/8/2022 12:55:22"
}

Error Message :
Exception type: System.Exception
Exception message: ups.mfr : ERR DATA-STALE
Exception stack trace:
at WinNUT_Client_Common.UPS_Device.GetUPSVar(String varName, String UPSName, Object Fallback_value)
at WinNUT_Client_Common.UPS_Device.GetUPSProductInfo()
at WinNUT_Client_Common.UPS_Device.Connect_UPS()
at WinNUT_Client_Common.UPS_Device.Reconnect_Socket(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Last Events :
12/8/2022 11:39:14 Pid: 18604 WinNUT : Status Icon Changed
12/8/2022 11:39:14 Pid: 18604 WinNUT : New Icon Value For Systray : 1344
12/8/2022 11:39:14 Pid: 18604 WinNUT : New Icon Value For Gui : 1344
12/8/2022 11:39:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Lost Connect To 10.10.10.50:3493
12/8/2022 11:39:14 Pid: 18604 WinNUT : Battery Status => Unknown
12/8/2022 11:39:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:39:14 Pid: 18604 UPS_Device : Reconnection Process Started
12/8/2022 11:39:44 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Reconnection In Progress
Try 1 of 30
12/8/2022 11:39:44 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:39:44 Pid: 18604 UPS_Device : Try Reconnect 1 / 30
12/8/2022 11:39:44 Pid: 18604 String : New Log to CB_Current Log : Try Reconnect 1 / 30
12/8/2022 11:39:44 Pid: 18604 UPS_Device : Beginning connection: @10.10.10.50:3493, Name: CDP [AutoReconnect]
12/8/2022 11:39:44 Pid: 18604 Nut_Socket : Attempting TCP socket connection to 10.10.10.50:3493...
12/8/2022 11:39:44 Pid: 18604 Nut_Socket : Connection established and streams ready for 10.10.10.50:3493
12/8/2022 11:39:44 Pid: 18604 Nut_Socket : Attempting authentication...
12/8/2022 11:39:44 Pid: 18604 Nut_Socket : Authenticated successfully.
12/8/2022 11:39:44 Pid: 18604 Nut_Socket : NUT server reports VER: 2.7.4 NETVER: 1.2
12/8/2022 11:39:44 Pid: 18604 UPS_Device : TCP Socket Created
12/8/2022 11:39:44 Pid: 18604 WinNUT : CDP has indicated it's ready to start sending data.
12/8/2022 11:39:44 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:39:44 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
12/8/2022 11:39:44 Pid: 18604 WinNUT : Connection to Nut Host Established
12/8/2022 11:39:44 Pid: 18604 String : New Log to CB_Current Log : Connection to Nut Host 10.10.10.50:3493 Established
12/8/2022 11:39:44 Pid: 18604 UPS_Device : Nut Host Reconnected
12/8/2022 11:39:44 Pid: 18604 WinNUT : CDP has indicated it's ready to start sending data.
12/8/2022 11:39:44 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:39:44 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
12/8/2022 11:39:44 Pid: 18604 WinNUT : Connection to Nut Host Established
12/8/2022 11:39:44 Pid: 18604 String : New Log to CB_Current Log : Connection to Nut Host 10.10.10.50:3493 Established
12/8/2022 11:40:14 Pid: 18604 UPS_Device : Enter Retrieve_UPS_Datas
12/8/2022 11:40:14 Pid: 18604 UPS_Device : Apply Fallback Value when retrieving battery.runtime
12/8/2022 11:40:14 Pid: 18604 UPS_Device : UPS is On Line
12/8/2022 11:40:14 Pid: 18604 WinNUT : Updating UPS data for Form.
12/8/2022 11:40:14 Pid: 18604 WinNUT : Retrieve UPS Informations
12/8/2022 11:40:14 Pid: 18604 WinNUT : Battery Charged
12/8/2022 11:40:14 Pid: 18604 WinNUT : Update Dial
12/8/2022 11:40:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:40:14 Pid: 18604 WinNUT : Status Icon Changed
12/8/2022 11:40:14 Pid: 18604 WinNUT : New Icon Value For Systray : 1136
12/8/2022 11:40:14 Pid: 18604 WinNUT : New Icon Value For Gui : 1136
12/8/2022 11:40:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
On Line
Battery OK
12/8/2022 11:40:14 Pid: 18604 WinNUT : Battery Status => Charging
12/8/2022 11:40:44 Pid: 18604 UPS_Device : Enter Retrieve_UPS_Datas
12/8/2022 11:40:44 Pid: 18604 UPS_Device : Apply Fallback Value when retrieving battery.runtime
12/8/2022 11:40:44 Pid: 18604 UPS_Device : UPS is On Line
12/8/2022 11:40:44 Pid: 18604 WinNUT : Updating UPS data for Form.
12/8/2022 11:40:44 Pid: 18604 WinNUT : Battery Charged
12/8/2022 11:40:44 Pid: 18604 WinNUT : Update Dial
12/8/2022 11:40:44 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:40:44 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
On Line
Battery OK
12/8/2022 11:40:44 Pid: 18604 WinNUT : Battery Status => Charging
12/8/2022 11:41:14 Pid: 18604 UPS_Device : Enter Retrieve_UPS_Datas
12/8/2022 11:41:14 Pid: 18604 UPS_Device : Error Result On Retrieving battery.charge : ERR DATA-STALE
12/8/2022 11:41:14 Pid: 18604 UPS_Device : Something went wrong in Retrieve_UPS_Datas: System.Exception: battery.charge : ERR DATA-STALE
at WinNUT_Client_Common.UPS_Device.GetUPSVar(String varName, String UPSName, Object Fallback_value)
at WinNUT_Client_Common.UPS_Device.Retrieve_UPS_Datas()
12/8/2022 11:41:14 Pid: 18604 UPS_Device : Processing request to disconnect...
12/8/2022 11:41:14 Pid: 18604 Nut_Socket : NutSocket has been Disconnected.
12/8/2022 11:41:14 Pid: 18604 UPS_Device : Socket has reported a Broken event.
12/8/2022 11:41:14 Pid: 18604 WinNUT : Notify user of lost connection
12/8/2022 11:41:14 Pid: 18604 String : New Log to CB_Current Log : Lost Connect To 10.10.10.50:3493
12/8/2022 11:41:14 Pid: 18604 WinNUT : Status Icon Changed
12/8/2022 11:41:14 Pid: 18604 WinNUT : New Icon Value For Systray : 1344
12/8/2022 11:41:14 Pid: 18604 WinNUT : New Icon Value For Gui : 1344
12/8/2022 11:41:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Lost Connect To 10.10.10.50:3493
12/8/2022 11:41:14 Pid: 18604 WinNUT : Battery Status => Unknown
12/8/2022 11:41:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:41:14 Pid: 18604 UPS_Device : Reconnection Process Started
12/8/2022 11:41:44 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Reconnection In Progress
Try 1 of 30
12/8/2022 11:41:44 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:41:44 Pid: 18604 UPS_Device : Try Reconnect 1 / 30
12/8/2022 11:41:44 Pid: 18604 String : New Log to CB_Current Log : Try Reconnect 1 / 30
12/8/2022 11:41:44 Pid: 18604 UPS_Device : Beginning connection: @10.10.10.50:3493, Name: CDP [AutoReconnect]
12/8/2022 11:41:44 Pid: 18604 Nut_Socket : Attempting TCP socket connection to 10.10.10.50:3493...
12/8/2022 11:41:44 Pid: 18604 Nut_Socket : Connection established and streams ready for 10.10.10.50:3493
12/8/2022 11:41:44 Pid: 18604 Nut_Socket : Attempting authentication...
12/8/2022 11:41:44 Pid: 18604 Nut_Socket : Authenticated successfully.
12/8/2022 11:41:44 Pid: 18604 Nut_Socket : NUT server reports VER: 2.7.4 NETVER: 1.2
12/8/2022 11:41:44 Pid: 18604 UPS_Device : TCP Socket Created
12/8/2022 11:41:44 Pid: 18604 UPS_Device : Error Result On Retrieving ups.mfr : ERR DATA-STALE
12/8/2022 11:42:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Reconnection In Progress
Try 2 of 30
12/8/2022 11:42:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:42:14 Pid: 18604 UPS_Device : Try Reconnect 2 / 30
12/8/2022 11:42:14 Pid: 18604 String : New Log to CB_Current Log : Try Reconnect 2 / 30
12/8/2022 11:42:14 Pid: 18604 UPS_Device : Beginning connection: @10.10.10.50:3493, Name: CDP [AutoReconnect]
12/8/2022 11:42:14 Pid: 18604 Nut_Socket : Attempting TCP socket connection to 10.10.10.50:3493...
12/8/2022 11:42:14 Pid: 18604 Nut_Socket : Connection established and streams ready for 10.10.10.50:3493
12/8/2022 11:42:14 Pid: 18604 Nut_Socket : Attempting authentication...
12/8/2022 11:42:14 Pid: 18604 Nut_Socket : Authenticated successfully.
12/8/2022 11:42:14 Pid: 18604 Nut_Socket : NUT server reports VER: 2.7.4 NETVER: 1.2
12/8/2022 11:42:14 Pid: 18604 UPS_Device : TCP Socket Created
12/8/2022 11:42:14 Pid: 18604 WinNUT : CDP has indicated it's ready to start sending data.
12/8/2022 11:42:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:42:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
12/8/2022 11:42:14 Pid: 18604 WinNUT : Connection to Nut Host Established
12/8/2022 11:42:14 Pid: 18604 String : New Log to CB_Current Log : Connection to Nut Host 10.10.10.50:3493 Established
12/8/2022 11:42:14 Pid: 18604 UPS_Device : Nut Host Reconnected
12/8/2022 11:42:14 Pid: 18604 WinNUT : CDP has indicated it's ready to start sending data.
12/8/2022 11:42:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:42:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
12/8/2022 11:42:14 Pid: 18604 WinNUT : Connection to Nut Host Established
12/8/2022 11:42:14 Pid: 18604 String : New Log to CB_Current Log : Connection to Nut Host 10.10.10.50:3493 Established
12/8/2022 11:42:44 Pid: 18604 UPS_Device : Enter Retrieve_UPS_Datas
12/8/2022 11:42:44 Pid: 18604 UPS_Device : Apply Fallback Value when retrieving battery.runtime
12/8/2022 11:42:44 Pid: 18604 UPS_Device : UPS is On Line
12/8/2022 11:42:44 Pid: 18604 WinNUT : Updating UPS data for Form.
12/8/2022 11:42:44 Pid: 18604 WinNUT : Battery Charged
12/8/2022 11:42:44 Pid: 18604 WinNUT : Update Dial
12/8/2022 11:42:44 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:42:44 Pid: 18604 WinNUT : Status Icon Changed
12/8/2022 11:42:44 Pid: 18604 WinNUT : New Icon Value For Systray : 1136
12/8/2022 11:42:44 Pid: 18604 WinNUT : New Icon Value For Gui : 1136
12/8/2022 11:42:44 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
On Line
Battery OK
12/8/2022 11:42:44 Pid: 18604 WinNUT : Battery Status => Charging
12/8/2022 11:43:14 Pid: 18604 UPS_Device : Enter Retrieve_UPS_Datas
12/8/2022 11:43:14 Pid: 18604 UPS_Device : Error Result On Retrieving battery.charge : ERR DATA-STALE
12/8/2022 11:43:14 Pid: 18604 UPS_Device : Something went wrong in Retrieve_UPS_Datas: System.Exception: battery.charge : ERR DATA-STALE
at WinNUT_Client_Common.UPS_Device.GetUPSVar(String varName, String UPSName, Object Fallback_value)
at WinNUT_Client_Common.UPS_Device.Retrieve_UPS_Datas()
12/8/2022 11:43:14 Pid: 18604 UPS_Device : Processing request to disconnect...
12/8/2022 11:43:14 Pid: 18604 Nut_Socket : NutSocket has been Disconnected.
12/8/2022 11:43:14 Pid: 18604 UPS_Device : Socket has reported a Broken event.
12/8/2022 11:43:14 Pid: 18604 WinNUT : Notify user of lost connection
12/8/2022 11:43:14 Pid: 18604 String : New Log to CB_Current Log : Lost Connect To 10.10.10.50:3493
12/8/2022 11:43:14 Pid: 18604 WinNUT : Status Icon Changed
12/8/2022 11:43:14 Pid: 18604 WinNUT : New Icon Value For Systray : 1344
12/8/2022 11:43:14 Pid: 18604 WinNUT : New Icon Value For Gui : 1344
12/8/2022 11:43:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Lost Connect To 10.10.10.50:3493
12/8/2022 11:43:14 Pid: 18604 WinNUT : Battery Status => Unknown
12/8/2022 11:43:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:43:14 Pid: 18604 UPS_Device : Reconnection Process Started
12/8/2022 11:43:44 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Reconnection In Progress
Try 1 of 30
12/8/2022 11:43:44 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:43:44 Pid: 18604 UPS_Device : Try Reconnect 1 / 30
12/8/2022 11:43:44 Pid: 18604 String : New Log to CB_Current Log : Try Reconnect 1 / 30
12/8/2022 11:43:44 Pid: 18604 UPS_Device : Beginning connection: @10.10.10.50:3493, Name: CDP [AutoReconnect]
12/8/2022 11:43:44 Pid: 18604 Nut_Socket : Attempting TCP socket connection to 10.10.10.50:3493...
12/8/2022 11:43:44 Pid: 18604 Nut_Socket : Connection established and streams ready for 10.10.10.50:3493
12/8/2022 11:43:44 Pid: 18604 Nut_Socket : Attempting authentication...
12/8/2022 11:43:44 Pid: 18604 Nut_Socket : Authenticated successfully.
12/8/2022 11:43:44 Pid: 18604 Nut_Socket : NUT server reports VER: 2.7.4 NETVER: 1.2
12/8/2022 11:43:44 Pid: 18604 UPS_Device : TCP Socket Created
12/8/2022 11:43:44 Pid: 18604 UPS_Device : Error Result On Retrieving ups.mfr : ERR DATA-STALE
12/8/2022 11:44:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Reconnection In Progress
Try 2 of 30
12/8/2022 11:44:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:44:14 Pid: 18604 UPS_Device : Try Reconnect 2 / 30
12/8/2022 11:44:14 Pid: 18604 String : New Log to CB_Current Log : Try Reconnect 2 / 30
12/8/2022 11:44:14 Pid: 18604 UPS_Device : Beginning connection: @10.10.10.50:3493, Name: CDP [AutoReconnect]
12/8/2022 11:44:14 Pid: 18604 Nut_Socket : Attempting TCP socket connection to 10.10.10.50:3493...
12/8/2022 11:44:14 Pid: 18604 Nut_Socket : Connection established and streams ready for 10.10.10.50:3493
12/8/2022 11:44:14 Pid: 18604 Nut_Socket : Attempting authentication...
12/8/2022 11:44:14 Pid: 18604 Nut_Socket : Authenticated successfully.
12/8/2022 11:44:14 Pid: 18604 Nut_Socket : NUT server reports VER: 2.7.4 NETVER: 1.2
12/8/2022 11:44:14 Pid: 18604 UPS_Device : TCP Socket Created
12/8/2022 11:44:14 Pid: 18604 WinNUT : CDP has indicated it's ready to start sending data.
12/8/2022 11:44:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:44:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
12/8/2022 11:44:14 Pid: 18604 WinNUT : Connection to Nut Host Established
12/8/2022 11:44:14 Pid: 18604 String : New Log to CB_Current Log : Connection to Nut Host 10.10.10.50:3493 Established
12/8/2022 11:44:14 Pid: 18604 UPS_Device : Nut Host Reconnected
12/8/2022 11:44:14 Pid: 18604 WinNUT : CDP has indicated it's ready to start sending data.
12/8/2022 11:44:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:44:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
12/8/2022 11:44:14 Pid: 18604 WinNUT : Connection to Nut Host Established
12/8/2022 11:44:14 Pid: 18604 String : New Log to CB_Current Log : Connection to Nut Host 10.10.10.50:3493 Established
12/8/2022 11:44:44 Pid: 18604 UPS_Device : Enter Retrieve_UPS_Datas
12/8/2022 11:44:44 Pid: 18604 UPS_Device : Apply Fallback Value when retrieving battery.runtime
12/8/2022 11:44:44 Pid: 18604 UPS_Device : UPS is On Line
12/8/2022 11:44:44 Pid: 18604 WinNUT : Updating UPS data for Form.
12/8/2022 11:44:44 Pid: 18604 WinNUT : Battery Charged
12/8/2022 11:44:44 Pid: 18604 WinNUT : Update Dial
12/8/2022 11:44:44 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:44:44 Pid: 18604 WinNUT : Status Icon Changed
12/8/2022 11:44:44 Pid: 18604 WinNUT : New Icon Value For Systray : 1136
12/8/2022 11:44:44 Pid: 18604 WinNUT : New Icon Value For Gui : 1136
12/8/2022 11:44:44 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Connected
On Line
Battery OK
12/8/2022 11:44:44 Pid: 18604 WinNUT : Battery Status => Charging
12/8/2022 11:45:14 Pid: 18604 UPS_Device : Enter Retrieve_UPS_Datas
12/8/2022 11:45:14 Pid: 18604 UPS_Device : Error Result On Retrieving battery.charge : ERR DATA-STALE
12/8/2022 11:45:14 Pid: 18604 UPS_Device : Something went wrong in Retrieve_UPS_Datas: System.Exception: battery.charge : ERR DATA-STALE
at WinNUT_Client_Common.UPS_Device.GetUPSVar(String varName, String UPSName, Object Fallback_value)
at WinNUT_Client_Common.UPS_Device.Retrieve_UPS_Datas()
12/8/2022 11:45:14 Pid: 18604 UPS_Device : Processing request to disconnect...
12/8/2022 11:45:14 Pid: 18604 Nut_Socket : NutSocket has been Disconnected.
12/8/2022 11:45:14 Pid: 18604 UPS_Device : Socket has reported a Broken event.
12/8/2022 11:45:14 Pid: 18604 WinNUT : Notify user of lost connection
12/8/2022 11:45:14 Pid: 18604 String : New Log to CB_Current Log : Lost Connect To 10.10.10.50:3493
12/8/2022 11:45:14 Pid: 18604 WinNUT : Status Icon Changed
12/8/2022 11:45:14 Pid: 18604 WinNUT : New Icon Value For Systray : 1344
12/8/2022 11:45:14 Pid: 18604 WinNUT : New Icon Value For Gui : 1344
12/8/2022 11:45:14 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Lost Connect To 10.10.10.50:3493
12/8/2022 11:45:14 Pid: 18604 WinNUT : Battery Status => Unknown
12/8/2022 11:45:14 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:45:14 Pid: 18604 UPS_Device : Reconnection Process Started
12/8/2022 11:45:44 Pid: 18604 WinNUT : NotifyIcon Text =>
WinNUT Client - 2.2
Reconnection In Progress
Try 1 of 30
12/8/2022 11:45:44 Pid: 18604 WinNUT : Update Icon
12/8/2022 11:45:44 Pid: 18604 UPS_Device : Try Reconnect 1 / 30
12/8/2022 11:45:44 Pid: 18604 String : New Log to CB_Current Log : Try Reconnect 1 / 30
12/8/2022 11:45:44 Pid: 18604 UPS_Device : Beginning connection: @10.10.10.50:3493, Name: CDP [AutoReconnect]
12/8/2022 11:45:44 Pid: 18604 Nut_Socket : Attempting TCP socket connection to 10.10.10.50:3493...
12/8/2022 11:45:44 Pid: 18604 Nut_Socket : Connection established and streams ready for 10.10.10.50:3493
12/8/2022 11:45:44 Pid: 18604 Nut_Socket : Attempting authentication...
12/8/2022 11:45:44 Pid: 18604 Nut_Socket : Authenticated successfully.
12/8/2022 11:45:44 Pid: 18604 Nut_Socket : NUT server reports VER: 2.7.4 NETVER: 1.2
12/8/2022 11:45:44 Pid: 18604 UPS_Device : TCP Socket Created
12/8/2022 11:45:44 Pid: 18604 UPS_Device : Error Result On Retrieving ups.mfr : ERR DATA-STALE

Crash on launch

Hi there,

Update to latest pre-release.
Crash on launch.

Exception type: System.MissingFieldException
Exception message: Champ introuvable : 'WinNUT_Client_Common.WinNUT_Globals.ApplicationData'.
Exception stack trace:
à WinNUT_Client.WinNUT.WinNUT_PrefsChanged(Boolean isChanged)
à WinNUT_Client.WinNUT.WinNUT_Load(Object sender, EventArgs e)
à System.EventHandler.Invoke(Object sender, EventArgs e)
à System.Windows.Forms.Form.OnLoad(EventArgs e)
à System.Windows.Forms.Form.OnCreateControl()
à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
à System.Windows.Forms.Control.CreateControl()
à System.Windows.Forms.Control.WmShowWindow(Message& m)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ScrollableControl.WndProc(Message& m)
à System.Windows.Forms.Form.WmShowWindow(Message& m)
à System.Windows.Forms.Form.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Unable to initialize crypto when ProcessorID WMI object is not available

Imported from gawindx/WinNUT-Client#75

Seen when starting WinNUT without any user data beforehand. Happens on Windows 10, Server 2019 and Server 2012.

Exception type: System.TypeInitializationException
Exception message: The type initializer for 'WinNUT_client.WinNUT_Params' threw an exception.
Exception stack trace:
at WinNUT_client.WinNUT_Params.Init_Params()
at WinNUT_client.WinNUT.WinNUT_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Edit: 2022/10/27

InnerException present:
Exception type: System.NullReferenceException
Exception message: Object reference not set to an instance of an object.
Exception stack trace:
at WinNUT_Client_Common.CryptData.GetProcessorId() in D:\a\WinNUT-Client\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\CryptData.vb:line 116
at WinNUT_Client_Common.CryptData.Get_UniqueKey_Hash() in D:\a\WinNUT-Client\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\CryptData.vb:line 97
at WinNUT_Client_Common.CryptData..ctor() in D:\a\WinNUT-Client\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\CryptData.vb:line 20
at WinNUT_Client_Common.WinNUT_Params..cctor() in D:\a\WinNUT-Client\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\WinNUT_Params.vb:line 15

Notes

WinNUT uses ProcessorID and SerialNumber WMI objects to create a hash for encrypting sensitive data in the registry. Sometimes, the ProcessorID object is not present (if the processor doesn't support the CPUID instruction, for example) and the subroutine will throw an exception. It may be best to find a new hashing algorithm that is platform independent.

Solution

I'm looking at implementing and replacing our current Cryptography solution with the .Net Framework's Data Protection API (DPAPI), starting with simply encrypting & decrypting streams, then eventually variables in memory as necessary.

Crash when opening UPS Variables window

This occurs when opening the UPS Variables window

WinNUT Bug Report
Os Version : 6.2.9200.0
WinNUT Version : 2.2.8254.18205

WinNUT Parameters :
{
"Delay": 1000,
"AutoReconnect": "True",
"MinInputVoltage": 220,
"MaxInputVoltage": 245,
"FrequencySupply": 0,
"MinInputFrequency": 49,
"MaxInputFrequency": 51,
"MinOutputVoltage": 220,
"MaxOutputVoltage": 245,
"MinUPSLoad": 0,
"MaxUPSLoad": 100,
"MinBattVoltage": 18,
"MaxBattVoltage": 30,
"MinimizeToTray": "True",
"MinimizeOnStart": "True",
"CloseToTray": "True",
"StartWithWindows": "True",
"UseLogFile": "True",
"Log Level": 3,
"ShutdownLimitBatteryCharge": 50,
"ShutdownLimitUPSRemainTime": 600,
"ImmediateStopAction": "True",
"Follow_FSD": "False",
"TypeOfStop": 2,
"DelayToShutdown": 15,
"AllowExtendedShutdownDelay": "False",
"ExtendedShutdownDelay": 15,
"VerifyUpdate": "True",
"VerifyUpdateAtStart": "False",
"DelayBetweenEachVerification": 0,
"StableOrDevBranch": 0,
"LastDateVerification": ""
}

Error Message :
Exception type: System.NullReferenceException
Exception message: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Exception stack trace:
bei WinNUT_Client.List_Var_Gui.List_Var_Gui_Load(Object sender, EventArgs e)
bei System.Windows.Forms.Form.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Last Events :
08.08.2022 12:06:17 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.current.nominal
08.08.2022 12:06:17 Pid: 13128 UPS_Device : UPS is On Line
08.08.2022 12:06:17 Pid: 13128 WinNUT : Updating UPS data for Form.
08.08.2022 12:06:17 Pid: 13128 WinNUT : Battery Charged
08.08.2022 12:06:17 Pid: 13128 WinNUT : Update Dial
08.08.2022 12:06:17 Pid: 13128 WinNUT : Update Icon
08.08.2022 12:06:17 Pid: 13128 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
In Verbindung gebracht
Online
Batteri...
08.08.2022 12:06:17 Pid: 13128 WinNUT : Battery Status => Charged
08.08.2022 12:06:18 Pid: 13128 UPS_Device : Enter Retrieve_UPS_Datas
08.08.2022 12:06:18 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.serial
08.08.2022 12:06:18 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving battery.runtime
08.08.2022 12:06:18 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving output.frequency
08.08.2022 12:06:18 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.realpower.nominal
08.08.2022 12:06:18 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.power.nominal
08.08.2022 12:06:18 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.current.nominal
08.08.2022 12:06:18 Pid: 13128 UPS_Device : UPS is On Line
08.08.2022 12:06:18 Pid: 13128 WinNUT : Updating UPS data for Form.
08.08.2022 12:06:18 Pid: 13128 WinNUT : Battery Charged
08.08.2022 12:06:18 Pid: 13128 WinNUT : Update Dial
08.08.2022 12:06:18 Pid: 13128 WinNUT : Update Icon
08.08.2022 12:06:18 Pid: 13128 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
In Verbindung gebracht
Online
Batteri...
08.08.2022 12:06:18 Pid: 13128 WinNUT : Battery Status => Charged
08.08.2022 12:06:19 Pid: 13128 UPS_Device : Enter Retrieve_UPS_Datas
08.08.2022 12:06:19 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.serial
08.08.2022 12:06:19 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving battery.runtime
08.08.2022 12:06:19 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving output.frequency
08.08.2022 12:06:19 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.realpower.nominal
08.08.2022 12:06:19 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.power.nominal
08.08.2022 12:06:19 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.current.nominal
08.08.2022 12:06:19 Pid: 13128 UPS_Device : UPS is On Line
08.08.2022 12:06:19 Pid: 13128 WinNUT : Updating UPS data for Form.
08.08.2022 12:06:19 Pid: 13128 WinNUT : Battery Charged
08.08.2022 12:06:19 Pid: 13128 WinNUT : Update Dial
08.08.2022 12:06:19 Pid: 13128 WinNUT : Update Icon
08.08.2022 12:06:19 Pid: 13128 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
In Verbindung gebracht
Online
Batteri...
08.08.2022 12:06:19 Pid: 13128 WinNUT : Battery Status => Charged
08.08.2022 12:06:20 Pid: 13128 UPS_Device : Enter Retrieve_UPS_Datas
08.08.2022 12:06:20 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.serial
08.08.2022 12:06:20 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving battery.runtime
08.08.2022 12:06:20 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving output.frequency
08.08.2022 12:06:20 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.realpower.nominal
08.08.2022 12:06:20 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.power.nominal
08.08.2022 12:06:20 Pid: 13128 UPS_Device : Apply Fallback Value when retrieving ups.current.nominal
08.08.2022 12:06:20 Pid: 13128 UPS_Device : UPS is On Line
08.08.2022 12:06:20 Pid: 13128 WinNUT : Updating UPS data for Form.
08.08.2022 12:06:20 Pid: 13128 WinNUT : Battery Charged
08.08.2022 12:06:20 Pid: 13128 WinNUT : Update Dial
08.08.2022 12:06:20 Pid: 13128 WinNUT : Update Icon
08.08.2022 12:06:20 Pid: 13128 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
In Verbindung gebracht
Online
Batteri...
08.08.2022 12:06:20 Pid: 13128 WinNUT : Battery Status => Charged

Cyber Power CP600 Not Recognized

I've installed WinNut (2.2.8359.21169) on my Windows 10 machine. I'm connecting it to a NUT server running on Asustor NAS. The NAS is USB connected to a CyberPower CP600. I can connect to the NAS, but the Manufacturer; Name; Serial; Firmware are blank. Additionally, the various sensors are incorrect. I tried to calibrate them, but not clear that that fixed anything, particularly the Battery Charge which is showing 20%.

I had just replaced the battery; it's been plugged in for a while. I used the HomeAssistant integration and it connected quickly; recognizes the model; and shows as fully charged (100%).

I can't figure out if there's a configuration problem on windows or if it's just that the software doesn't recognize this model.

Thanks,

Alan

UPS Power out showing wrong Wattage

Basically what it says in the title, my UPS has a max power out of 1400w so 20 percent arent 136w

I have been trying to add the option to manually set the maximum power myself ,but am currently failing at correctly positioning the field in the Calibration tab of the settings, and have the program calculate the power usage from that and the load percentage. I have also not managed to find out how you correctly use the .resx files and correctly sync them between each other so once i add a new button/tooltip or whatever such a line is added in all other languages

Smarter/Quieter/Indefinite Reconnection attempts

It would be useful if WinNUT could attempt to reconnect to the NUT server indefinitely. This would mean that it is quieter about the reconnection attempts. If the tools are available, then it may also be useful if WinNUT can first detect if it's even possible to make a connection first (network adapter is up & route to the NUT server is available), otherwise wait until the conditions are present.

Ref #63
@f33d13ack

Attempting to send query while disconnected

I am trying to setup WinNUT on my Windows 8 pc to be the slave to my QNAP. I have tried following the instructions in the QNAP forum post https://forum.qnap.com/viewtopic.php?f=151&t=47493

but cannot get it connected. I have SSH into the NAS and added the following to the upsmon.conf:

MONITOR qnapups@ myQNAP's ip 1 admin 123456 master

Crash_Report_19-10-2022_14-28-10.txt

WinNUT keeps encountering an error and closing. Have attached the log after most recent error.

Automate Multilingual App Toolkit Building

Ref #81

Problem

The build workflow currently doesn't use the MAT for compiling language files, which means that errors in those files won't be caught. In addition, language modifications aren't processed and won't appear in further builds until the project is compiled on a developer's environment.

Adding it to the build workflow has proven to be tricky: the 2022 edition of the extension requires an administrator's approval of a UAC prompt to continue. The GitHub-hosted runner runs commands under a pseudo-administrator account which seems to be causing the install process to halt and require acknowledgement of the UAC prompt. I can't find any combination of switches in the VSIXInstaller to make this work in the build environment. I have a VS Developer Community issue open hoping to mitigate this. I also have requested that GitHub add the extension to the runner images.

Update: It appears that the extension does end up installing, but it takes about 20 minutes to do so. May need to investigate this or find an alternative solution.

In the meantime, I attempted to setup an Azure free tier VM, but ended up using the wrong image and finding out that it was incompatible with the toolkit extension (Windows Server Core does not have UI components and other libraries necessary to install Visual Studio, which is required by the MAT.) Azure still remains an option but required a lot of effort to get off the ground last time.

I'm still making tweaks to the build workflow to make sure I understand what exactly the issue is (also proving to be difficult),

  • Find some way to elevate permissions of the runner process (like actions/runner#408, although the suggestion solution doesn't seem to work in the current environment)
    • Not actually the issue
  • Find a fix for the long extension installation issue
  • Attempt to install the VS2017+ edition of the extension, which may not require admin rights (needs verification)
    • Likely not going to work, but may be worth testing if only to speed up the installation.
  • Setup another Azure build environment with the correct image (last ditch effort)

References

Hypervisor Awareness

Feature Request.

Hoping to be able to identify which hypervisor a VM is on while the software is running. At specific intervals, detect the hypervisor name and switch to the correct NUT server. vmware/esxi, proxmox/kvm, xen/xcp-ng, hyper-v, etc. could auto migrate the VM to a different host or data center with different UPS. Maybe, the software would need a list of hypervisors associated with a specific NUT server?

Thanks

Log files still being saved in system root folder

It seems that WinNUT log files are now being saved in a folder named :\Logs instead of at AppData\Roaming as originally happened. Am running WinNUT client v 2.2.8359.21169 on Win10Pro 22H2 Build 19045.2251. Current log is C:\Logs\WinNUT-Client-2022-11-23.log on my system, previous log was C:\WinNUT-Client\Logs\WinNUT-Client-2022-11-23.log.

List Var GUI encounters format exception when trying to display list

Version 2.2.8328

The List Var GUI encounters an exception when trying to load the list of vars:

Error encountered trying to get variables from the UPS:
ENDLIST (END LIST VAR ups)
Query: GET DESC ups battery.mfr.date

Log:

10/22/2022 1:50:49 PM Pid: 15364 WinNUT : Open List Var Gui
10/22/2022 1:50:49 PM Pid: 15364 List_Var_Gui : Load List Var Gui
10/22/2022 1:50:49 PM Pid: 15364 List_Var_Gui : Populate TreeView
10/22/2022 1:50:49 PM Pid: 15364 UPS_Device : Enter GetUPS_ListVar
10/22/2022 1:50:49 PM Pid: 15364 WinNUT : Main Gui Lose Focus
10/22/2022 1:50:49 PM Pid: 15364 WinNUT : Update Icon
10/22/2022 1:50:50 PM Pid: 15364 UPS_Device : Enter Retrieve_UPS_Datas
10/22/2022 1:50:50 PM Pid: 15364 UPS_Device : Something went wrong in Retrieve_UPS_Datas: System.FormatException: Input string was not in a correct format.
   at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Double.Parse(String s, IFormatProvider provider)
   at WinNUT_Client_Common.UPS_Device.Retrieve_UPS_Datas()
10/22/2022 1:50:50 PM Pid: 15364 UPS_Device : Processing request to disconnect...
10/22/2022 1:50:50 PM Pid: 15364 UPS_Device : Socket has reported a Broken event.

Win NUT Client shows wrong values and stock at wrong value

Battery Charge is shown as 20% and stock at this value, UPS Load is shown as 100% and stock at this value.

Input Output value is shown as 220V but i think it is random, frequency (50Hz) the same problem.

Synology DS1813+ is the NUT Server and get the correct values, client is a Win 10 Pro workstation. Firewall is off for testing.

Release Building

The final step in having full CI/CD is to automate deploying (pre) releases of WinNUT on GitHub. The general structure of the workflow should look like:

  • Setup MSBuild
  • Checkout code
  • Restore packages
  • Install Multilingual App Toolkit extension
  • Build solution in Release configuration
  • Get version from Assembly
  • Finalize with automated release action on GitHub

Tasks

  • Complete multilingual automation #58
    • Not blocking release building
  • Full debug building
    • Artifact archive name follows format winnut-client-debug-[shortSHA]
    • Verify generated assemblies have correct version following msbuild format
  • Complete new updater and prepare client for production transition to ClickOnce - Depends on #97
  • Automated releases - Depends on #85
    • Tags in the format v.major.minor.build trigger a new build in the Release configuration
    • Confirm languages integrated and installer package compiled
    • Upload archive of the build output, named WinNUT-Client-v[version]-noinstall.
    • Upload ClickOnce installer published artifacts to their destination
    • Automatically generate a Release post with a generic message, to be manually added to at a later time.
  • Update documentation

WinNUT v2.0.7722.30975 Always stays disconnected after suspend/resume cycle.

Hi, I´m running WinNUT on my Surface Pro3 this is connected to a CDP UPS (monitored by NUT on OpenWRT), everything works wonderfully.

Because this is my main machine I do suspend/resume cycle various times a day, WinNUT sometimes comes back with a Max retries reached and doesn't retry connecting.
The same things happens if one of my Wi-Fi mesh AP's goes down for long enough (time to hop to next AP), it disconnects uses all retries and ends up disconnected.

Even if my network and NUT server are still up.

Could you please add code to check network status change and retry reconnection if network get disconnected / reconnected, or power status (coming out of hibernation) changes, by tracking said network status.

PC not shutting down properly

I have recently had a power outage and my pc was on. During this i observed, that the UPS battery charge dropped below the 50% i specified to shut down my computer without the PC actually shutting down.

The charge got down to 38% and no shutdown was initiated.

I have however recently upgraded to a newer version of WinNUT, but i dont think youve done any work on that part of WinNUT since then.

grafik
These are the settings used

Auto Reconnect testing failures

had reconnect issues with old repo version, see gawindx/WinNUT-Client#162

moved to this repo, testing WinNUT-Client-v2.2.8356-no_install on win10

testing auto reconnect for network path break or server restart
for the sake of this issue, i pulled a uplink cable between two switches in client/server network path

with this new version, there are reconnection attempts, and reconnection success, ...

but after auto reconnect success in winnut, there is no periodic traffic.
wireshark shows only shows 4 frames at reconnect.
debug level logs, also show no periodic attempt to get server data reconnect

manually, using menu disconnect and reconnect, reestablished normal periodic traffic flow

i can provide wireshark and debug level logs, if required.

Upgrade framework dependency from .NET Framework 4.7.2

Currently, WinNUT is dependent on the .NET Framework 4.7.2. Besides not being the latest supported version of the .NET Framework, this means that the latest version of Visual Studio supported is 2019, which is either near or passed End of Life. I would eventually like to rebuild WinNUT from the ground up (currently planning in nutdotnet/coco.nut, please provide feedback), but for now I think a Framework upgrade could be doable as a way of maintenance.

.NET Framework 4.8 is the last version of the .NET Framework, and supports as old as Windows 7 SP1 just like 4.7.2 does right now. I don't think it makes sense to try and port to .NET 5 or later, but it is recommended for new development.

This means that

  • AGauge
  • WinNUT-Client_Common, and
  • WinNUT-Client

need to be up-to-date and compiling for 4.8 without error.

Autodetect value ranges and gauge settings from UPS values

image

Running the latest downloaded version from the site, it connects fine, but we run on 120 here in the states, is there a way to set it so that it doesn't think it's on a 220 volt grid? found the "calibration" page - see my notes below though

Also, i monitor multiple ups' would be nice to be able to select which ups on the system i'm wanting to look at :D

When the client fails to connect to the UPS (because of access denied), it then also fails to generate a bug report

In my case a forbidden IP address on which the client was running caused the client to fail its connection to the UPS. This was expected. What was not expected was that the client app then failed to generate a bug report.

Here is the original error message, when the client's IP address was not yet permitted to connect to the UPS:

Exception type: WinNUT_Client_Common.NutException
Exception message: ACCESSDENIED (ERR ACCESS-DENIED)
Query: LOGOUT
Exception stack trace:
   at WinNUT_Client_Common.Nut_Socket.Query_Data(String Query_Msg)
   at WinNUT_Client_Common.Nut_Socket.Disconnect(Object silent, Object forceful)
   at WinNUT_Client_Common.UPS_Device.Disconnect(Boolean cancelReconnect, Boolean silent, Boolean forceful)
   at WinNUT_Client.WinNUT.UPSDisconnect()
   at WinNUT_Client.WinNUT.Menu_Reconnect_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The actual problem described in this issue is, however, that the client then also failed to generate a bug report:

Exception type: System.InvalidOperationException
Exception message: Collection was modified; enumeration operation may not execute.
Exception stack trace:
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
   at WinNUT_Client.My.MyApplication.Generate_Button_Click(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The attached screenshots show the same information.

error1

error2

Transtation csv (at least the german one) does not seem to affect the right click menu on the systray icon and some other places

I noticed this when searching the word "Ausgang" in the german translation csv and it did not appear there, however it is present on the mentioned right click menu in the german version.
For example the check for updates option in the csv is "Auf Updates prüfen." in the systray it is "Überprüfen sie das Update" just as within the program when you click on Help and then Check for updates.

I downloaded the newest prerelease this morning:
grafik

Ability to overwrite UPS value (Enhancement)

Basically, the ability to tell WinNUT that my UPS can output 1400 watt in my case, so that it can calculate an actual wattage from the percentage and this. Some other values could also be useful, but this one came to mind, as i just had a power outage.

Windows version not detected correctly for Toast Notifications

Windows 10 Pro 21H2 is not detected correctly by WinNUT in Release/non debug mode, and toast notifications are turned off.

10/22/2022 1:50:45 PM Pid: 15364 Logger : Log file is initialized at C:\WinNUT-Client\Logs\WinNUT-Client-2022-10-22.log
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial Input Voltage Need to be Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial Input Voltage Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial Input Frequency Need to be Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial Input Frequency Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial Output Voltage Need to be Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial Output Voltage Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial UPS Load Need to be Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial UPS Load Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial Voltage Battery Need to be Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Parameter Dial Voltage Battery Updated
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : WinNut Preferences Applied.
10/22/2022 1:50:45 PM Pid: 15364 String : New Log to CB_Current Log : WinNut Preferences Changed
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Loaded Params Complete
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : NotifyIcons Initialised
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Windows 10 Toast Notification Not Available. Too Old Windows Version
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Windows App Use Dark Theme
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Windows Use Dark Theme
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : NotifyIcon Text => 
WinNUT Client - 2.2
Not Connected
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Status Icon Changed
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : New Icon Value For Systray : 1216
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : New Icon Value For Gui : 1216
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : Update Icon at Startup
10/22/2022 1:50:45 PM Pid: 15364 WinNUT : WinNUT Client v2.2.8328.30469 completed initialization.

Folder "C:\WinNUT-Client" created at each app launch

A folder on drive root at "C:\WinNUT-Client" is created at each time the application is started.
Since WinNUT is installed at "C:\Program Files (x86)\WinNUT-client" on my system, this folder on drive root should not be created each time.
Running latest pre-release: 2.2.8359.21169 (from about window).

Comments needed in the translation.csv files

When making some updates to the german translation file, i noticed that some of the lines definitely need some comments that gives some context and some explanation on what it actually means, because some of the longer lines can have more than one meaning or can even have multiple meanings

I would suggest that longer lines definitely need context and an explanation, short lines may sometimes need some context, so it is clear where the translation will appear, as in other languages "Close" may translate to the equivalent of "Close Window" or "Close Program" in that other language, where for example it could be schließen for closing a window and beenden for closing a program

Such comments would probably be best written in english

Exception type: System.NullReferenceException (v2.2.8253)

`WinNUT Bug Report
Os Version : 10.0.19043.0
WinNUT Version : 2.2.8253.28732

WinNUT Parameters :
{
"Delay": 5000,
"AutoReconnect": "True",
"MinInputVoltage": 220,
"MaxInputVoltage": 250,
"FrequencySupply": 0,
"MinInputFrequency": 40,
"MaxInputFrequency": 60,
"MinOutputVoltage": 210,
"MaxOutputVoltage": 250,
"MinUPSLoad": 0,
"MaxUPSLoad": 100,
"MinBattVoltage": 6,
"MaxBattVoltage": 18,
"MinimizeToTray": "True",
"MinimizeOnStart": "True",
"CloseToTray": "True",
"StartWithWindows": "True",
"UseLogFile": "False",
"Log Level": 0,
"ShutdownLimitBatteryCharge": 0,
"ShutdownLimitUPSRemainTime": 0,
"ImmediateStopAction": "False",
"Follow_FSD": "False",
"TypeOfStop": 1,
"DelayToShutdown": 15,
"AllowExtendedShutdownDelay": "False",
"ExtendedShutdownDelay": 15,
"VerifyUpdate": "True",
"VerifyUpdateAtStart": "True",
"DelayBetweenEachVerification": 1,
"StableOrDevBranch": 0,
"LastDateVerification": "06.08.2022 21:22:48"
}

Error Message :
Exception type: System.NullReferenceException
Exception message: Odkaz na objekt není nastaven na instanci objektu.
Exception stack trace:
v WinNUT_Client.Update_Gui.VerifyUpdate() v C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WInNUT_GUI\Update_Gui.vb:řádek 64
v WinNUT_Client.Update_Gui.SetVisibleCore(Boolean value) v C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WInNUT_GUI\Update_Gui.vb:řádek 50
v System.Windows.Forms.Control.set_Visible(Boolean value)
v WinNUT_Client.WinNUT.WinNUT_Load(Object sender, EventArgs e) v C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WInNUT_GUI\WinNUT.vb:řádek 282
v System.EventHandler.Invoke(Object sender, EventArgs e)
v System.Windows.Forms.Form.OnLoad(EventArgs e)
v System.Windows.Forms.Form.OnCreateControl()
v System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
v System.Windows.Forms.Control.CreateControl()
v System.Windows.Forms.Control.WmShowWindow(Message& m)
v System.Windows.Forms.Control.WndProc(Message& m)
v System.Windows.Forms.ScrollableControl.WndProc(Message& m)
v System.Windows.Forms.Form.WmShowWindow(Message& m)
v System.Windows.Forms.Form.WndProc(Message& m)
v System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
v System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
v System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Last Events :
07.08.2022 9:51:51 Pid: 16808 WinNUT : Initialisation Globals Variables Complete
07.08.2022 9:51:51 Pid: 16808 WinNUT : Initialisation Params Complete
07.08.2022 9:51:51 Pid: 16808 WinNUT : Loaded Params Complete
07.08.2022 9:51:51 Pid: 16808 WinNUT : Logging is configured.
07.08.2022 9:51:51 Pid: 16808 WinNUT : NotifyIcons Initialised
07.08.2022 9:51:51 Pid: 16808 WinNUT : Windows 10 Toast Notification Available
07.08.2022 9:51:51 Pid: 16808 WinNUT : Windows App Use Light Theme
07.08.2022 9:51:51 Pid: 16808 WinNUT : Windows Use Dark Theme
07.08.2022 9:51:51 Pid: 16808 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
Not Connected
07.08.2022 9:51:51 Pid: 16808 WinNUT : Status Icon Changed
07.08.2022 9:51:51 Pid: 16808 WinNUT : New Icon Value For Systray : 1216
07.08.2022 9:51:51 Pid: 16808 WinNUT : New Icon Value For Gui : 1152
07.08.2022 9:51:51 Pid: 16808 WinNUT : Update Icon at Startup
07.08.2022 9:51:51 Pid: 16808 WinNUT : Run Automatic Update
`

Sleep Mode not working

So i have been going through the old repository and this issue was a big one for a lot of windows 10 users, but i never did work out the solution.
I was then told to come to here and try the pre-releases and report back.
Either i am stupid, or my setup is not working correctly, but I have tried several pre releases and nothing will put my PC to sleep, I don't even get the dialog box with the 15 second timer.
Everything connects, all gauges work, when it goes to battery it turns yellow, but the ID status at the bottom never changes,
I have tired the install files and uninstalled each time from add remove programs, I have tried the zip files and just extracting them to a folder and running it as a standalone. Nothing is working for me.

Is there something i need to maybe need to clear from the registry or something?
I notice every time i run an new version, even if the pervious one was uninstalled, it remembers all my setting like IP address, port number ups name password etc, so I can only assume that that SOMETHING is still in the machine even after an uninstall.

What am I doing wrong
WinNUT-Client on Windows 10 Ver 21H2
NUTserver on Pi 3b+

Crash on opening the "about" window

This occurs when opening the "about" window

WinNUT Bug Report
Os Version : 6.2.9200.0
WinNUT Version : 2.2.8254.18205

WinNUT Parameters :
{
"Delay": 1000,
"AutoReconnect": true,
"MinInputVoltage": 220,
"MaxInputVoltage": 245,
"FrequencySupply": 0,
"MinInputFrequency": 49,
"MaxInputFrequency": 51,
"MinOutputVoltage": 220,
"MaxOutputVoltage": 245,
"MinUPSLoad": 0,
"MaxUPSLoad": 100,
"MinBattVoltage": 18,
"MaxBattVoltage": 30,
"MinimizeToTray": true,
"MinimizeOnStart": true,
"CloseToTray": true,
"StartWithWindows": true,
"UseLogFile": true,
"Log Level": 3,
"ShutdownLimitBatteryCharge": 50,
"ShutdownLimitUPSRemainTime": 600,
"ImmediateStopAction": true,
"Follow_FSD": false,
"TypeOfStop": 2,
"DelayToShutdown": 15,
"AllowExtendedShutdownDelay": false,
"ExtendedShutdownDelay": 15,
"VerifyUpdate": true,
"VerifyUpdateAtStart": false,
"DelayBetweenEachVerification": 0,
"StableOrDevBranch": 0,
"LastDateVerification": ""
}

Error Message :
Exception type: System.NullReferenceException
Exception message: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Exception stack trace:
bei WinNUT_Client.About_Gui.Btn_OK_Click(Object sender, EventArgs e)
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Last Events :
08.08.2022 12:02:09 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.current.nominal
08.08.2022 12:02:09 Pid: 7660 UPS_Device : UPS is On Line
08.08.2022 12:02:09 Pid: 7660 WinNUT : Updating UPS data for Form.
08.08.2022 12:02:09 Pid: 7660 WinNUT : Battery Charged
08.08.2022 12:02:09 Pid: 7660 WinNUT : Update Dial
08.08.2022 12:02:09 Pid: 7660 WinNUT : Update Icon
08.08.2022 12:02:09 Pid: 7660 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
In Verbindung gebracht
Online
Batteri...
08.08.2022 12:02:09 Pid: 7660 WinNUT : Battery Status => Charged
08.08.2022 12:02:10 Pid: 7660 UPS_Device : Enter Retrieve_UPS_Datas
08.08.2022 12:02:10 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.serial
08.08.2022 12:02:10 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving battery.runtime
08.08.2022 12:02:10 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving output.frequency
08.08.2022 12:02:10 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.realpower.nominal
08.08.2022 12:02:10 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.power.nominal
08.08.2022 12:02:10 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.current.nominal
08.08.2022 12:02:10 Pid: 7660 UPS_Device : UPS is On Line
08.08.2022 12:02:10 Pid: 7660 WinNUT : Updating UPS data for Form.
08.08.2022 12:02:10 Pid: 7660 WinNUT : Battery Charged
08.08.2022 12:02:10 Pid: 7660 WinNUT : Update Dial
08.08.2022 12:02:10 Pid: 7660 WinNUT : Update Icon
08.08.2022 12:02:10 Pid: 7660 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
In Verbindung gebracht
Online
Batteri...
08.08.2022 12:02:10 Pid: 7660 WinNUT : Battery Status => Charged
08.08.2022 12:02:11 Pid: 7660 UPS_Device : Enter Retrieve_UPS_Datas
08.08.2022 12:02:11 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.serial
08.08.2022 12:02:11 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving battery.runtime
08.08.2022 12:02:11 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving output.frequency
08.08.2022 12:02:11 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.realpower.nominal
08.08.2022 12:02:11 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.power.nominal
08.08.2022 12:02:11 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.current.nominal
08.08.2022 12:02:11 Pid: 7660 UPS_Device : UPS is On Line
08.08.2022 12:02:11 Pid: 7660 WinNUT : Updating UPS data for Form.
08.08.2022 12:02:11 Pid: 7660 WinNUT : Battery Charged
08.08.2022 12:02:11 Pid: 7660 WinNUT : Update Dial
08.08.2022 12:02:11 Pid: 7660 WinNUT : Update Icon
08.08.2022 12:02:11 Pid: 7660 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
In Verbindung gebracht
Online
Batteri...
08.08.2022 12:02:11 Pid: 7660 WinNUT : Battery Status => Charged
08.08.2022 12:02:12 Pid: 7660 UPS_Device : Enter Retrieve_UPS_Datas
08.08.2022 12:02:12 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.serial
08.08.2022 12:02:12 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving battery.runtime
08.08.2022 12:02:12 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving output.frequency
08.08.2022 12:02:12 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.realpower.nominal
08.08.2022 12:02:12 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.power.nominal
08.08.2022 12:02:12 Pid: 7660 UPS_Device : Apply Fallback Value when retrieving ups.current.nominal
08.08.2022 12:02:12 Pid: 7660 UPS_Device : UPS is On Line
08.08.2022 12:02:12 Pid: 7660 WinNUT : Updating UPS data for Form.
08.08.2022 12:02:12 Pid: 7660 WinNUT : Battery Charged
08.08.2022 12:02:12 Pid: 7660 WinNUT : Update Dial
08.08.2022 12:02:12 Pid: 7660 WinNUT : Update Icon
08.08.2022 12:02:12 Pid: 7660 WinNUT : NotifyIcon Text =>
WinNUT-Client - 2.2
In Verbindung gebracht
Online
Batteri...
08.08.2022 12:02:12 Pid: 7660 WinNUT : Battery Status => Charged

Does not re-establish connection, but says it has...

This is the first version I've ever downloaded of the Windows NUT Client, so I'm a new, here.
I've currently been using an older, WinNUT 2.0.0.4a, for the last few years, which is installed as a service.

v2.2.8359.21169, Windows 10 Pro, 21H2 Build 19044.2251

If I disconnect or disable the ethernet adapter and reconnect it again, or when my VPN starts if the NUT already had an established connection,
Then, once the NUT tries to re-establish connection, and says that it HAS re-established connection... it really hasn't, and the yellow reconnection icon stays yellow (top left corner of Pic1), and also the gauges stay frozen (Pic1), and if I try to get the UPS variable at this time, it throws back an error (Pic2).
I've also tested a power failure and it does not respond, unless I click to Reconnect manually, then the power failure will trigger.

If I click to Reconnect the connection after the VPN is connected... it's fine,
If I disconnect the VPN... it's also fine, as long as I don't disconnect the ethernet connection,
If I restart the VPN... it shows the yellow reconnect icon, says it's established, but again.. it actually hasn't.

Pic1
Screenshot 2022-11-24 175902

Pic2
Screenshot 2022-11-24 180647

Increasing battery max in Calibration extends the gauge instead of adjusting scale.

WinNUT Version: v2.1.7740.35837
Windows OS Version: 11 x64

Describe the bug
I increased the max to 28 as my charged battery sits at around 27.1 and expected the gauge to remain same size and the data on it to "shrink", instead the gauge grew a new notch triggering my imagined ocd how it's all uneven now.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Settings/Calibration'
  2. Increase Battery Max to 28
  3. ???
  4. See error

Expected behavior
The gauge should not change, instead the scale of the data on it should.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11 x64 Version 21H2, Build 22000.832, Windows Feature Experience Pack 1000.22000.832.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.