Contribute
Register

Unable to wake on demand/LAN via ethernet in MacOS 10.9

Status
Not open for further replies.

jtb

Joined
Aug 3, 2013
Messages
14
Mac
  1. 0
Classic Mac
  1. 0
Mobile Phone
  1. 0
I have a GA-H87N-WIFI motherboard and am running 10.9. Mostly the machine is working quite well now. You can see more about how it's set up here.

I'm experiencing a bizarre problem. I need to access services on the MacOS on demand (primarily samba shares), but the machine will sometimes go to sleep for lack of activity. This is a good thing as it saves power. I can wake the machine without trouble by using the USB keyboard. The problem arises when I try to use the network to wake the machine. This is built into MacOS via the Wake on Demand function, so long as you have a sleep proxy on the network (I do, in the form of an AppleTV 2). This does not work. Even if I try to ssh in (or I try sending new commands to an ssh connection that was open when it went to sleep), the machine stays asleep.

Needless to say I have Wake on LAN enabled in the BIOS (and Erp is disabled) and "Wake for Ethernet network access" enabled under System Preferences->Energy Saving.

To rule out any malfunction in the Bonjour services that support Wake on Demand (what I initially thought was messed up), I tried sending magic Wake on LAN packets to the machine. This also fails to work.

It gets stranger. When I boot Linux, I can see (via ethtool) that wake on lan is enabled in the network card. And if I then shut down the machine, I can indeed use magic packets to wake the machine. However, if I then boot MacOS and immediately shut down the machine without logging in, this no longer works. If I then manually power up and run only the bios setup utility and power down with no changes, I can again use magic packets to wake the machine.

And there's more: when I am in what I assume is S3 ACPI state (sleep mode) under MacOS, I do not see any lights on the ethernet card. By contrast, when the machine is in S5 state (soft power off), the ethernet card is periodically blinking (this is the case regardless of whether or not wake on lan is working while the machine is shut down -- which depends upon whether I've just shut down from macOS or not).

From what I can surmise then, MacOS must be telling the network card to disable wake on LAN while also telling it to power down more during sleep states than it normally does during shutdown states. Both these behaviors are contrary to the stated goals of Apple, which is to support Wake On Demand (which is also what I need).

I'm quite puzzled as to what's going on, but thinking now that it must have to do with the hackintosh ethernet drivers. For the record, although I have both Atheros and Intel drivers installed on my machine (as there are 2 ethernet ports, from apparently different manufacturers, on the motherboard), I'm using en0 and this is the Intel one (evidence below).

Any help would be much appreciated as I'm starting to lose hair over this...

Code:
$ system_profiler|awk '/^Ethernet Cards/{c=15;next}c-->0'

    ethernet:

      Type: Ethernet Controller
      Bus: PCI
      Vendor ID: 0x8086
      Device ID: 0x153b
      Subsystem Vendor ID: 0x1458
      Subsystem ID: 0xe000
      Revision ID: 0x0004
      BSD name: en0
      Kext name: AppleIntelE1000e.kext
      Location: /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleIntelE1000e.kext
      Version: 2.5.4
 
I've been able to confirm that when sleeping under linux, the ethernet card's lights are on, and wake on LAN works correctly. This is definitely a macOS issue.

I've found a webpage that has invaluable info related to this topic: http://www.cnpbagwell.com/mac-os-x/bonjour-sleep-proxy

Based on this info, I tried setting the kernel option darkwake=8 . But this appeared to make no difference. The card is still dark when sleeping under MacOS, and Wake on LAN fails. [Maybe the flags have changed again in MacOS 10.9. Sleep still begins as it should when sufficient idle time passes.]

When I get more detailed debugging info from mDNSResponder, I see that it doesn't appear to think my ethernet connection supports Wake on Demand. This may be the root of the problem:

Code:
$ sudo killall -INFO mDNSResponder; tail -1000 /var/log/system.log | grep "v4 en0"
Nov 14 04:24:33 demon.r.net mDNSResponder[49]: 00007FF969008E00  4, Registered 00007FF969005E00,  v4 en0   (140733193388036) 94:DE:80:A2:5A:7B 00:00:00:00:00:00        v4 0.0.0.0            A M   192.168.10.10

