winleafs / Winleafs

Winleafs: Windows application for Nanoleaf lights
GNU General Public License v3.0
85 stars 9 forks source link

Winleafs closes when PC goes to sleep, therefore does not activate lights when PC awakes #123

Closed Gibso86 closed 3 years ago

Gibso86 commented 4 years ago

Hi guys,

I've set up a schedule for every day at 8am to trigger screen mirror, "turn lights off at application ..." is ticked. This works fine when I sleep my PC, the lights go off. However when I resume the PC Winleafs is no longer loaded, it's closed, so the lights stay off. I have to open winleafs again and the schedule trigger kicks in and the lights work as intended.

When I resume the PC you can see the winleafs icon in the taskbar, but when you hover over it, it disapears, indicating the program has closed.

I've attached logs.

Logs attached. logs.txt

Have I done anything wrong to cause this? Help much appreciated!

bartdebever commented 4 years ago

Thank you for the report, after having a quick look through the code I might have an idea to deploy a fix. I'll be looking into reproducing the bug soon.

Apologies for the inconvenience

Gibso86 commented 4 years ago

Great, thanks! I should add that it did just seem to work after sleep then wake. But then the lights stayed on after sleeping again and appear frozen in color, even after PC wakes.

I unticked "turn lights off...: in my schedule, saved, then reticked the box and saved again, then put PC to sleep. This then turned the lights off again.

On Fri, 19 Jun 2020, 23:31 Bart de Bever, notifications@github.com wrote:

Thank you for the report, after having a quick look through the code I might have an idea to deploy a fix. I'll be looking into reproducing the bug soon.

Apologies for the inconvenience

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/winleafs/Winleafs/issues/123#issuecomment-646882741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAPNEUGH4TSOGQHX5S6D2TRXPRLTANCNFSM4ODCTHSQ .

StijnOostdam commented 4 years ago

Your logs suggests that you tried to activate Screen mirror at 23:03 and 23:09. Did you do that by hand or was that the schedule? Could you send more logs from around the time your PC went to sleep? There should be a line where Winleafs sends a request to turn the lights off by sending state: "off".

And do you have logs from when the PC awakes? My guess is that you don't, since Windows decides to close Winleafs when it goes to sleep. Apperently the lights shut off automatically when the PC goes to sleep, which means Winleafs has been closed. Hence you have to manually start it again.

@bartdebever we should look into preventing Winleafs from closing when the PC goes to sleep.

StijnOostdam commented 4 years ago

@Gibso86 Suggestion: enable the program to start with Windows, maybe that makes the program start automatically again.

Gibso86 commented 4 years ago

Hi guys, the sleep would of been manual as the schedule is 8am every day, nothing else. I have both "Start at windows..." and "Mininimse to tray" ticked in the options. Winleafs is also in my startup folder / apps.

I do not have any more logs atm as I currently have the nanoleafs unplugged to do decorating. I'll add more logs once they are connected again.

I have just noticed however that winleafs now appears to be staying active during sleep and wake. Something to do with the nanoleafs not being live / plugged in? Just tested this 4 times and every time winleafs remained.

StijnOostdam commented 4 years ago

I have just noticed however that winleafs now appears to be staying active during sleep and wake.

Then my assumption has been wrong.

Something to do with the nanoleafs not being live / plugged in?

Probably yeah. Please let us know if you have any logs from when your PC goes to sleep and wakes up, that will help us I think.

Gibso86 commented 4 years ago

Hi guys, I've done some more tests for you. I've attached the logs and put a sentence underneath each log entry for each test. multi logs.txt

StijnOostdam commented 4 years ago

Hey, thanks for the extensive testing! So something odd is happening: in each set of logs there are some failed requests. Some for external control (screen mirror) but also normal commands seem to fail. Any idea why that is happening? Does everything work when you enable screen mirror via the device dropdown (or any other effect)?

Maybe if we know why those requests fail, we can determine what is the problem.

Gibso86 commented 4 years ago

Unfortunately winleafs isn't working at all now... logs2.txt

EDIT: think I've solved this by going to properties and ticking Run as Administrator

StijnOostdam commented 4 years ago

Ah, by chance, that is a crash that I have fixed with my latest commit. That happens when Winleafs checks for updates at startup, but you have no active internet connection (or Github is offline).

Maybe you could try to delete you settings (or make a back up) in %appdata%/Winleafs and try adding your device again

If you download v1.0.5 then your last crash is fixed https://github.com/winleafs/Winleafs/releases/tag/v1.0.5

StijnOostdam commented 4 years ago

Hey, I have updated the v1.0.5 isntaller with more logging https://github.com/winleafs/Winleafs/releases/tag/v1.0.5. Could you try to reproduce the bug with this new version and give us the new logs?

StijnOostdam commented 4 years ago

Hey, did you have any chance to try the update?

StijnOostdam commented 3 years ago

Closing due to inactivity. @Gibso86 or anyone else feel free to open this issue when you encounter this problem again.