Our forum migration to Discourse is underway and scheduled to last through June 21. During the migration, the forums will be read-only, except for a single temporary forum (contents of which will not be getting transferred). Read our announcement post for more information about the forum migration.
Hey folks, there is a new Podcast category for forums https://forums.plex.tv/categories/podcasts
If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Guide: Automatic Sleep and Wake-up from any device / location

machyy1machyy1 Members, Plex Pass Posts: 10 Plex Pass

So, I don't want my computer running 24 hours a day, chewing up electricity when it is not in use.  My server uses a little over 100 watts when on, and only 2 watts when it is sleeping.  

 

For those that don't know why this is important, the math:

 

100 watts saved

18 hours a day my computer could be sleeping

30 days a month


1000 watts per kilowatt

 

= 54 kilowatt hours (kwh) per month

@ $0.2424 per kwh (Massachusetts rate)

= $13 a month

 

With a little configuration work, I am able to save that $13 a month in electricity.

 

 

For anyone who wants to make this work, it is possible, and I've got it running.   Here are the short requirements:

 

1) PMS server with WOL enabled

2) DDWRT router with automatic WOL to VLAN enabled

3) WinOff software to prevent PMS server from sleeping when serving up content

 

 

Detailed instructions:

 

1)  Your computer running PMS must support Wake-On-Lan (WOL).  You'll need to enable WOL in both the bios (check your motherboard's website for instructions in the manual for it), and you need to enable WOL in your operating system (for Windows 7, here is a good guide: http://windows7-issues.blogspot.com/2011/03/wake-on-lan-wol-for-windows-7-made-easy.html)

 

After configuring for WOL, you should put your PMS computer to sleep, and then try to wake it up with WOL software (search google, there are lots of freebies to do this).  This is to make sure that your computer wakes up to a "magic packet" that tells your computer to wake up.  Once working, proceed to step 2.

 

2)  The next challenge is that the Plex clients (or other services if your server is doing stuff additional to PMS) don't send a "magic packet" when you tr to connect to your PMS server.  So, we will use a router with DDWRT to watch for network traffic going to the PMS server, and when it sees the network traffic going to the PMS server, the router will check (by pinging) if the PMS server is awake, and if it is not awake, the router will send the "magic packet" automatically.

 

This will require a router with DDWRT installed.

 

Next, the server needs to be put on its own VLAN (technically the router can only monitor traffic between VLAN's, not to individual devices).  Here is a tutorial on putting port 4 on its own VLAN: https://aaka.sh/patel/2011/07/17/creating-isolated-vlan-ddwrt-wnr3500l/

 

Next, a logging script, and a wake on lan script need to be added to the router: http://wetzelrice.com/?q=blog/how-to-automatically-wol-a-local-or-remote-server-using-dd-wrt

 

At this point, anytime traffic is sent to the VLAN on port 4 (which should only have your PMS server on it), from a device inside your network or outside your network, the router will check if the PMS server is awake, and if not, will send a "magic packet" to wake the PMS server up.

 

 

3)  WinOff software (free) setup to monitor outbound traffic and only put computer to sleep when there has been no outbound traffic for a period of time (I've set mine to 15 minutes):  http://www.ampsoft.net/utilities/WinOFF.php

 

 

 

Enjoy :)

«1

