remcohaszing / pywakeonlan

A small python module for wake on lan.
https://pywakeonlan.readthedocs.io
MIT License
281 stars 68 forks source link

Not working on windows 10 #2

Closed PrivatePuffin closed 7 years ago

PrivatePuffin commented 7 years ago

The script (and underlaying program) doesn't seem to be working on windows 10, any info on that?

It does detect wrong entered MAC details, but after execution the PC doesn't start.

It doesn't seem to be a local problem, other WOL utility's seem to work fine. Also it doesn't seem to be a script problem, running the program using other utility's (ex. home assistant) doesn't seem to work either.

vtestagrossa commented 7 years ago

In Windows 10, the socket libraries prevent sending broadcast to 255.255.255.255 via UDP in Python for some reason. Use the wol.send_magic_packet('ff.ff.ff.ff.ff.ff', ip_address='192.168.1.255', port=9) but obviously substitute the values for the mac address, the first 3 octets of your LAN (you can even send using a class A broadcast in Windows 10, but not all 4 octets), and the destination port. It's working for me when I use it like that.

remcohaszing commented 7 years ago

I never tested this on Windows. I'm going to assume the comment by @vtestagrossa resolves this issue. If not, please leave a comment (and a PR if possible 😄 ).