Remotely wake up NAS when IPs are active in LAN

  • It's not working for me,


    So i manage to do it in another way,


    Actually, I wanted to turn on my NAS when my openelec htpc is on, so with an xbmc addon I did the thing.

  • Need help getting the script running on DDWRT, Router is Netgear WNRD 3700v2.


    I noticed the the WOL options were commented out for DD-WRT in the 1.1.2 script, so I removed the "#" and then commented out the tamoto ones, please see below. I also disabled the virtual switch check as my htpc are static IP's. I saved the sh file in the root of jffs and added "sh /jffs/wol_if_online.sh" to the startup script then rebooted the router. My NAS (Windows Server) is asleep, turned on my htpc1 with the ip ending with 112, but my Server never came online.


    PS I also chmod 744 to make sure it will run.


    I purposely set WAKEUPMAC=00:00:00:00:00:00 as I do not wish to share my MAC address with the interwebz.


  • 1.1.2 did not work, but this one seems to be, still have to do more testing.


  • Should work at least with the "Ping mode". But as iPads etc. are "always on" (wake up to pull for mails etc.) you should not ping them =)


    And: WOL cant be sent to WLAN targets, i hope thats clear to you (no WLAN-NAS can be "Wake on _LAN_")

  • Thanks ;)
    I will give it a try


    ..::edit::..


    Ok, so far as I have now read / understood, the router that running the script on must be the DHCP server also.
    Am I right?


    So I think I have to wait.
    Because for my main router (Cisco EA6500), there is as yet no DD-WRT available :(

  • Hello,


    I am from germany and want to know how I could exactly implement the script in my ddwrt linksys WRT54GL?


    In Webinterface under administraton, commands, and then? Copy paste (with my settings) in the textfield and saving? That`s it?


    THX a lot,
    Polaris

  • Hello Polaris,


    it should work that way =) I just made some Updates to the script.


    As you should insert the script content into the WAN up section, you should make the router run this script by rebooting the router for example.

  • Für OPENWRT


    einloggen als root

    Code
    cd /
    nano wol.sh



    return to webgui -> System -> Startup (scroll do bottom)
    insert this line befor "exit 0"

    Code
    cd / && sh wol.sh &
  • First of all BIG BIG thank you Knumsi for the scripts and making that functionality I missed so much possible! (before I start what may sound like "complaining" around.) :D :D :D
    It's been a while since I played with scripts for my Tomato and raspberry pi and that was more a trail and error game for me. ;)
    So now I had a very hard time getting it to work. But I did get it done now...
    At first I "trialed and errored" quite long with the version 1.1.4. I did get that to run afeter some T&E but I had to give up because of WAKEUPCHECK. According to the log it gave nothing back and I'm definitely to Noob to figure that out.
    I then went on with the version 1.1.2 and that's the one I got to work. Yehaaaaa! :D


    For me personally there's one question open at the moment (would be really nice to have it answered):
    Did I understand it correctly that pinging would be slower than the ARP method? And if so, can I make ARP work/react faster? (perhaps by clearing the Routers Cache of ARP in the script?)
    For my Media player it takes more than a Minute till the Server starts. It's not really that long, but I would like to speed it up if possible somehow.


    Here's my Discoveries and Suggestions:
    - on your Website I read a comment from you, Knumsi... You mentioned that you did not pack/unpack the config.cfg. So I killed it out completely while trying around with 1.1.4 and that caused a headache. ;)
    - that a zip "must" be made, the wget and unzip... that whole part should be pointed out /explained better. (1.1.4)
    - in a case when the files do have to be uploaded every time... is there not a way to make the files permanent with nvram? (if yes, may someone please explain it for people who might need it, but I do not need it)
    - in 114 the MAC is with quotes and in 112/111 it is without. I didn't figure out what the difference is but it seems confusing. Is without better (Bugfix)?
    - in 112 we have a file called wol_if_online.sh and in the script wol_when_ip.sh. That's can really cause confusion too! (gave me a bit more headache when trying to find out what's causing my problems) ;)
    - the last Line also has two versions. In 114 it starts with /etc and in 112 it starts with ./etc. For me it made no difference, but I'm wondered about that. (on my Router) the path is /tmp/etc the "cd etc" brings me right in to it from root and the "." made the same as without in the script.
    - I also had a small issue with 114 when unpacking the zip. So I would advice people who need to use wget and unpack to use overwrite "unzip -o ..."
    - WAKEUPCASE=1 should be pointed out a bit better too. (I guess most people will not be needing it) :D
    - Novices please note: The names in AWAKENAMES are not the names given in the Clients (Windows PCs). It's the names the Clients have in the Router (Static DHCP/ARP/IPT). And the names you give your clients there have to be without a space in it.
    - Novices please note too: Do not set "Bound to" in "Basic > Static DHCP/ARP/IPT". You do not want to have the AWAKE-Devices to have a permanent ARP. If so it will always keep waking up your NAS/Server. Will cause a loop with sending WoLs even if the Clients are off.


    Okay... once again. Thank you very mush Knumsi and to others here too. :thumbup::thumbup:8o:D

  • It's not working for me,


    So i manage to do it in another way,


    Actually, I wanted to turn on my NAS when my openelec htpc is on, so with an xbmc addon I did the thing.


    That would never work with my Media Player... If you still want to give it a try via router I could let you have mine (1.1.2) that's now working with my router.


    Router: Asus RT-N66U
    FW: Tomato Firmware 1.28.0000 MIPSR2-108 K26 USB AIO-64K

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!