prevent windows 7 sleep while files are being accessed by network

7

2

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).

frumbert

Posted 2015-08-11T10:21:48.173

Reputation: 547

Answers

3

In the advanced power options for your current power plan, you can disable going to sleep when media is being shared from the computer.

It's located under 'multimedia settings'>'When sharing media':

enter image description here

cascer1

Posted 2015-08-11T10:21:48.173

Reputation: 1 762

Oh, since I do NOT have media streaming on, I didn't think about this option, and it doesn't seem to work anyway. The remote device is set to use smb://pc/sharename as its source. – frumbert – 2015-08-11T21:27:16.483

@frumbert I'm afraid I can't help then :c – cascer1 – 2015-08-12T09:16:20.277

1

You will need an external application like "Coffee" to keep your PC awake:

https://sourceforge.net/projects/coffee-sc/

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:

enter image description here

HackSlash

Posted 2015-08-11T10:21:48.173

Reputation: 3 174

this is exactly what I was looking for, can you choose protocol? (smb for instance) – AK_ – 2017-12-30T12:09:33.397

It appears to be cumulative. The good news is that it's open source. You could write your own version with protocol selection and make a pull request for the author to include your version in an official release. – HackSlash – 2018-01-02T16:08:55.603

0

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.

Jimadine

Posted 2015-08-11T10:21:48.173

Reputation: 832