nutdotnet / WinNUT-Client

WinForms-based client for monitoring your Uninterruptible Power Supply (UPS) connected to a Network UPS Tools (NUT) server.
GNU General Public License v3.0
209 stars 19 forks source link

WinNUT incorrectly displays a "Not Connected" notification on Resume #145

Open yoyoma2 opened 6 months ago

yoyoma2 commented 6 months ago

WinNUT Version: v2.2.8719.24624 Windows OS Version: Windows 10 Pro 22H2

Describe the bug When Windows 10 resumes from hibernation, WinNUT notifications falsely show that it connected then disconnected. It appears that this is a false alarm as WinNUT seems to be connected. The logs below show that the disconnection happens first and the connection happens later albeit the timestamp is identical which may explain the misordered notifications.

To Reproduce Steps to reproduce the behavior:

  1. Configure Win10 to hibernate and wait for it to happen
  2. Come back hours later and wake up Windows
  3. Look at Windows notifications in the image (most recent notification is at the top):

Expected behavior The "Connected" notification should appear last since it happened last. Ideally the "Not Connected" notification should appear much earlier when the sleep state is initiated. If I manually shutdown Windows, the "Not Connected" notification is tagged with the time the shutdown was initiated.

Screenshots WinNUTbug

Additional context I tried to hibernate manually and immediately resume and that didn't reproduce the problem. I guess the long hibernating time leaves the sockets in a different state than the manual immediate hibernate/resume.

WinNUT-Client-2024-03-28.log upsvars.txt

gbakeman commented 5 months ago

I definitely noticed some spammy notifications too, usually when resuming a session. I'll look into this.

gbakeman commented 2 months ago

@yoyoma2 I'm about to put up another pre-release with some connection and operational fixes included. I'd like to hear from you if you think I've improved this problem or not. Thanks!

yoyoma2 commented 2 months ago

@yoyoma2 I'm about to put up another pre-release with some connection and operational fixes included. I'd like to hear from you if you think I've improved this problem or not. Thanks!

Sure I'll try a July Pre-Release when I see it posted.

gbakeman commented 2 months ago

The new pre-release is up - please let me know what you think!

yoyoma2 commented 2 months ago

Installed pre-release v2.3.8970 (when running v2.3.8971 appears in the about box however).

The old settings were imported (nice!) but I had to change one calibration setting by 1V then change it back or some of the dials were showing default ranges instead of my custom settings.

As for better suspend/resume support I'll need to test that a little later when the system isn't in use.

gbakeman commented 2 months ago

Good catch on the gauge calibrations, I noticed that too at some point or another but forgot to open an issue about it. Feel free to subscribe to #170 if that's something you're interested in seeing fixed.

Thanks for checking in and in advance for testing this further!

yoyoma2 commented 2 months ago

After coming out of hibernation there were no notifications and the icon in the taskbar had some red on it. Going to Connection->Reconnect fixed everything. I'll try to reproduce with some logs next time.

gbakeman commented 2 months ago

I'm actually curious if you can test with the build here (once you get the chance) since I've addressed more notification and connection issues since the pre-release. Thanks!