What's new

Auto Wake On Lan?

  • 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!

gil80

Regular Contributor
I'm using Home Assistant running on a NUC type PC.
Though the Bios is set to power on the device after a power loss, it doesn't work.

So I have to manually use WOL feature from within the router if I'm away.

Is it possible to auto run a script for WOL after a power loss?
 
The router doesn't have a way of differentiating between a reboot caused by a power outage and a reboot caused by a deliberate action (e.g. manual power off/on, scheduled reboot, etc.). You could set the router to issue a WoL every time it boots up, but that's not quite the same.
 
The router doesn't have a way of differentiating between a reboot caused by a power outage and a reboot caused by a deliberate action (e.g. manual power off/on, scheduled reboot, etc.). You could set the router to issue a WoL every time it boots up, but that's not quite the same.
That would still work for me.
How can I auto issue WOL every time it boots up?
 
I would create a /jffs/scripts/services-start user script as follows:
Code:
#!/bin/sh
ether-wake -i br0 -b 11:22:33:44:55:66
Replace 11:22:33:44:55:66 with the MAC address of your NUC.
 
I would create a /jffs/scripts/services-start user script as follows:
Code:
#!/bin/sh
ether-wake -i br0 -b 11:22:33:44:55:66
Replace 11:22:33:44:55:66 with the MAC address of your NUC.
Okay, I'm confused again. I thought the -b broadcasted to all, not just one MAC. What happens if there is no -b?
 
I would create a /jffs/scripts/services-start user script as follows:
Code:
#!/bin/sh
ether-wake -i br0 -b 11:22:33:44:55:66
Replace 11:22:33:44:55:66 with the MAC address of your NUC.
ok, so I enabled the JFFS partition and SSH'd to it.
I used `nano` to create the script `wol.sh` and copied your example but used my machine's MAC address.
I then issued `chmod +x wol.sh`

That should be enough?
 
Okay, I'm confused again. I thought the -b broadcasted to all, not just one MAC.
That's correct. The Ethernet broadcast address is FF:FF:FF:FF:FF:FF. The "11:22:33:44:55:66" in the example is what's inserted into the payload of the magic packet.
What happens if there is no -b?
It uses the MAC address of the target machine ("11:22:33:44:55:66" in the example) instead of FF:FF:FF:FF:FF:FF.
 
That's correct. The Ethernet broadcast address is FF:FF:FF:FF:FF:FF. The "11:22:33:44:55:66" in the example is what's inserted into the payload of the magic packet.

It uses the MAC address of the target machine ("11:22:33:44:55:66" in the example) instead of FF:FF:FF:FF:FF:FF.
Thanks. So that difference is that with -b, all clients will receive a magic packet but they are suppose to ignore it unless their mac matches what is in the payload? Sounds like one should only use -b if it doesn't work without it.
 
In theory -b should be more reliable and is what the router's GUI WoL function uses. I can't see any downside for using -b.
 
I'm using Home Assistant running on a NUC type PC.
Though the Bios is set to power on the device after a power loss, it doesn't work.

So I have to manually use WOL feature from within the router if I'm away.

Is it possible to auto run a script for WOL after a power loss?
You could have a bash script that say pings the NUC every so many minutes and if it gets a responds do nothing, but if it does not get a responds, then sent the WOL command.
 

Similar threads

Sign Up For SNBForums Daily Digest

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