noobie seeks help with WOL on resume
#1
I've been struggling to get the WOL script to wake my server when xbmc live resumes from standby (the script works fine when I run it from xbmc).
I've tried adding an autoexec.py file to /home/myusername/.xbmc/userdata

Have tried the following for my autoexec.py files:

iexecfile(/home/myusername/.xbmc/addons/script.wol/default.py)

iexecfile(/home/myusername/.xbmc/addons/script.wol)

iexecfile(/home/myusername/.xbmc/addons/script.wol/wol.py)

also tried execfile instead of iexecfile





but I keep getting a script error when I reboot (log showed invalid syntax) - no error on resuming from suspend so I guess it's not trying to run the script at all?

I'm pretty obviously a complete newbie so please keep any replies simple! thanks
Reply
#2
Help me please bump bump!
Reply
#3
install wakeonlan so the OS can send magic packets:
Code:
sudo apt-get install wakeonlan

put the script in: /etc/pm/sleep.d


so do the following to create the file and make it executable:
Code:
sudo touch /etc/pm/sleep.d/01-wake_server.sh
sudo chmod +x /etc/pm/sleep.d/01-wake_server.sh

Then need to edit the file to put your script in it:
Code:
sudo nano /etc/pm/sleep.d/01-wake_server.sh

paste in the following (substituting the mac of your server):

Code:
#!/bin/sh

case "$1" in
thaw|resume)
/usr/bin/wakeonlan 00:e0:4d:c4:d2:29
;;
*) exit $NA
;;
esac
Reply
#4
gabbott you're a genius! That worked a treat - thanks a million Big Grin
Reply
#5
hi guys,

any suggestion why the script wont work on my server?
Using he WOL-Script under addons starts my servr just fine.

so wol and the mac adress are okay.

anyone got a tip for me? or a logfile where i may find the answer?

thanks a bunch!

Edit:
I removed all lines from the script except for the wakeonlan-line.
now my server wakes up whenever i send my xbmc machine to sleep...
Reply
#6
Sorry no clue but script still works fine for me!
Reply
#7
i just dont understand what these lines do:

case "$1" in
thaw|resume)

;;
*) exit $NA
;;
esac

the explanation has to be there somewhere...
Reply
#8
i played around a bit more...

i logged the statement in $1 to know that the xbmc box really nows its resuming. that it does.

then i added a sleep before the wakeup. i just dont know if i have to include a path or not.

also the server doesnt wake up when i put my xbmc machine to sleep.

Could the whole thing have something to do with:
$ sudo nano /etc/pm/config.d/00sleep_module
Now add the following to the file:
SUSPEND_MODULES=”$SUSPEND_MODULES jme”
(http://breden.org.uk/2011/01/15/shuttle-...uspendwake)


jme is the lan driver
Reply
#9
bigbear77 Wrote:i just dont understand what these lines do:

case "$1" in
thaw|resume)

;;
*) exit $NA
;;
esac

the explanation has to be there somewhere...

This might help:

http://ubuntuforums.org/showthread.php?t=1484156
Reply
#10
(2011-04-15, 20:45)gabbott Wrote: install wakeonlan so the OS can send magic packets:
Code:
sudo apt-get install wakeonlan

put the script in: /etc/pm/sleep.d


so do the following to create the file and make it executable:
Code:
sudo touch /etc/pm/sleep.d/01-wake_server.sh
sudo chmod +x /etc/pm/sleep.d/01-wake_server.sh

Then need to edit the file to put your script in it:
Code:
sudo nano /etc/pm/sleep.d/01-wake_server.sh

paste in the following (substituting the mac of your server):

Code:
#!/bin/sh

case "$1" in
thaw|resume)
/usr/bin/wakeonlan 00:e0:4d:c4:d2:29
;;
*) exit $NA
;;
esac

Just tried this with Ubuntu 14.04 LTS - XBMCbuntu

01-wake_server.sh needs to be changed to 01-wake_server

for some reason the .sh stops the script from running
Reply

Logout Mark Read Team Forum Stats Members Help
noobie seeks help with WOL on resume0