Win Airplay wake Windows PC from sleep using Bonjour Sleep Proxy
#1
Hi,

I recently set up my windows xbmc/kodi machine to automatically wake from sleep when I select it as the airplay output on any of my apple devices (iphone, ipad etc). Now the HTPC can save energy by sleeping when idle but it remains available as an Airplay target, waking up when needed. Most of the info out there seems to suggest that the Bonjour Sleep Proxy technology behind this feature only works with macs so I thought I'd share how I did this.

  1. Your kodi machine must be capable of Wake on LAN and have the feature enabled in the BIOS. I've only tested this with a wired ethernet connection. It probably won't work for wifi networked boxes as Wireless wake on LAN requires both motherboard support and a WiFi adapter that supports the WMM (wireless multimedia) extensions. Recent apple laptops & desktops support wireless wake but it's pretty rare on other PCs.
  2. You need a networked apple device that is always switched on and connected to the network to act as the sleep proxy server, an airport express or extreme, apple tv, time capsule, even an apple desktop will work (with some additional configuration) - though you're obviously best off with one of the low power devices if saving energy is the goal.
  3. Download and install the Bonjour SDK for windows. The standard Bonjour for windows does not include the Bonjour control panel applet that lets you enable wake on demand. To download the SDK you have to sign up as an apple developer.
  4. Open the Bonjour control panel applet and activate "Enable Wake on Demand".
Image

Now any Bonjour advertised service running on the PC when it goes to sleep (e.g airplay from kodi, itunes server) will continue to be advertised on the network by the sleep proxy server. Any attempt to connect to one of those services will cause the sleep proxy to wake up the host computer via wake on lan.

Your mileage may vary - it's not totally seamless with my HTPC as it doesn't wake up quickly enough. I usually have to select it as the airplay target twice, once to wake it up (which then times out) and again to actually get the music or video playing. Still much better than messing around with a separate wake on lan app, especially for technophobe family members.

With wake on demand switched on the sleeping computer will wake every couple of hours for a few moments to refresh the network status and let the sleep proxy server know it's still available.

There is also a project to create a Sleep proxy client for linux here.

In theory any machine running Apple's open source Bonjour mDNSresponder service should be able to act as a sleep proxy server but I haven't yet really investigated this. It would be cool to get a linux version running so open source router firmware such as dd-wrt could act as a sleep proxy but I'm not aware of anyone who has done this yet.
Reply
#2
Nice how-to! Thanks for sharing :D
Reply
#3
Thank you very much for sharing this info. Unfortunately I can't get it to work.

I have an AirPort. I run Kodi (Sept 29th with Memphiz' AirPlay fix for iOS 8) on Win 7 x64 SP1.

I downloaded the Bonjour SDK for Win v2.04 from the Apple site. "Enable Wake on Demand" has been selected. I'm able to wake up my pc from sleep via WOL.

Nothing happens when I select my pc as an AirPlay target from my iPhone (iOS 8.02) while my pc is asleep.

Did I forget something? Your help is much appreciated!
Reply
#4
I've been having some problems too. It works but intermittently (sometimes my machine doesn't seem to register with the sleep proxy so it disappears as an airplay target) If it appears as an airplay target whilst asleep but isn't woken then I'm not sure what the problem is. Double check that normal WOL is working correctly .

I'm currently trying to work out what is causing the problem of the intermittent airplay target listing and will update the howto once I have more details.

One thing to note is that if you install itunes it updates Bonjour to version 333.10 and the control panel utility will no longer work (at least on 64-bit windows it doesn't for me). You need to use regedit to manually create the "HKEY_LOCAL_MACHINE\SOFTWARE\Apple Inc.\Bonjour\Power Management" key and create a DWORD value named "Enabled" with a value of "1" within that key. I think the issue is due to the control panel app being 32 bit and Bonjour 333.10 being native 64 bit (see here for more details)

You can download .reg registry entry files to enable or disable sleep proxy with Bonjour 333.10 below (right click and save as):

Bonjour Sleep Proxy ON.reg
Bonjour Sleep Proxy OFF.reg

You may need to reboot or restart the bonjour service after importing the registry key.
Reply
#5
Thanks!

I had installed the Bonjour version that comes with iTunes 11.4. Adding the reg entry did the trick. However selecting my Kodi box as an AirPlay target isn't enough. It wakes up only after starting audio or video playback.
Reply
#6
You're welcome. If anyone is wondering how to check which version of Bonjour they have installed, it's listed in the "Programs and Features" control panel . You can also check via the command line with "dns-sd -V" (note capital 'V' is required).
Reply
#7
I kept receiving a Windows message saying that there was an IP address conflict when Windows (Kodi) resumed from sleep. (Usually after 30 min or so.)

Windows Event Viewer showed following message: "The system detected an address conflict for IP address 0.0.0.0 with the system having network hardware address [...]. Network operations on this system may be disrupted as a result." Log Name: System; Source: Tcpip; Event ID: 4199; Level: Error. Please note it literally said IP address 0.0.0.0 !

The issue disappeared after I removed the Bonjour SDK.
Reply

Logout Mark Read Team Forum Stats Members Help
Airplay wake Windows PC from sleep using Bonjour Sleep Proxy0