Wednesday, December 30, 2020

Wake-on-LAN trigger from Android/Mac for Windows Laptop/PC

Wake-on-LAN is an awesome feature to remotely wake-up your Windows laptop/PC using either your home network or even remotely from anywhere using a DDNS service.

You can read-up more online, on how to enable Wake-on-LAN feature for your ethernet adapter via System>Device Manager settings in Windows, which would look something like below


Once enabled, you can try following two ways to test your setup and remotely wake-up your laptop/PC.

NOTE - wake-on-lan seems to only work if your laptop/PC is connected to power source and not just on battery power.


From Android, you can install and use https://play.google.com/store/apps/details?id=co.uk.mrwebb.wakeonlan

Below is a screenshot of settings you would need.

  1. Put the MAC address of Ethernet adapter, e.g. 40:AA:54:19:BA:58
  2. Broadcast address would mostly follow pattern of your Local IP and last 3 being 255 for broadcast e.g. 192.168.1.255
  3. Your local ip that is assigned to your laptop/PC, e.g. 192.168.1.67
  4. Wakeup port should be 9 which is reserved for wake-on-lan

Once above settings are in place, Save this and tap on it to wake up your device. If configured properly your laptop/PC should wake up.

--------------------------------------------------------------------------------------------------------------------------------

For Mac, you can download this free terminal util - https://www.depicus.com/downloads/wolcmdmac.zip 
or for GUI paid version you can visit https://www.depicus.com/wake-on-lan/wake-on-lan-cmd

You can unzip the terminal version and add that to your $PATH for easier access.

Command to wake-up would look something like below

wolcmd <MAC> <Local-Ip> <SubnetMask> <WakeOnLanPort>

wolcmd 40AA5419BA58 192.168.1.67 255.255.255.0 9

You can even incorporate this into a bash script.

--------------------------------------------------------------------------------------------------------------------------------

I have been using these as my daily drivers, and hope this helps you.

If your Wifi Ethernet adapter support WOL, that can be another option. 

I was really surprised to learn that WOL doesn't work on Battery power, at least for my laptop.  But that's understandable too as Ethernet would need to draw some power on battery to listen for WOL packet and would leave to battery drain which might be unwanted side-effect.