Host Engineering Forum

General Category => General Discussion => Topic started by: scottsutton on September 22, 2025, 08:20:52 AM

Title: Wake on LAN/Magic Packet
Post by: scottsutton on September 22, 2025, 08:20:52 AM
Just curious if there is any way possible that a Do-More PLC on a network could be used to wake up a sleeping PC on the same network (with a fixed IP address) using the magic packet protocol? I have an application where I need to embed a fanless industrial PC within a machine and I want to be able to wake it up for a task and then shut it back down again.

Thanks,
SS
Title: Re: Wake on LAN/Magic Packet
Post by: franji1 on September 22, 2025, 09:04:29 AM
There is a PING instruction.  Would your PC wake up on a PING to its IP Address?
Title: Re: Wake on LAN/Magic Packet
Post by: scottsutton on September 22, 2025, 09:36:23 AM
I looked and my Network Adapter and only supports wake on Magic Packet, I see where some adapters do support the ping option but not mine unfortunately.

Title: Re: Wake on LAN/Magic Packet
Post by: franji1 on September 22, 2025, 10:23:34 AM
I looked and my Network Adapter and only supports wake on Magic Packet, I see where some adapters do support the ping option but not mine unfortunately.

Sorry - I misunderstood.  Magic Packet is an actual protocol.  Do-more does not support that.
Title: Re: Wake on LAN/Magic Packet
Post by: Greg on September 22, 2025, 02:50:14 PM
I looked and my Network Adapter and only supports wake on Magic Packet, I see where some adapters do support the ping option but not mine unfortunately.
OK, so I just learned about the "Magic Packet." And it looks to me like it may be possible to do this with a PACKETOUT instruction.

The "Magic Packet" is just 102 bytes. The first six bytes are all FFs. The next 96 bytes are just the MAC address of the device you want to wake up, repeated 16 times. And you would send the packet out to address 255.255.255.255 at UDP port 7 or 9. So, if your the MAC address of the device you want to wake up is hexadecimal 11:22:33:44:55:66, then the data you send in the single packet is (in hexadecimal):

ff ff ff ff ff ff 11 22 33 44 55 66 11 22 33 44 55 66 ... 11 22 33 44 55 66

I haven't tried this. But it sounds feasible. Worth a try.