Plex Server WOL request

I would like to see an advanced option where the official Plex servers would use a secondary port to communicate with personal media servers only when a user actually requests access to the server.

This would allow a user with a little know-how to set up an automated WOL packet when that port (say 32401) is used. This would allow users to let their often power hungry media servers sleep until someone actually tries to connect.

Here’s my use case:

  • I have an always on Synology that handles all media duties. It’s not powerful enough to stream, but sips power.
  • I have a power PC as my Plex Media Server that I would like to sleep when I’m not using it, but would still like it available to family members (who aren’t likely to remember to go to wake.mydomain.com when the server isn’t available).
  • I have a router scripted to send a WOL packet when traffic occurs on a port. 32400 appears to have too much traffic (heartbeat?) to be effective.
    • If you have a merlin router it’s already done for you link

While this would be a fairly rare use-case I think if the capability existed there would be many power users eager to take advantage of it.

@rcketscientist I believe the traffic that appears on 32400 is plex from multiple devices reestablishing connection to the server. I had this same problem when running a script based WOL from the router. To combat this I had everyone that wanted to connect to my server use their phones and then use a program called greenify to hibernate the plex apps. This eliminated all traffic on 32400 and allowed the server to sleep. The only issue I had was when someone would forget to hibernate their app.

I would like to see plex work on the phone app and have it not continuously to try and establish a connection to the server when it isn’t actually open. Also, if someone uses an app on the roku or their smart tv it also continuously reconnects and wakes the server.

Here’s a link to my discussion to get WOL working on your router. Hopefully its useful

In the meantime I think it’s easier to have the server wake on another port, then link a subdomain via dynamic dns to wake the server on that port. Users will have to know to click a bookmark if the server is unreachable.

wake.mydomain.com -> server.external.ip:1111

The WOL packet is sent upon receiving traffic on port 1111.

Ideally, traffic would only exist when an actual request is made as you mentioned. Then none of this would be necessary.

Actually, I just had some success with setting it up. Turns out that it wasn’t a heartbeat that was instantly waking the Server. It was the Away Mode setting never allowing it to sleep at all (even manually). This might be a bug in the media server since the setting text implies it will only use Away Mode when preventing sleep, but it appears to permanently prevent sleep.

This has been a short trial but my Server now sleeps during inactivity without any third-party apps. It wakes upon actual activity on an Android Plex client. I also have a roku which is not waking the Server while idle (yet). Tomorrow I’ll see if the roku plays nice and over the next few days I’ll confirm that the server never sleeps during playback. I’ll follow up with results as I work out the kinks.

So Away Mode OFF
WOL set to port 32400.
Sleep after 15 min.

@rcketscientist said:
I would like to see an advanced option where the official Plex servers would use a secondary port to communicate with personal media servers only when a user actually requests access to the server.

This would allow a user with a little know-how to set up an automated WOL packet when that port (say 32401) is used. This would allow users to let their often power hungry media servers sleep until someone actually tries to connect.

Here’s my use case:

  • I have an always on Synology that handles all media duties. It’s not powerful enough to stream, but sips power.
  • I have a power PC as my Plex Media Server that I would like to sleep when I’m not using it, but would still like it available to family members (who aren’t likely to remember to go to wake.mydomain.com when the server isn’t available).
  • I have a router scripted to send a WOL packet when traffic occurs on a port. 32400 appears to have too much traffic (heartbeat?) to be effective.
    • If you have a merlin router it’s already done for you link

While this would be a fairly rare use-case I think if the capability existed there would be many power users eager to take advantage of it.

It would be AWESOME. Any news?

I know some people have had issues, but I’ve had success on both Linux and Windows with a router set to send a magic packet to the media server when it receives traffic on 32400.

Linux needs an additional check when going to sleep to confirm that there are no streams active. After that it works perfectly.

Windows god-awful power management requires a fair bit of manipulating powercfg to control what can and cannot sleep/wake the PC, but with some effort it works well.

I highly recommend an NVME boot drive if you do this. Linux can be up almost fast enough to match the plex app boot on most tv boxes. Windows is quite a bit slower. You’ll have to tell users to click the server after a few seconds when they boot, but I have no issues at home and even have my parents on board with how to use it now.

@rcketscientist said:
I know some people have had issues, but I’ve had success on both Linux and Windows with a router set to send a magic packet to the media server when it receives traffic on 32400.

Linux needs an additional check when going to sleep to confirm that there are no streams active. After that it works perfectly.

Windows god-awful power management requires a fair bit of manipulating powercfg to control what can and cannot sleep/wake the PC, but with some effort it works well.

I highly recommend an NVME boot drive if you do this. Linux can be up almost fast enough to match the plex app boot on most tv boxes. Windows is quite a bit slower. You’ll have to tell users to click the server after a few seconds when they boot, but I have no issues at home and even have my parents on board with how to use it now.

