Wake on Lan
-
- Posts: 12
- Joined: Mon Jan 14, 2019 10:11 pm
Wake on Lan
Hi All,
Was struggling with performing WakeOnLan functionality from within Indigo and found something I think is worth sharing.
It starts with the following piece of software, that is my favorite price, free!!!
http://www.readpixel.com/wakeonlan/
Download and install this on your Mac, now use their client software to test and troubleshoot your wake on lan functionality.
Once you get it working, you can then use Apple Script to call this app from within an Indigo Action Group.
Sample script:
tell application "WakeOnLan"
wakeup "192.168.4.135"
end tell
The other nice thing about this software is that I did a network sniff and basically the approach is to try about 6-7 different types of WakeOnLan signals (wonderful thing about standards is that there is so many to choose from). So your chance of getting it working is quite good.
Let me know if you have any questions/concerns, would be glad to help out.
Was struggling with performing WakeOnLan functionality from within Indigo and found something I think is worth sharing.
It starts with the following piece of software, that is my favorite price, free!!!
http://www.readpixel.com/wakeonlan/
Download and install this on your Mac, now use their client software to test and troubleshoot your wake on lan functionality.
Once you get it working, you can then use Apple Script to call this app from within an Indigo Action Group.
Sample script:
tell application "WakeOnLan"
wakeup "192.168.4.135"
end tell
The other nice thing about this software is that I did a network sniff and basically the approach is to try about 6-7 different types of WakeOnLan signals (wonderful thing about standards is that there is so many to choose from). So your chance of getting it working is quite good.
Let me know if you have any questions/concerns, would be glad to help out.
Re: Wake on Lan
Interesting. I don't have a need for this, but thanks for sharing.
I came here to drink milk and kick ass....and I've just finished my milk.
[My Plugins] - [My Forums]
[My Plugins] - [My Forums]
Re: Wake on Lan
here a python version. No need to install anything
You can put this into an action script and replace MAC number with your device number and the IP number to your BroadCast # likely ends with .255 (192.168.0.255 etc)
Karl
You can put this into an action script and replace MAC number with your device number and the IP number to your BroadCast # likely ends with .255 (192.168.0.255 etc)
Code: Select all
import socket
def sendWakewOnLan(MAC,ipN):
data = ''.join(['FF' * 6, MAC.replace(':', '') * 16])
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.sendto(data.decode("hex"), (ipN, 9))
ipBC= "192.168.1.255"
mac = "12:34:56:78:AB:CD"
sendWakewOnLan(mac, ipBC)
-
- Posts: 12
- Joined: Mon Jan 14, 2019 10:11 pm
Re: Wake on Lan
Thanks Karl!
Agreed, I would rather call it straight from an action group. I'll give this a try and let you know how it works out.
RS
Agreed, I would rather call it straight from an action group. I'll give this a try and let you know how it works out.
RS
Re: Wake on Lan
Ps. Fingscan as well as UniFi plugins have ping and wol as options to manage up/ downs of ip devices build in.
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk
-
- Posts: 12
- Joined: Mon Jan 14, 2019 10:11 pm
Re: Wake on Lan
Karl,
I test out your script and it worked great.
Thanks for the tip.
I will look into the other plugin's as well, but the script is pretty easy/fast.
RS
I test out your script and it worked great.
Thanks for the tip.
I will look into the other plugin's as well, but the script is pretty easy/fast.
RS
-
- Posts: 12
- Joined: Mon Jan 14, 2019 10:11 pm
Re: Wake on Lan
Turns out that i already had winremote plugin installed and totally missed that it has wakeonlan, am using that now.
Re: Wake on Lan
Did something change? None of my old WOL scripts run anymore. Now I just get an error.kw123 wrote:here a python version. ....Code: Select all
import socket def sendWakewOnLan(MAC,ipN): data = ''.join(['FF' * 6, MAC.replace(':', '') * 16]) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) sock.sendto(data.decode("hex"), (ipN, 9)) ipBC= "192.168.1.255" mac = "12:34:56:78:AB:CD" sendWakewOnLan(mac, ipBC)
Code: Select all
Action Group Wake On LAN - 2nd Attempt
Script Error action group "Wake On LAN - 2nd Attempt" embedded script error:
Script Error 'str' object has no attribute 'decode'
Script Error Exception Traceback (most recent call shown last):
embedded script, line 11, at top level
embedded script, line 7, in sendWakewOnLan
AttributeError: 'str' object has no attribute 'decode'
Bill
My Plugin: My People
My Plugin: My People
Re: Wake on Lan
It’s python3
Will post a py3 version this weekend
Sent from my iPhone using Tapatalk
Will post a py3 version this weekend
Sent from my iPhone using Tapatalk
Re: Wake on Lan
Sorry I am out of town. Will have to wait until Tuesday next week.
Just became grandfather
Sent from my iPhone using Tapatalk
Just became grandfather
Sent from my iPhone using Tapatalk
Re: Wake on Lan
Congratulations Grandpa!
Sent from my iPhone using Tapatalk Pro
Sent from my iPhone using Tapatalk Pro
I came here to drink milk and kick ass....and I've just finished my milk.
[My Plugins] - [My Forums]
[My Plugins] - [My Forums]
Re: Wake on Lan
This should work with py3
Karl
Karl
Code: Select all
import socket
import struct
def sendWakewOnLan(MAC,ipN):
mac = MAC.replace(":","")
sendData = bytes.fromhex("FF" * 6 + mac * 16) # <---- changed from py2
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.sendto(sendData, (ipN, 9))
ipBC= "192.168.1.255"
mac = "12:34:56:78:AB:AB"
sendWakewOnLan(mac, ipBC)
Re: Wake on Lan
Worked like a charm. More importantly, how's that grandbaby?kw123 wrote:This should work with py3
Karl
Bill
My Plugin: My People
My Plugin: My People
Re: Wake on Lan
Mom and baby are doing fine. As they live in Chicago and we in Vienna it will take some time before we see them.
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk