Wake on LAN (WOL) for Windows 10 PLEX Media Server when in sleep mode. Is it possible?

I recently built a new media server and signed up for a PLEX Pass. I love everything about it except not being able to wake up (WOL) my server from sleep mode using a magic packet. I do not want my media server running 24/7 for hardware longevity purposes, energy efficiency and I would like the server to run quieter when not in use (located in my living room). I also understand I can simply download a “Wake on Lan” app which would alleviate my problem but add an unnecessary step when trying to access my media. Also, I would like to eventually share my library with friends and family, thus not having them download apps to wake my server.

I’ve spent the past few days trying to diagnose this problem with no positive result. I’ve read online that this isn’t possible while other posts state that it is. I think this is a necessary feature to include.

What I’ve done to troubleshoot:

  • Ensured my WOL settings are enabled in BIOS.
  • Ensured my WOL setting are all turned on under the “Power Management” tab for my Realtek PCIe GBE Family Controller driver.
  • Ensured that “Wake on Magic Packet” is enabled under the “Advanced” tab for my ethernet driver.
  • I’ve successfully woken my media server by using “Wake on LAN” software on both my Android phone and separate laptop.

So is it possible or not? If not, is this being worked on for a future release? It would be nice to get a confirmation of this from an actual PLEX employee.

Important System Notes:

  • Windows 10 (x64)
  • 16gb RAM
  • OS running off of 256GB SSD
  • Direct LAN connection
  • Nighthawk R6400 wirelss router
  • ARRIS SURFboard SB6183 DOCSIS 3.0 Cable Modem
  • Xfinity Broadband (90mb down, 11mb up)

Thank you in advance for any insight on this issue.

2 Likes

I was actually going to ask pretty much the exact same question. I’ve also just rebuilt my machine and thought it would make sense to try out a WoL system to save some power usage.

I’ve done the exact same steps as yourself and have also been able to get the system to wake using an app but this only works locally and requires the initial third-party step. Since I share to other remote users I would ideally have a way for the server to wake whenever it detects a request on port 32400, both from local and remote traffic.

I found this post about setting up a system using an OpenWRT-flashed router: https://www.reddit.com/r/PleX/comments/3f7d0u/plex_wol_my_setup/
Comments on that post suggest that several users have found that WoL works out of the box without any tinkering at all, but I can’t tell if that is only locally, and I suspect it may just be for certain routers.

Looks like your R6400 router can have DD-WRT flashed onto it: https://www.myopenrouter.com/downloads/dd-wrt-r6400
Maybe you can try flashing DD-WRT and using the scripting from that reddit post?

I was hoping there may be a way to do this with a Raspberry Pi (or similar) since my router isn’t supported by OpenWRT, DD-WRT, etc. If not I think I will have to invest in a new router.

My (very basic) understanding of WoL is that even if Plex did send a magic packet on port 9 (the WoL port) before requesting access to the server, it would still only work locally as many routers don’t allow you to forward port 9. So, for me, this is not something Plex can fix themselves as I need remote access.

If anyone knows of a way to remotely wake a sleeping Plex server without requiring a WoL app or flashing the router please let me know…

Yes, please, some more information on this would be very helpful. I’m also interested in getting my plex clients to wake my PC. I’ve got my WOL settings all figure out to the “T”. I’m successfully waking my PC via magic packet using an iPhone WOL app, both locally AND remotely using port forwarding on my Router. Could someone at least answer, DO plex clients ACTUALLY send magic packets each time they try to access a server? Is there a setting that can be enabled to MAKE them do this? Or is there simply NO WOL feature built into plex client software?

I have just done this on mine and if you bear with me I can walk you through it.

First you need a router running dd wrt firmware.
set your comp on a static ip under the services tab and then forward the port 32400 to that ip.

Also enable Syslogd under the Services tab

In the Log management under the security tab you need to set logs to High and in the options section Enable accepted

then you need to go to plex on the server and set the manual port to 32400

in your router you need to post this script under commands in the administration tab exactly as I post it but change the bold accordingly and save it to start up commands. Then reboot the router

#!/bin/sh
#Enable JFFS2 and place script in /jffs/ then run on startup in web interface.
#You can check the log from http://192.168.2.1/user/wol.html

INTERVAL=1
PINGTIME=1
OLD=""
PORT=32400
WOLPORT=9
TARGET=The static IP that you set for your server
BROADCAST=192.168.1.255 Do not change unless your ip does not use the 192.168.1 default
MAC= The mac address of your server
WOL=/usr/sbin/wol
LOGFILE="/tmp/www/wol.html"

echo “<meta http-equiv=“refresh” content=“10”>” > $LOGFILE
echo “AUTO WOL Script started at” date
” >> $LOGFILE

while sleep $INTERVAL;do
NEW=dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print }' | tail -1
SRC=dmesg | awk -F'[=| ]' '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print $7}' | tail -1
LINE=dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/'