Is there any guide I can follow? I tried many but I’m not as exper as i thought… My “problems” are:

  • my ip is dynamic (but I hope i set up a no-ip ddns host correctly);
  • the pc took about 50-60 secs to boot up from totally dead.

I have a netgear R7000.
I tried to wol with some more user friendly app like TeamViewer but is doesn’t work with ddns. WOL on lan works perfectly.

If you set up that automatically sends out the pakage when there is traffic…that would be better than the solution I was trying to obtain!

The most important part is that your router casts the magic packet for your server. Plex can’t solve this piece for us. You’ll almost certainly need to load a custom firmware. Here’s an example for Asus users:

DD-WRT would be similar. There will be tutorials for that piece, the steps will be specific to your chosen firmware. The key is that the router broadcasts a packet for your:

IP (local)
MAC

So you’ll end up modifying the script with those values and following the directions. Focus on that piece first. The external IP doesn’t actually matter. Plex handles that piece. You just need to convince your router to tell your PC to wake when 32400 comes in.

If you get that working I can walk you through the next steps as well.

@rcketscientist said:
The most important part is that your router casts the magic packet for your server. Plex can’t solve this piece for us. You’ll almost certainly need to load a custom firmware. Here’s an example for Asus users:

WOL Script Wake Up Your Webserver On Internet Traffic · RMerl/asuswrt-merlin Wiki · GitHub

DD-WRT would be similar. There will be tutorials for that piece, the steps will be specific to your chosen firmware. The key is that the router broadcasts a packet for your:

IP (local)
MAC

So you’ll end up modifying the script with those values and following the directions. Focus on that piece first. The external IP doesn’t actually matter. Plex handles that piece. You just need to convince your router to tell your PC to wake when 32400 comes in.

If you get that working I can walk you through the next steps as well.

You’re so kind! I will follow the guide you posted. I tried once but I failed to configure DD-wrt and as result my connection to internet wasn’t working (I haven’t understood how to configure DNS etc…).

I googled and found this: Netgear R7000 - DD-WRT Wiki

I will follow the steps and update in the future. Thanks again!!

@rcketscientist

I was able to install DD-wrt on my R7000. I started to follow the guide you posted, but I’m stuck at one passage. Exacly when I have to login using winscp. I insert the ip of my router and the password and nickname I use to login into it, but it still says “permission denied”.

I tried to search on the net but the solutions I found were pretty difficult to understood to me beacuse are all related to the use of the scrips in winscp. Any idea I can get around it?

Thanks anyway, you did a lot to improve my situation!

First of all…is dd-wrt rock solid stable on your device? It’s a great project, but not perfect on every device. No sense going further if it will cause other headaches. That said…

You linked the normal dd-wrt installation guide which it sounds like you pulled off. Please link the guide you’re having trouble with and I’ll help. My guess is that you need to enable remote shell access.

Rock sold? I have installed about 4 days ago and it’s running fine. No problem at all.

The guide I’m following is this: https://github.com/RMerl/asuswrt-merlin/wiki/WOL-Script-Wake-Up-Your-Webserver-On-Internet-Traffic (the one you linked).

That is specifically for Asus users with Merlin (as opposed to DD-WRT).

From the following link it appears dd-wrt might make this exceedingly simple with the GUI:

https://www.dd-wrt.com/demo/Wol.asp

@rcketscientist said:
That is specifically for Asus users with Merlin (as opposed to DD-WRT).

From the following link it appears dd-wrt might make this exceedingly simple with the GUI:

https://www.dd-wrt.com/demo/Wol.asp

omg. I’m so dumb. So going in the page on my router (like the demo you linked), I would be able to wake up my pc from just opening the plex app from a device client outside the wifi?

thanks for the replys!

Well that’s the core component. Without it you wouldn’t be able to get it to work.
It gets you this far ->|
router -------- (magic packet) -------> Server

The remaining connection setup:

  • Your server needs to support WOL (usually a bios and OS setting)

Then there’s a plethora of tiny tweaks to get it perfect:

  1. Power management (sleep/wake permissions)
  2. Ideally you want only a single port (32400) to wake (otherwise the router might wake your PC for random internet traffic, the impact of this can vary)

But once you ensure WOL on your server is setup you should be able to manually wake your PC externally and start testing.

What OS is your server on?

I’m using windows 10on PMS. I’m able to wake it up on lan using magic poket.

Congrats. Now the key is to keep an eye on the behavior. Windows power management is awful.

powershell (admin): powercfg -requests

is your friend. It tells you what’s keeping your system from sleeping. There’s almost always something (including plex) that gums up the works. Let me know if you need more help with the setup.

Wait wait …wait a minute. There has been some misunderstood.

I’m not able to wol outside the lan, only if i’m in the same wifi.
I have not configurated the dd-wrt page!

Please could you brake this in some dumb-proof points (so I can easly follow them)?
Thanks again for the effort!

As I don’t use dd-wrt I can’t help step-by-step. But quickly scanning this doc seems like it covers all the necessary steps:

https://dd-wrt.com/wiki/index.php/WOL