I have movies and stuff that is accessed from the lan (via xbmc/kodi, usually) that reside on my Windows 7 box. I want the machine to be able to go into sleep mode when files are NOT being accessed, if I happen to not be using the machine. Wake on Lan (magic packet) is enabled in the bios and on the network card, but it doesn't seem to be enough. Wait for network is also set in XBMC, which I imagine to send that flag. My ideal situation is that the computer goes to sleep as soon as no network is used (as long as there's nobody using the computer itself).
You will need an external application like "Coffee" to keep your PC awake:
This little open-source software project allows you to set thresholds, like if you are uploading more than 10KB per second the computer should not sleep. Take a look at what your traffic patterns are and set it to something not too high and not too low. Windows will generate traffic all the time and if your threshold is too low then Windows will keep itself awake just talking to itself on the network.
Example of what settings you get:
I was searching for an answer to a quite similar question to yours. I'm using Kodi as the client on a Raspberry Pi accessing a Windows (SMB) Share on a Win7 box. I would like to prevent the Win7 box from sleeping if Kodi is still reading files over the network i.e. I'm watching a video.
I believe this is a non-issue, because Windows will issue a "stay awake" -type request to power management, suspending sleep, when it detects the share being accessed.
To provide some evidence for this, on the Win7 box from an elevated command prompt, type
powercfg /? and it will explain:
-REQUESTS Enumerate application and driver Power Requests. Power Requests prevent the computer from automatically powering off the display or entering a low-power sleep mode.
Then play back some content via Kodi.
Next, back in your elevated command prompt, type
powercfg -REQUESTS. You should see the following:
DISPLAY: None. SYSTEM: [DRIVER] \FileSystem\srvnet An active remote client has files opened on this machine. [DRIVER] \FileSystem\srvnet An active remote client has recently sent requests to this machine. AWAYMODE: None.
I'll confess that I haven't tested how this pans out in practice. However, in theory you should be able to use a Balanced power plan in Windows whilst still being able to watch content using Kodi, without Windows going to sleep part way through.