Comments

  • DwainnDwainn Members, Plex Pass Posts: 363 Plex Pass
    I still don't understand why this has been added to PHT at least. Isn't it based on Kodi? There is built on wake on lan in Kodi.
  • xthornzxxthornzx Members, Plex Pass Posts: 1 Plex Pass

    This really needs to become a built-in feature for people who don't have the necessary hardware (Router allowing VLANs) or knowledge to setup DD-WRT or OpenWRT. :\

  • patroklosppatroklosp Members Posts: 51 ✭✭

    Totally agree.Please fix!

    Mobo: Asus P5KPL-AM | CPU: Intel Core 2 Duo E8400, 3GHz | RAM: Kingston 2x2GB | VGA: Geforce GTS 450 | SSD: Samsung SSD 840 Pro Series 128GB | HDD: Western Digital WD20EARX 2TB | PSU: ARCTIC A-500CX | Monitor: Philips 170S

  • mavrrickmavrrick Members, Plex Pass Posts: 841 Plex Pass
    This can't be baked in as it depends on a magic packet from a always on device. In the example the op made it is the router sending the magic packet.

    WOL has nothing to do with Plex and all to do with network and server hardware/os config. It would be nice certainly but not as simple as just add it to the PMS.

    Sent from my SAMSUNG-SM-N900A using Tapatalk
  • Jonathan VogelbuschJonathan Vogelbusch Members, Plex Pass Posts: 73 Plex Pass
    edited June 2015

    I have flashed OpenWRT onto my Raspberry Pi.

    My network is set up as follows:

    I have both my plex media Server and Pi connected to a TP-Link Archer C2

    The Archer can't be flashed with DDWRT. My Pi is thus set as a DHCP-Client of the Archer...

    any idea how i can achieve the above with this setup?

    My idea was port forwarding to the pi where the "magic" would happen. I have however no idea how to do this...

  • steffanspsteffansp Members Posts: 1
    mavrrick wrote on May 16 2015, 1:53 PM: »

    This can't be baked in as it depends on a magic packet from a always on device. In the example the op made it is the router sending the magic packet.

    WOL has nothing to do with Plex and all to do with network and server hardware/os config. It would be nice certainly but not as simple as just add it to the PMS.

    Sent from my SAMSUNG-SM-N900A using Tapatalk

    Many routers also support wake on wan. If the routers support that, it is very easy to add it to PMS.

  • labashosky2010labashosky2010 Members, Plex Pass Posts: 142 Plex Pass

    Thanks machyy1, Just used this to setup my router(netgear WNR3500v2 w/DD-WRT) to wake up my plex computer.

    here are some random gotchas on my setup;
    1) had to set the VLANs via nvram, then finished the config via the GUI
    2) when I setup the extra VLAN it broke the standard DHCP service (had to enable DNSMasq, local DNS, and specify DCHP servers for both VLANs)
    3) ping was being blocked by the windows firewall on the plex computer (pings are restricted to local subnet by default)
    4) had to CLEAN JFFS before i could save the script to /jffs/

  • starbetrayerstarbetrayer Members, Plex Pass Posts: 3,309 Plex Pass

    @mavrrick said:
    This can't be baked in as it depends on a magic packet from a always on device. In the example the op made it is the router sending the magic packet.

    WOL has nothing to do with Plex and all to do with network and server hardware/os config. It would be nice certainly but not as simple as just add it to the PMS.

    Sent from my SAMSUNG-SM-N900A using Tapatalk

    I totally agree with you

  • urmomnomurmomnom Members, Plex Pass Posts: 19 Plex Pass

    Why would it be difficult to just have the Plex client App send a magic packet to the server over the local network? The Fire and Roku (or other devices) don't need to support WOL, the Plex app running on the Fire and Roku just need to send the magic packet to the server, that should be able to be done in software.

    I've seen the Roku can be setup to use a channel to send a magic packet, so clearly it's not a hardware limitation, at least not on Roku and I expect not on any of the Plex supported hardware. You just make the plex app send the packet if it doesn't find the server and wait a few seconds for a response. Probably very much the same as it's current behavior, except it addition to looking for missing server and re-negotiating the login, it sends a magic packet. It should be very little coding and pretty darn easy to test if it's working.

  • DwainnDwainn Members, Plex Pass Posts: 363 Plex Pass
    edited February 2016

    @starbetrayer said:

    @mavrrick said:
    This can't be baked in as it depends on a magic packet from a always on device. In the example the op made it is the router sending the magic packet.

    WOL has nothing to do with Plex and all to do with network and server hardware/os config. It would be nice certainly but not as simple as just add it to the PMS.

    Sent from my SAMSUNG-SM-N900A using Tapatalk

    I totally agree with you

    Why would you need an always on device? That defeats the purpose of wake on lan. WOL is so simple that Kodi and even Emby has it built in to some of their clients. It was requested and within a week they added it while on Plex this has been requested for many years. When you launch the client and no server is detected it sends a WOL request. It is really simple.

  • asilentnoizeasilentnoize Members, Plex Pass Posts: 4 Plex Pass

    You would think it this coding would already be added to PMS. If it was and say it did save me $13 a month, $13 x 12 months = $156. I would consider purchasing a Liftetime PMS Pass with my 1st years savings.... think about the potential sales of the passes.

  • The-DaveThe-Dave Members, Plex Pass Posts: 10 Plex Pass

    This is something I think that would go a long way for your customer base. Especially those of us with pc servers more so than NAS devices. KW hours are pretty expensive in my area and skyrocket once you leave the first power tier pricing. I can't fathom why this is not baked into the clients. Send one automatically on start or if the server is not reachable.

    "Hey is the server reachable? If not, send a magic packet. Is it available now? Profit!"

  • Corleone1Corleone1 Members Posts: 82 ✭✭

    Hi! What's up with link in this
    Next, the server needs to be put on its own VLAN (technically the router can only monitor traffic between VLAN's, not to individual devices). Here is a tutorial on putting port 4 on its own VLAN: https://aaka.sh/patel/2011/07/17/creating-isolated-vlan-ddwrt-wnr3500l/

    Please give a instructions which was in this link!

  • ngs428ngs428 Members, Plex Pass Posts: 203 Plex Pass
    edited February 2017

    Extra post please delete

  • DwainnDwainn Members, Plex Pass Posts: 363 Plex Pass
    edited February 2017

    I am sure the cloud server has this so why can't they add it ? Everyone is trying to save the planet.

  • Zx4161Zx4161 Members, Plex Pass Posts: 131 Plex Pass

    I didn't have to set up a vlan or any such thing. I'm not sure if my script is the same as yours or not as i hadnt looked but if anyone would like it I can post it on here

  • Zx4161Zx4161 Members, Plex Pass Posts: 131 Plex Pass

    I also found dshutdown to work a lot better than win app. You can set it to reactivate after a wake from sleep. I have it exit itself on sleep and restore after a wake up. Couldn't get the win software to reactivate the sleep sequence after a wol.

  • deviquesdeviques Members Posts: 1

    @machyy1 said:
    3)  WinOff software (free) setup to monitor outbound traffic and only put computer to sleep when there has been no outbound traffic for a period of time (I've set mine to 15 minutes):  http://www.ampsoft.net/utilities/WinOFF.php

    How do you do this? I've set mine to 5 minutes when the outgoing traffic is under 10 kb/s. It goes to sleep after 5 Minutes. When I wake up the system it goes immediately to sleep again. Probably the condition is triggered, because there was no outgoing activity in the last 5 minutes, because the PC was sleeping. How can I set it up the the timer restarts after waking from sleep?

    Thank you in advance?

  • DwainnDwainn Members, Plex Pass Posts: 363 Plex Pass

    What i did was build a server that uses very little electricity but is still powerful. The server idles at just 7 watts and has an i3 4130 processor. The Intel processors offer really good power savings.

  • deedesiedeedesie Members, Plex Pass Posts: 10 Plex Pass

    So why do some people say they don't have issues with a Windows Server running PMS going to sleep and waking up when a client starts up? I just don't get it? I have spent hours searching the web for WOL and PLEX and the story is not clear at all. What gives? is there no other solution than DD-WRT? My PC goes to sleep after 30 minutes of inactivity and no PLEX client can access PMS or wake the PC up...yet - I installed a WOL app on my iPhone and sure enough, I can wake the PC up within seconds (both inside or outside the home network). To make matters worse, I installed PMS on an old laptop, closed the lid, put it to sleep, booted up a PLEX client and sure enough - it worked first time. so..what is different between my laptop and my PC? and it also suggests it has nothing to do with WOL or does it? Before I go and spend $600 on a NAS and some disks, why wont PMS work on my PC in terms of waking on sleep?

«1
Sign In or Register to comment.