Jump to content

Wake reason: RTC (Alarm) - how to deactivate?

wake RTC (Alarm) ethernet network access sleep RTC

Best Answer mnfesq, 19 October 2014 - 04:23 PM

My laptop was waking up every two hours like everyone else's here so I used the mdnsresponder files and launch daemons that I downloaded from this thread (post 33), unloaded and then reloaded the mdnsresponder and discoveryd files and it worked well. I got my internet back on and no longer have the laptop waking up on its own. Thanks mcdougal33.

 

However, I was unable to upgrade to Yosemite so I downloaded the full 5 GB installer and installed the final version of 10.10 and, with a few quirks in the installation process, it installed correctly.  But I had no internet.  I couldn't remember where the mdnsresponder files go (usr/sbin) and I couldn't remember the terminal commands for unloading and reloading the mdnsresponder and discoveryd files. (Fortunately, I had done it fairly recently so I could use my up arrow in terminal to find them and rerun them.)  But it occurred to me that there should be instructions with the files to explain how to install them so that someone who needs that information and finds that they can't access the internet can get it.  I took the liberty to put one together and add it to the mdnsresponder files that mcdougal33 uploaded in post 33 of this thread.

 

[attachment=150733:mDNSResponder with Instructions.zip]

 

EDIT - The instructions have been modified to conform to the comments regarding the original instructions below.

Go to the full post


  • Please log in to reply
213 replies to this topic

#81
VirusX

VirusX

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 402 posts
  • Gender:Male
  • Location:Germany

Cave_Dweller, I personally would go with 2) and try your luck. You won't really destroy something crucial here. You will only disable one DNS service and replace it with an old one. The worst you can expect is no internet connection.

This solution here can also easily be undone/uninstalled again by unloading the 2 mDNS services, removing those 4 files and loading discoveryhd again.

 

Good luck!



#82
TheQL

TheQL

    InsanelyMac Protégé

  • Members
  • Pip
  • 2 posts
  • Gender:Male
  • Location:Germany

This is an interesting read and I grabbed the mDNSResponder.zip for future consideration, still a little reluctant about the process. Anyway it was a nice effort, thanks for your work. Found this support article about mDNSRespnder - http://support.apple...iewlocale=de_DE - so Apple isn't completely inconsiderate about Bonjour issues, now they just need to add options like this to discoveryd, also for both ways, advertising and receiving Bonjour announcements and we might be set.

Also some setting in-between might be nice, I do like seeing Bonjour services, but I am fine with restricting that to my Mac being actually turned on, d'oh!



#83
Irish10

Irish10

    InsanelyMac Protégé

  • Members
  • Pip
  • 4 posts

Oops. So real Mac would also have this issue? When mac wakes up, will the display be lit?

Yes they do. I don't know if thats a problem with old Macs or new ones also. I always hear my slot in drive turning on which makes me wake up at night.
Since i don't want to destroy the possibility for future Yosemite upgrades by copying unverified binaries and plist files which will replace the new discoveryd service and probably bring new unknown bugs, i choose the other fix mentioned which just disables multicast in discoveryd plist. Since i don't use auto discovery features im fine with it and haven't seen any cons yet. My nas shares working like before. Mounted by IP

 

This is an interesting read and I grabbed the mDNSResponder.zip for future consideration, still a little reluctant about the process. Anyway it was a nice effort, thanks for your work. Found this support article about mDNSRespnder - http://support.apple...iewlocale=de_DE - so Apple isn't completely inconsiderate about Bonjour issues, now they just need to add options like this to discoveryd, also for both ways, advertising and receiving Bonjour announcements and we might be set.

Also some setting in-between might be nice, I do like seeing Bonjour services, but I am fine with restricting that to my Mac being actually turned on, d'oh!

The way of doing this: http://support.apple...iewlocale=de_DE with new discoveryd is described in this blog article: http://ispire.me/fix...m-wakeup-issue/



#84
p.H

p.H

    InsanelyMac Legend

  • FAQ Team
  • 787 posts
  • Gender:Male
  • Interests:Hackintosh & NBA & COD4 promod

Keeping in mind that I haven't personally witnessed the behavior because my hack sits upstairs, yes, to the best of my knowledge, the hack is waking itself up every 2 hours or so and then going back to sleep automatically. I think it's doing this because the console log shows that it wakes up by RTC alarm roughly every two hours. Since the machine is always asleep when I check on it, I'm assuming it's just going back to sleep each time. To the best of my knowledge, that is the designed intention on Apple's part. They sort of intend their machines to "silently" wake up, check for stuff like new mail, time machine backups, software updates, etc., and then go back to sleep. The darkwake stuff is sort of an override to that, as far as I know - when you tell it "darkwake 0" my  understanding is "never wake silently, always come fully awake" but it's been a while since I messed with that so I may be way off.

Oops. But in my opinion, if that's what Apple really wants to do, wake up should not light the screen. Isn't it?



#85
aol

aol

    InsanelyMac Protégé

  • Members
  • Pip
  • 38 posts

Oops. But in my opinion, if that's what Apple really wants to do, wake up should not light the screen. Isn't it?