if [ “$NEW” != “” -a “$NEW” != “$OLD” ]; then
if ping -qw $PINGTIME $TARGET >/dev/null; then
echo “NOWAKE $TARGET was accessed by $SRC and is already alive at” date
”>> $LOGFILE
else
echo “WAKE $SRC causes wake on lan at” date
”>> $LOGFILE
$WOL -i $BROADCAST -p $WOLPORT $MAC >> $LOGFILE
echo “
” >> $LOGFILE
sleep 1
fi
OLD=$NEW
fi
done

Replace the bold and delete the bold writing accordingly.

Go to device manager on the server and find your wired network adapter. Right-click and go to power management and select all 3 boxes that lead to wake only by magic packet.

Next set your power setting to balanced under power options. select change plan settings and set the comp sleep timer to never. this way it wont sleep on you while you stream movies or what not.

download the program called Dshutdown. extract to desktop. Right-click dshutdown.exe go to properties, then to compatibility and select to always run as administrator. now run dshutdown.

for the settings under dshutdown you want to have shut down for internet activity selected. in the drop down section select your network adapter that ends in NATIVE MAC LAYER LIGHT WEIGHT. select upload - under- 5kb/s - 5 min

in the check boxes on the left you want Standby checked, Exit program checked, Auto start checked, and set default checked. IN THAT ORDER. it saves the settings that way.

Next go to task scheduler. create basic task, name it dshutdown restart. under trigger you want “when an event is logged” checked. for log you want “system”, For source you want “Power-Troubleshooter”. for event ID you want the number 1. for action you want to start a program. The program you want is the dshutdown.exe. i put the folder with dshutdown in it on my desktop. this way when the comp comes out of sleep it will start dshutdown and restart the activator to start the sleep sequence when there is no internet traffic being uploaded. that way it wont shut down on you while you watch a movie and you wont have to manually reactivate it like it was intended.

follow these steps to the T. Don’t deviate and read it word for word. I couldn’t do pics. It’ll make sense as you work through it step for step. The script will work on LAN and Remote. At least it does for me. Let me know if you run into problems and I’ll see if i can walk you through it.

1 Like

the script is off, let me upload it as a txt

This doc has the script. Change the BOLD and copy and paste it in commands under Administration tab

LEAVE THE PORTS AS 32400 OR IT WILL NOT WORK

Oh yeah, one more thing. Disable your lock screen when it wakes from sleep.

I appreciate the detailed instructions. I personally won’t be messing with my routers firmware but hope this is a resolution for other users. Thank you again.

1 Like

No problem, I was hesitant at first too but couldn’t stand the electricity bill any longer haha. Good luck

Integration of WOL into PLEX would be amazing. It would be awesome logging in online somewhere and instead of seeing unavailable red triangle under servers you could have WAKE button. I dont see this as a difficult implementation.

For now I use TeamViewer Wake-On-Lan and as it is an extra step it works and it works well. I have my PC to go to sleep after 15 min. I wake it up via app and my family knows to send me a quick text to turn on a server when it is offline. TeamViewer is free for personal use I highly recommend. I just got back from 2 week vacation and I used it twice to turn on my server while at friends house to hook up to his Samsung TV.

2 Likes

I use TeamViewer as well and do recommend it to access the server. This could be an acceptable solution for many, but not for those such as myself that have multiple people trying to access the server. I currently have 7 individual users trying to connect throughout the day, having them contact me every time they need the server awoken would become a nuisance.

I do appreciate the input and totally agree that this should be implemented into Plex.

Ok simple question but stupid in a sense. I am using DD-wrt router firmware. Familiar enough with it but confused by instructions above. Enable JFFS2 and place script in /jffs/ then run on startup in web interface.

where is /jffs/ - i have the scripts in Administration - command tab saved startup.

Excuse me, do you know why can’t my windows 10 directly play DVD files? It all ran well when on Windows7. After i updated my system it did not work anymore. I must use the software named “windows 10 can’t play dvd” to succeed in launching the dvd playback on my computer. Why is windows 10 unable to play dvds, who can tell me?

@fitz55 said:
Ok simple question but stupid in a sense. I am using DD-wrt router firmware. Familiar enough with it but confused by instructions above. Enable JFFS2 and place script in /jffs/ then run on startup in web interface.

where is /jffs/ - i have the scripts in Administration - command tab saved startup.

You don’t necessarily need jffs enabled as i don’t on mine and the script works flawlessly. That’s bit is part of the script for instructions for those that have jffs enabled for Nas systems and external storage for their routers

I also have a discussion under my profile that has the script posted instead of a document. You could copy that, change the ip address and Mac address and save it to start up commands if the document file confuses you.

Also, I found dshutdown to randomly stop working and have created a task and bat file to make sure it’s running. If anyone is interested just let me know and I’ll find a way to post it.Also, Do not use the script as it is posted here. Only use the script that is in the doc file I uploaded. It did not post right in this discussion

Hi Zx4161,
Thanks for the response and I did exactly what you stated ( doc file ) and put in my information and then saved and pasted into administration - commands and saved start. applied settings and rebooted router. All is there when I went back in and checked but to no avail as I am still unable to wake server via accessing plex and logging in - message from plex is server is unavailable and I am looking at the server and it is still sleeping. Any idea’s.