(The lack of a sun symbol at the end supposedly means no wake on demand support detected)
If the kernel thinks my card can't do WOL, it might just disable it to save the trouble. Unfortunately that's not the case - it does support WOL.

mDNSResponder is a bit more divided over whether I have Wake on magic packet (WOMP) support:
Code:
$ sudo killall -USR1 mDNSResponder
$ sudo syslog -c mDNSResponder en
$ syslog | grep WOMP
Nov 14 04:36:34 demon.r.net mDNSResponder[49] <Notice>: en0    FE80:0000:0000:0000:96DE:80FF:FEA2:AA7B supports WOMP
Nov 14 04:36:34 demon.r.net mDNSResponder[49] <Notice>: en0    192.168.10.10  [B]supports WOMP[/B]
Nov 14 04:36:34 demon.r.net mDNSResponder[49] <Notice>: en1    FE80:0000:0000:0000:96DE:80FF:FEA2:AA79 no WOMP
Nov 14 04:36:52 demon.r.net mDNSResponder[49] <Notice>: en0    FE80:0000:0000:0000:96DE:80FF:FEA2:AA7B no WOMP
Nov 14 04:36:52 demon.r.net mDNSResponder[49] <Notice>: en0    192.168.10.10  [B]no WOMP[/B]
Nov 14 04:36:52 demon-mac.local mDNSResponder[49] <Notice>: en0    FE80:0000:0000:0000:96DE:80FF:FEA2:AA7B supports WOMP
Nov 14 04:36:53 demon-mac.local mDNSResponder[49] <Notice>: en0    FE80:0000:0000:0000:96DE:80FF:FEA2:AA7B supports WOMP
Nov 14 04:36:53 demon-mac.local mDNSResponder[49] <Notice>: en0    192.168.10.10  supports WOMP
Nov 14 04:36:56 demon.r.net mDNSResponder[49] <Notice>: en0    FE80:0000:0000:0000:96DE:80FF:FEA2:AA7B supports WOMP
Nov 14 04:36:56 demon.r.net mDNSResponder[49] <Notice>: en0    192.168.10.10  supports WOMP
Nov 14 04:36:59 demon.r.net mDNSResponder[49] <Notice>: en0    FE80:0000:0000:0000:96DE:80FF:FEA2:AA7B supports WOMP
Nov 14 04:36:59 demon.r.net mDNSResponder[49] <Notice>: en0    192.168.10.10  supports WOMP
Nov 14 04:36:59 demon.r.net mDNSResponder[49] <Notice>: en0    FE80:0000:0000:0000:96DE:80FF:FEA2:AA7B supports WOMP
Nov 14 04:36:59 demon.r.net mDNSResponder[49] <Notice>: en0    192.168.10.10  supports WOMP
Nov 14 04:36:59 demon.r.net mDNSResponder[49] <Notice>: en0    FE80:0000:0000:0000:96DE:80FF:FEA2:AA7B supports WOMP
Nov 14 04:36:59 demon.r.net mDNSResponder[49] <Notice>: en0    192.168.10.10  supports WOMP
 
The default flag does not appear to have changed from darkwake=11 since OSX 10.8, based upon this kernel code which is linked to the 10.9 release.

Therefore the darkwake=8 option should not have changed from version 10.8. So this does not appear to address my problem.
 
Tino, thanks for the tip. I was thinking of trying the same thing when I came to look for any responses. Indeed, when I use the Atheros ethernet port, WOMP works, and so does WOD. I guess that's the benefit of having redundant ports from different vendors on the motherboard!

So that pretty much confirms that the issue was a result of a deficiency in the AppleIntelE1000e v2.5.4d driver.

I was also able to setup samba as a bonjour service, so the machine will wake when anyone on the network tries to access a network share. The details are here (towards the bottom). Next step is to setup wake on demand to run under linux as well, using my appletv as the sleep proxy ;).
 
For the record, there is a bug in linux (the alx driver, specifically) that blocks wake on lan with the atheros port. The Intel port (only) works there, and the atheros card (only) works in macos. Clearly then, I can't win.:think:
 
Hey, Justin

This looks interesting. I read your blog about Samba and Macs and I think I'll experiment with this, just because I can! However, my board has an issue with WOL and I have the BIOS set to disable because the Mac would keep waking up instead of going to sleep.
 
Status
Not open for further replies.
Back
Top