My understanding is that the normal process is that the screen does not light. Certainly on real Macs I don't think the screen lights. Hacks of course have different c-states etc (stuff managed by the SDST file) that indicate how deeply to sleep, how lightly to wake, in addition to the darkwake setting. This can also muck with "wake for network access". Earlier I was trying to get my hack to wake via network "magic packet" and I could hear the drive wake up but the screen wouldn't light. So I changed darkwake to 0, and solved that issue; the screen fully lit. 

 

It all depends on what you want to accomplish. My understanding is that real Macs wake without lighting the screen periodically by design, and wake for network access fully. Hacks are an entirely different beast and it can take some fiddling to get the behavior you want, including not waking every two hours as this thread is primarily geared towards.



#86
p.H

p.H

    InsanelyMac Legend

  • FAQ Team
  • 787 posts
  • Gender:Male
  • Interests:Hackintosh & NBA & COD4 promod

My understanding is that the normal process is that the screen does not light. Certainly on real Macs I don't think the screen lights. Hacks of course have different c-states etc (stuff managed by the SDST file) that indicate how deeply to sleep, how lightly to wake, in addition to the darkwake setting. This can also muck with "wake for network access". Earlier I was trying to get my hack to wake via network "magic packet" and I could hear the drive wake up but the screen wouldn't light. So I changed darkwake to 0, and solved that issue; the screen fully lit. 

 

It all depends on what you want to accomplish. My understanding is that real Macs wake without lighting the screen periodically by design, and wake for network access fully. Hacks are an entirely different beast and it can take some fiddling to get the behavior you want, including not waking every two hours as this thread is primarily geared towards.

:D I think Real Macs users could implement this method to avoid two-hours wake up as well if they really wants to mess with it. :D Anyway, I suppose your MB is BIOS only. I once thought DarkWake was related to UEFI only. Am I wrong about that?



#87
TheQL

TheQL

    InsanelyMac Protégé

  • Members
  • Pip
  • 2 posts
  • Gender:Male
  • Location:Germany

 

 

The way of doing this: http://support.apple...iewlocale=de_DE with new discoveryd is described in this blog article: http://ispire.me/fix...m-wakeup-issue/

 

Thanks, I've seen that, but losing the signal strength icon is sort of a downer for me... Maybe I'll just leave it waking up, although I'm not even sure if my router works as a Bonjour sleep proxy at all...



#88
aol

aol

    InsanelyMac Protégé

  • Members
  • Pip
  • 38 posts

:D I think Real Macs users could implement this method to avoid two-hours wake up as well if they really wants to mess with it. :D Anyway, I suppose your MB is BIOS only. I once thought DarkWake was related to UEFI only. Am I wrong about that?

This is a GA Z77-series mobo, so it's BIOS/UEFI, currently booting clover/UEFI. I think darkwake is mobo-agnostic; I know I changed it with my older BIOS mobo. My recollection is that somewhere around snow leopard or lion, Apple completely revamped how sleep/wake worked. Prior to that, wake was wake - screen lit, system on. Apple wanted to support a "silent wake" to support periodic silent time machine backups and system updates - the machine would wake up enough to do that stuff but not light the screen. That's when I needed to set darkwake, so that the magic packet wouldn't use the "silent wake" style of waking, but rather, the full screen lit wake that I wanted.



#89
Racing Ralph

Racing Ralph

    InsanelyMac Protégé

  • Members
  • Pip
  • 2 posts
  • Gender:Male

Perhaps switching to 'safe sleep' could resolve the problem.

 

     hibernatemode = 0 (binary 0000) by default on supported desktops. The system will not back memory up to persistent storage. The system must wake

     from the contents of memory; the system will lose context on power loss. This is, historically, plain old sleep.

 

     hibernatemode = 3 (binary 0011) by default on supported portables. The system will store a copy of memory to persistent storage (the disk), and will

     power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from hibernate image.

 

     hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will

     remove power to memory. The system will restore from disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life,

     you should use this setting.

 

To get the current hibernate mode, issue via Terminal:

pmset -g

Using hibernatemode no. 25, the computer is switched off, so it should not wake up every 2 hours. Hibernatemode 25 is activated via

sudo pmset -a hibernatemode 0

Unfortunately I can not test this, because my system freezes at wake up, when using mode 25. It freezes right after Clover - display stays black, system dead, have to press power button to reboot the machine. After that system reboots regular.

 

Update: Got hibernation working with this fix. But it didnt solve the the Wake reason: RTC (Alarm) issue. System wakes up every 0.5-2h in a crashed state.



#90
p.H

p.H

    InsanelyMac Legend

  • FAQ Team
  • 787 posts
  • Gender:Male
  • Interests:Hackintosh & NBA & COD4 promod

Perhaps switching to 'safe sleep' could resolve the problem.

 

 

To get the current hibernate mode, issue via Terminal:

pmset -g

Using hibernatemode no. 25, the computer is switched off, so it should not wake up every 2 hours. Hibernatemode 25 is activated via

sudo pmset -a hibernatemode 0