Also when checking log as described http://192.168.0.2/user/wol.html I get
[Wed Mar 8 20:03:55 EST 2017] AUTO WOL Script started.

so it looks like it starts

Here is what it looks like:

#!/bin/sh
#Enable JFFS2 and place script in /jffs/ then run on startup in web interface.
#You can check the log from http://192.168.0.2/user/wol.html

INTERVAL=1
PINGTIME=1
OLD=""
PORT=32400
WOLPORT=9
TARGET=192.168.0.115
BROADCAST=192.168.0.255
MAC=AC:9E:17:F0:9C:38
WOL=/usr/sbin/wol
LOGFILE="/tmp/www/wol.html"

echo “<meta http-equiv=“refresh” content=“10”>” > $LOGFILE
echo “[”date"] AUTO WOL Script started.
" >> $LOGFILE

while sleep $INTERVAL;do
NEW=dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print }' | tail -1
SRC=dmesg | awk -F'[=| ]' '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print $7}' | tail -1
LINE=dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/'

if [ “$NEW” != “” -a “$NEW” != “$OLD” ]; then
if ping -qw $PINGTIME $TARGET >/dev/null; then
echo “NOWAKE $TARGET was accessed by $SRC and is already alive at” date
”>> $LOGFILE
else
echo “WAKE $SRC causes wake on lan at” date
”>> $LOGFILE
$WOL -i $BROADCAST -p $WOLPORT $MAC >> $LOGFILE
echo “
” >> $LOGFILE
sleep 1
fi
OLD=$NEW
fi
done

Thanks
Fitz55

@fitz55 said:
Hi Zx4161,
Thanks for the response and I did exactly what you stated ( doc file ) and put in my information and then saved and pasted into administration - commands and saved start. applied settings and rebooted router. All is there when I went back in and checked but to no avail as I am still unable to wake server via accessing plex and logging in - message from plex is server is unavailable and I am looking at the server and it is still sleeping. Any idea’s.

Also when checking log as described http://192.168.0.2/user/wol.html I get
[Wed Mar 8 20:03:55 EST 2017] AUTO WOL Script started.

so it looks like it starts

Here is what it looks like:

#!/bin/sh
#Enable JFFS2 and place script in /jffs/ then run on startup in web interface.
#You can check the log from http://192.168.0.2/user/wol.html

INTERVAL=1
PINGTIME=1
OLD=“”
PORT=32400
WOLPORT=9
TARGET=192.168.0.115
BROADCAST=192.168.0.255
MAC=AC:9E:17:F0:9C:38
WOL=/usr/sbin/wol
LOGFILE=“/tmp/www/wol.html”

echo “<meta http-equiv="refresh" content="10">” > $LOGFILE
echo “[“date”] AUTO WOL Script started.
” >> $LOGFILE

while sleep $INTERVAL;do
NEW=dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print }' | tail -1
SRC=dmesg | awk -F'[=| ]' '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print $7}' | tail -1
LINE=dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/'

if [ “$NEW” != “” -a “$NEW” != “$OLD” ]; then
if ping -qw $PINGTIME $TARGET >/dev/null; then
echo “NOWAKE $TARGET was accessed by $SRC and is already alive at” date
”>> $LOGFILE
else
echo “WAKE $SRC causes wake on lan at” date
”>> $LOGFILE
$WOL -i $BROADCAST -p $WOLPORT $MAC >> $LOGFILE
echo “
” >> $LOGFILE
sleep 1
fi
OLD=$NEW
fi
done

Thanks
Fitz55

Your ip address seems a little weird to me. Is 192.168.0.1 your base ip address? Have you added your server to a static ip?

sorry for the generic pics, I’m at work haha.
So the script itself is working. A few things can cause the script not to work. I’m going to start at the most likely cause, but I’m sure you probably set it right.

You want to have a static ip. Under services you want to add a static lease. Put your mac address and I the ip you want to use. Keep it in the hundreds as that’s what dd wrt sets as default. For lease time put 1440 , thats 24hrs.

Next you want to port forward. Which is under the nat tab. Set your static ip that you just established, For the port forwarded you want 3400 as the start port and then 3400 as the end port. For protocol select both on the drop down selection menu. Check the enable box.

Now, open your plex and go to server settings. Under the remote access tab under server you want to click show advance settings on the upper right. Then checkmark manually specify port. Put 3400 for the manual port.

You may also not have magic packets enable for your network adapter card. This does not work for a wireless adapter unfortunately. To enable this open device manager. Right click your network adapter and select properties. Under the advance tab you’ll find wake on magic packet. Under the drop down for value select enable. Next select the power management tab and check mark all 3 boxes from top to bottom starting with “allow the computer to turn off this device to save power” and ending with “only allow a magic packet to wake the computer”.

Let me know if you need further help. These are just the most common problems that are off the top of my head.