-
Notifications
You must be signed in to change notification settings - Fork 19
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
Sleep Mode not working #27
Comments
Hi @DravenSA , thank you for posting here. I thought power mode bugs were fixed, but it sounds like there's more work to do. Settings are currently stored in the registry and uninstalling doesn't remove them. Ideally old settings shouldn't cause a bug like this, so let's get a better understanding of what's going on and maybe I can put out another patch. Would you please make sure you have the latest pre-release from here, then run it and try to reproduce the problem? After that, generate a bug report from the file menu and upload or paste it here. Thank you! Related #2 |
Thanks for the response, sorry it took so long to get this done, But we have a thing in South Africa called Load Shedding , the power company kills our electricity to our homes for 2- 4 hours at least twice a day right now, maddens I know.
Hope it help? Oh and i am using the pre release WinNUT-Setup-v2.2.8303.msi |
Have my logs not helped? or have i posted the wrong thing? |
Sorry about that, I've been trying to setup a CI pipeline for the project but very much appreciate your log. So it looks like preferences are changed a few times, then the UPS goes on battery approximately around 15:58:15, does that sound right? I'll need to take a look at the code. Some fairly major changes have occurred around the area of detecting battery events, so that could be what's happening here. I'll try to get to it in the next couple of days and keep you updated. |
According to the logs, yeah, looks like it. In the next 2 - 15 minutes we will have the power turned off due to our wonderful power provider, then we will switch over to a generator, I will post the logs again, but i will look for a smaller section for you. |
So as predicted, the power went out. Below is the logs from just before it went off until i get the generator on, so it is a little long, but you can see that the values only really seams to change at switch over. There is nothing i see in the logs to say battery percentage, which is what i would like my setting to be rather than time. anyway here are the logs
Hope it helps a little more |
I'm seeing some conflicting information being presented at exactly the same time. I think the debugging messages could be reworked a little, and I'm also taking the chance to upgrade the UI. Stay tuned & thank you for the help. |
Apologies for the long wait on this - I was busy working on a build automation system to make testing a little easier. I've made some fairly large changes and I'd like to ask you to be my Guinea Pig. It turns out that the stop actions system was disabled quite some time ago, so I've also turned it back on. Please download the latest debug build here and let me know how it goes. |
Hi there, Unfortunately still not working.
|
I think I see the problem - it looks like the code to activate the shutdown event would never actually be called. I've moved some things around, please download build 8319 and let me know how that goes. (I'll try to setup my own NUT server so you don't have to test as much...) |
Hey, that's progress! I went through the code for the Shutdown_Gui and cleaned it up, while also fixing the NRE error you encountered. Go ahead and download the new build here. Thank you! |
Seems like success, It put the PC to sleep.
I ran another simulation [Id 4: 2022/10/12 08:45:36] Restarting WinNUT after waking up from Windows. when i selected Connection and reconnect it crashed, here is the report
Thanks |
Thanks again for your testing reports. I'm happy to report that I was able to setup a NUT server on my dev machine so I can do some simulations of my own and won't have to make you test every change. I think I've fixed both problems you've reported above - I was able to auto hibernate and resume with WinNUT making the connection automatically. A fresh new build is ready, please give it a go and let me know of the results. |
Sleep works a treat, nice and clean. after waking PC up, i noticed that in the dropdown box it said "[Id 13: 2022/10/13 08:45:54] Try Reconnect 1 / 30" waited over a minute, and it never changed, however the plus side of that is selecting Connection => Reconnect did work. All my testing so far has been on Sleep, I have not yet tried Hibernate. Would you like me to test that too?
|
Glad to hear that sleep mode is working better! It looks like you caught a rare bug where WinNUT found its self in a strange state (resuming from a suspended state while still connected) and it tried to repair the connection. It managed to make it nearly the whole way but didn't resume updating data for some reason. I can't see a reason why it became stuck like that, but what I did find out is that Windows is not consistent in reporting power state change events to programs, so I've moved some code around to make sure that WinNUT isn't caught in a state like that again. I don't think you should have to test hibernation as long as sleep is your preferred method, since they're all basically a shutdown event as far as WinNUT is concerned. Once again, thank you for your persistence, and another debug build with the aforementioned fixes awaits you here. Edit: Also want to tag issue #4 since these seem to be related. |
It looks like the issue was that WinNUT was cancelling the autoreconnect process after just one error while reconnecting. I've fixed that so it shouldn't do it anymore, please try build 8322 here. I'm still seeing broader issues with UI inconsistencies and freezes while a connection is dropped or reconnected, but I think that may be for another bug if at all. |
Wow, this has been a tough one. I think the issue is that your PC's (and most, to be honest) networking is not immediately ready when it resumes from a suspended state. I haven't seen this issue since my NUT server is running in a VM and therefor immediately available on resume. So it looks like the core problem is that, when resuming from a suspended state, WinNUT only tries to reconnect once and doesn't launch the reconnection procedure after a connection failure. I've changed it so that it will now do this and attempt the specified number of times to reconnect.
Actually this was hard coded to 30 seconds in the program, but I had it set to five seconds for testing. I've now set it to five seconds no matter what. This could be a user preference, but I need to dive into and understand localizations before I start adding strings everywhere for the user to see. Another build is up, please give it a try! And thank you for getting back so quickly. |
That's great to hear! You're welcome, and I appreciate your help on this. I'm going to merge the changes and close this issue, then I should have an official pre-release out pending one or more other issues. Have a good night! |
Re-activate stop actions system, fix resume issues and status updates overhaul. Closes #27
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+
The text was updated successfully, but these errors were encountered: