3

My goal is to wake up my PC.

I have connected my Raspberry Pi directly through LAN to my PC. I have installed etherwake and wakeonlan, and both commands failed.

Well, actually it didn't really fail, on the contrary: it said it succeeded but my PC was still off and sleepy!

How I have found the mac address of my PC:

Network Connection Details

Also rechecked with:

screenshot showing terminal with arp output

I tried those two commands:

 sudo wakeonlan <my mac address>

Outputs:

 Sending magic packet to 255.255.255.255:9 with 00:25:xx:xx:xx:xx

and I get my console back (without anything happening),

and

 sudo etherwake <my mac address>

didn't work. I got my console back without any warnings/succeed or something else.

Then I tried this command

sudo etherwake <my mac address> -D

Output:

 The target station address is 0:25:xx:xx:xx:xx.
 Packet is ff ff ff ff ff ff 00 25 xx xx xx xx 08 etc. etc.
 Sendto worked ! 116

Can someone help me?

This is my motherboard:
asrock-z68-extreme4-gen3

Oh, and yes! Boot from onboard LAN is enabled!! I checked this like 10 times for now.

8
  • 1
    @minitech: wouldn't this be a Unix & Linux question? It seems more focused on the PC end, rather than the pi itself. Dec 25, 2012 at 23:15
  • It's still more of a "computer setup" question than a programming question. I'd check that WakeOnLan is configured for the PC and THAT network card [and that the MAC address is right of course]
    – Mats Petersson
    Dec 25, 2012 at 23:20
  • @DavidThomas: Could be, I just said "maybe" because that could be where the problem is. And Super User seems to cover all of that. But U&L works too :)
    – Ry-
    Dec 25, 2012 at 23:30
  • I tried this years ago. I recall it using UDP but no worries re router and ports with that 'cos you're within your LAN anyway. Have you enabled WakeOnLAN in your BIOS?
    – barlop
    Dec 25, 2012 at 23:42
  • Yeess, 'boot from onboard lan is enabled' this setting is coming from my BIOS
    – Hopsy
    Dec 25, 2012 at 23:50

2 Answers 2

4

Once you've got WOL enabled in the target system's BIOS, check that wake on LAN is enabled in its OS. In Linux, this can be done with following the command (on the target system):

sudo ethtool <NIC> | grep "Wake"

Where <NIC> is an interface name like eth0. The output should look something like the following:

Supports Wake-on: g
Wake-on: g

If the output for Supports Wake-on doesn't contain the letter g either your hardware or driver is incompatible. If it does contain g and if the output for Wake-on contains d but not g, you should be able to enable WOL with the following command:

sudo ethtool -s <NIC> wol g

Note that this setting doesn't survive reboots, so you'll have to stash the command (minus the sudo) someplace where it will be executed on boot such as /etc/network/interfaces (which will also persist through ifdown/ifup cycles) or /etc/rc.local.

Now you should be able to wake the system from elsewhere with the wakeonlan command.

Reference: Ubuntu Help: Wake on LAN

1
  • I wanted to add to check if the ethernet cable was a crossover cable (or if using a switch, hub, router, etc...), and make sure the receiving computer is actually getting the packet (via Wireshark or some other program). Sep 15, 2017 at 3:35
0

Had a similar problem, what helped me at the end is passing the ip adresss with -i flag on wakeonlan.

For some reason it doesnt just work with mac address, but in combination with static IP I had on that machine I managed to wake it up

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .