What's new

WOL sollution

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

alan_smithee

Occasional Visitor
I've been searching for a wol sollution for my home network.
I've got two seperate networks that seperates my servers from my workstations. So a WOL broadcast from my server to my workstation isn't possible.

I've got my Asus AC66U in Access Point(AP) mode so this sollution is out of the question
https://github.com/RMerl/asuswrt-merlin/wiki/WOL-Script-Wake-Up-Your-Webserver-On-Internet-Traffic
(since the firewall is disabled).

I can think of two options:
1) create a direct URL (if possible) to the WOL button in the gui.
like this: username:password@ipadress/Main_WOL_Content.asp
2) enable the IPTraffic monitor and look for a special event that triggers a wol script

Does anyone know if one of these two solutions will work or maybe has a better idea?
The main goal is that a I can send a http command from my Mios Vera to my Asus AP that triggers a WOL in that network segment.
 
I don't understand what you mean by separate....
I would simply port forward 34343 to 9 and then send wake on wan to 34343 after setting up af static arp entry using. Otherwise host a webpage something like yourip.org/jnfjh3qiu49823jbava7d7adgasd/ that contains a php command to execute wol.
 
Could something like plink or putty work to log in and execute a WOL command?
 
Could something like plink or putty work to log in and execute a WOL command?
I thought of that to but the Mios Vera doesn't have a plugin for putty and I don't have enough knowlegde of LUA the write something myself.

Ive been experimenting with Lighttpd on my Asus but I allready have issues running a simple webpage. I'll post the sollution when works.
 
Well I got it working. It doesn't look fancy but it does the job done.
It also has a php ping script so I can check if the pc is on or not.

I got Entware running by following this guide.
Then I installed Lighttpd with PHP support following this guide

I created a file named WOL_pcname.php with this content.
Code:
<?php
    # replace with your target MAC address
    $mac = 'AA:AA:AA:AA';

    exec("ether-wake $mac");

# replace with your Asus router adres
header('Location: 192.168.1.1:81')
?>

This way I can go directly to this URL and wake up the pc.

I also wanted to wake up the pc by phone so I created a index.php file with the following content

Code:
<?php
function ping($host)
{
        exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res, $rval);
        return $rval === 0;
}

$host = 'IPADRESS OR HOSTNAME';
$up = ping($host);

?>

<style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg .tg-s6z2{text-align:center}
.tg .tg-ipa1{font-weight:bold;background-color:#c0c0c0;text-align:center}
</style>
<table class="tg">
  <tr>
    <th class="tg-ipa1">Computer Name</th>
    <th class="tg-ipa1">Status</th>
  </tr>
  <tr>
    <td class="tg-s6z2"><a href="WOL_pcname.php">PC Name</a></td>
    <td class="tg-s6z2"><?php echo ''.($up ? 'up' : 'down').''?> </td>
</table>

I've zero knowlegde of PHP/HTML so I scraped everything from examples like this ping script from the internet.

If someone wants to clean up the code or adjust the page please do.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top