Unfortunately I can not test this, because my system freezes at wake up, when using mode 25. It freezes right after Clover - display stays black, system dead, have to press power button to reboot the machine. After that system reboots regular.

:D It's great to see people are taking efforts to sort this puzzle out. Just so you know, I set hibernatemode to 0 as soon as I finished installing the OS. So I don't think setting 0 will take effect.



#91
Racing Ralph

Racing Ralph

    InsanelyMac Protégé

  • Members
  • Pip
  • 2 posts
  • Gender:Male

Using hibernatemode no. 25, the computer is switched off, so it should not wake up every 2 hours. Hibernatemode 25 is activated via

sudo pmset -a hibernatemode 0

 

 

:D It's great to see people are taking efforts to sort this puzzle out. Just so you know, I set hibernatemode to 0 as soon as I finished installing the OS. So I don't think setting 0 will take effect.

 

Sorry - my fault, typo. I wanted to suggest to set it to '25'. So the command ist:

sudo pmset -a hibernatemode 25


#92
p.H

p.H

    InsanelyMac Legend

  • FAQ Team
  • 787 posts
  • Gender:Male
  • Interests:Hackintosh & NBA & COD4 promod

 

Sorry - my fault, typo. I wanted to suggest to set it to '25'. So the command ist:

sudo pmset -a hibernatemode 25

I don't like sleepImage taking up my disk space. So I will not switch to that mode. :D

Hope somebody else would do this test. After all, mDNS method is just fine.



#93
3square

3square

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 105 posts

hi,

 

i'm having problem with my machine waking up in the middle of the night. i suppose it's power nap feature. will the fix discussed here mess with power nap feature?

 

thanks



#94
wolfie81

wolfie81

    InsanelyMac Protégé

  • Members
  • PipPip
  • 70 posts

Since changing these files over has anyone ben able to get 'auto sleep' to work fine?

 

Mine keeps going to screensaver...


Since changing these files over has anyone ben able to get 'auto sleep' to work fine?

 

Mine keeps going to screensaver...



#95
p.H

p.H

    InsanelyMac Legend

  • FAQ Team
  • 787 posts
  • Gender:Male
  • Interests:Hackintosh & NBA & COD4 promod

Since changing these files over has anyone ben able to get 'auto sleep' to work fine?

 

Mine keeps going to screensaver...


Since changing these files over has anyone ben able to get 'auto sleep' to work fine?

 

Mine keeps going to screensaver...

Mine works fine for auto sleep.



#96
wolfie81

wolfie81

    InsanelyMac Protégé

  • Members
  • PipPip
  • 70 posts
Can you please tel me what cliver settings you have for auto sleep?

#97
VirusX

VirusX

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 402 posts
  • Gender:Male
  • Location:Germany

auto sleep works fine for me too. I did not set anything for that in clover. Sorry.



#98
tseug

tseug

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 411 posts
  • Gender:Male

Another approach which might be more future proof is to just unload discoveryd when the machine is about to go to sleep and then load it again at wakeup. Sleepwatcher can be used to run scripts at sleep and wakeup events. My /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>de.bernhard-baehr.sleepwatcher</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/sbin/sleepwatcher</string>
		<string>-V</string>
		<string>-s /etc/rc.sleep</string>
		<string>-w /etc/rc.wakeup</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>KeepAlive</key>
	<true/>
</dict>
</plist>

/etc/rc.sleep:


#!/bin/sh
# Unload discoveryd to disable maintenance wakeup every two hours
launchctl unload /System/Library/LaunchDaemons/com.apple.discoveryd.plist

 
/etc/rc.wakeup:

#!/bin/sh
# Load discoveryd to enable network
launchctl load /System/Library/LaunchDaemons/com.apple.discoveryd.plist

EDIT: Changed to working configuration



#99
VirusX

VirusX

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 402 posts
  • Gender:Male
  • Location:Germany

sounds very plausible, tseug! Thanks for the suggestion! I don't have to time to test things right now but maybe in the next few weeks... (working on my master's thesis)



#100
kjp4756

kjp4756

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 132 posts
  • Gender:Male
  • Location:Canada

Another approach which might be more future proof is to just unload discoveryd when the machine is about to go to sleep and then load it again at wakeup. Sleepwatcher can be used to run scripts at sleep and wakeup events. My /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>de.bernhard-baehr.sleepwatcher</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/sbin/sleepwatcher</string>
		<string>-V</string>
		<string>-s 'launchctl unload /System/Library/LaunchDaemons/com.apple.discoveryd.plist'</string>
		<string>-w 'launchctl load /System/Library/LaunchDaemons/com.apple.discoveryd.plist'</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>KeepAlive</key>
	<true/>
</dict>
</plist>

I haven't tested it overnight yet but it seems to be working. I'll let you know if it isn't.

This looks like a good idea.  The only thing I would try differently is to use launchctl stop and start instead of load and unload. 

 

EDIT: never mind.  stop and start don't appear to work as they should.  Load and unload work fine.







Also tagged with one or more of these keywords: wake, RTC (Alarm), ethernet network access, sleep, RTC


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

© 2016 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy