PSA: If your 2015 or 2016 MBP has some battery drain while sleeping, here is the fix

Discussion in 'MacBook Pro' started by Mixolyd, Jan 9, 2017.

  1. Mixolyd thread starter macrumors member

    Mixolyd

    Joined:
    Jul 10, 2014
    Location:
    Oregon
    #51
    Update: I no longer recommend using this fix. Something changed in 10.12.4. After redoing the steps outlined, I saw that the drain was about the same as without the fix, but then for the next days saw that it actually was worse. One night my battery dropped 10% overnight, and pmset showed no wakes. Very odd. I had to revert to a Time Machine backup because simply undoing the steps by changing the text does not revert this for whatever reason. So my suggestion is that if you are on 10.12.4 then do not follow this guide and learn to live with the slight drain that occurs. I'm not aware of any fix at the moment. Note this is with a 2016 MBP nTB so it may be different with 2015 or the regular MB.
     
  2. MrGuder macrumors 68030

    Joined:
    Nov 30, 2012
    #52
    I'm running 10.12.4 and I am still using this fix and it still works for me. I'm getting about 3 or 4% drain overnight but I'm fine with that, it's nowhere near the 10% your getting. I wonder why it's working for me. I have a 2016 15" 2.7/512/455. I even went back into setting after I upgraded to 10.12.4 and the setting did not change any of my prior setting for this fix. I know some mentioned that it changed it but not for me.
     
  3. Mixolyd thread starter macrumors member

    Mixolyd

    Joined:
    Jul 10, 2014
    Location:
    Oregon
    #53
    The 10% was just one night and the next night was maybe 6%. Overall for about a week I was getting about ~4% drain. I ran "ioreg -l | grep IOPlatformFeatureDefaults" after 10.12.4 update and everything reverted to default. Not sure why it didn't for you.

    Isn't it odd that the battery would drain 4% overnight even when pmset says that it was in deep sleep the whole time? Very weird. My old 2014 has no drain at all. They must have changed something about how the battery works.
     
  4. MrGuder macrumors 68030

    Joined:
    Nov 30, 2012
    #54
    Oh ok, I really don't have anything to compare it against as this is my first Macbook Pro laptop. I didn't revert the setting back to see if the 3 or 4 % was the same without the fix. I just figured the 3 or 4% drain was normal.
     
  5. Sanpete macrumors 68020

    Joined:
    Nov 17, 2016
    Location:
    Utah
    #55
    Yes, that seems odd, but not as much as 10%! Should keep the RAM powered up for three hours, and then enter standby and use very little power after that.
     
  6. MrGuder macrumors 68030

    Joined:
    Nov 30, 2012
    #56
    As I mentioned I'm still using the fix and last night I made sure to look at what I had and battery showed 81% so this morning (9.5 hrs later) I looked to see what it showed overnight and it says 79% so I only lost 2% overnight. I never shut down my laptop, just close the lid every time I'm done.
     
  7. JohnnyW2001 Suspended

    JohnnyW2001

    Joined:
    Nov 6, 2012
    #57
    This thread is great. It's a shame the fix stopped working with 10.12.4. Didn't anything change with 10.12.5?

    Maybe DND works as Apple claims it's supposed to now? (I've just enabled it to see) https://support.apple.com/kb/PH25743
     
  8. MrGuder macrumors 68030

    Joined:
    Nov 30, 2012
    #58
    Edited, sorry wrong thread, wrong fix, thought this was the notification fix which is what I recommend.
     
  9. JohnnyW2001 Suspended

    JohnnyW2001

    Joined:
    Nov 6, 2012
    #59
    Unfortunately DND didn't make any difference and, astonishingly, after leaving my MBP in sleep mode for a day the battery went from 70% to 0%! :-/

    Maybe forced hibernation is the best solution. Hmm. Really we should be able to stop it reaching out for notifications while asleep!

    @Mixolyd Have you made any further headway with your investigations?
     
  10. Aikikaio macrumors newbie

    Aikikaio

    Joined:
    Jul 16, 2017
    #60

    I solved the problem on my MacBook Pro 2016 by turning off the TCPKeepAliveDuringSleep option with the command:
    sudo pmset -b TCPKeepAliveDuringSleep 0

    Of course if you want to go back at any time you can open terminal and enter:sudo pmset -b TCPKeepAliveDuringSleep 1

    Enjoy
     
  11. 0dev macrumors 68040

    0dev

    Joined:
    Dec 22, 2009
    Location:
    127.0.0.1
    #61
    This command does not work, the correct command is:

    sudo pmset -a tcpkeepalive 0

    After you enter your password for sudo it gives you a warning saying some features may not work properly but it disables internet during sleep.

    You can check it works by running:

    pmset -g

    Which should show "tcpkeepalive 0"

    And you can of course reverse it at any time by running:

    sudo pmset -a tcpkeepalive 1

    Easy!

    Personally I like keeping this off as it saves power and my laptop has absolutely no reason to connect to the internet during sleep.
     
  12. Aikikaio macrumors newbie

    Aikikaio

    Joined:
    Jul 16, 2017
    #62

    Rather than say that this command does not work It's better to explain the difference between the two.
    sudo pmset -a tcpkeepalive 0, change the behavior of your mac when It's connected to power suply or not.
    sudo pmset -b tcpkeepalive 0, change the behavior of your mac just when It's running from battery.

    Because I don't care about bettery drain when my mac It's plug to power suply ;-), I prefere to use this last command.

    If you have any doubt you can google It or type just pmset help on your mac.
     
  13. xsdeus macrumors regular

    Joined:
    May 24, 2012
    Location:
    San Diego, CA
    #63
    It wasn't on by default on my Mac, either.
     
  14. psynnott macrumors 6502

    psynnott

    Joined:
    Jun 18, 2012
    #64
    Doesnt work.

    Pauls-MacBook-Pro:~ paul$ sudo pmset -b TCPKeepAliveDuringSleep 0

    Usage: pmset <options>

    See pmset(1) for details: 'man pmset'

    Pauls-MacBook-Pro:~ paul$ ​
     
  15. t2nerb macrumors newbie

    Joined:
    Feb 22, 2008
    #65
    That isn't the correct command. Instead, use: 'pmset -b tcpkeepalive 0'

    This will set tcpkeepalive to 0 for battery mode. Replace '-b' with '-c' to set tcpkeepalive for charging mode. I personally leave it on in charging mode, and only set it for battery.

    To see a list of the configurable power settings, use: 'pmset -g'. I recommend reading the man page for more information.
     
  16. JohnnyW2001, Aug 9, 2017
    Last edited: Aug 9, 2017

    JohnnyW2001 Suspended

    JohnnyW2001

    Joined:
    Nov 6, 2012
    #66
    Are you sure that wasn't a typo? In a later post you say it's TCPKeepAlive not TCPKeepAliveDuringSleep

    Also if you use the -b switch then pmset -g shows 1 (not 0). Any idea why this is?
     
  17. t2nerb macrumors newbie

    Joined:
    Feb 22, 2008
    #67
    It's because you set it for battery mode. If you unplug your computer and run 'pmset -g' it should show 0 if you executed the command correctly.
     
  18. JohnnyW2001 Suspended

    JohnnyW2001

    Joined:
    Nov 6, 2012
    #68
    Thanks, you're exactly right. Furthermore...... IT WORKS! No more battery drain when it's asleep! Woo!
     
  19. SNUKE, Aug 22, 2017
    Last edited: Aug 22, 2017

    SNUKE macrumors newbie

    Joined:
    Sep 17, 2012
    #69
    Thanks this worked a treat.
    I was shocked coming form a 2012 (Battery replacement program) to a 2016 and seeing battery drop insane amount overnight. 16hrs since I closed the laptop and not 1% power drop, just like the 2012 was.
     
  20. SNUKE macrumors newbie

    Joined:
    Sep 17, 2012
    #70
    Seems I spoke too soon.

    I had the laptop charging overnight, unplugged it before work, opened up 13hrs later, and it wouldn't turn on. Plugged in power cable and it eventually did with 3% battery life showing.

    2016 15" MBPr, 2 days ago in Terminal I ran 'pmset -b tcpkeepalive 0' and then 'pmset -g' which showed 'tcpkeepalive = 0'

    First night all good, battery kept 100% over 16hrs, hence my earlier reply. Then next time, it lost everything within 13hrs.

    I just ran 'pmset -g' again and this is the full result:

    [​IMG]

    And then this:

    ioreg -l | grep IOPlatformFeatureDefaults

    "IOPlatformFeatureDefaults" = {"TCPKeepAliveDuringSleep"=Yes,"DNDWhileDisplaySleeps"=No,"TCPKeepAliveExpirationTimeout"=43200,"NotificationWake"=Yes}

    What does the above mean, why did it work the first night, then fail the next?
     
  21. SNUKE macrumors newbie

    Joined:
    Sep 17, 2012
    #71
    Another day, 18hrs in sleep mode, battery stayed at 100%, so no idea why the above happened. Hope it stays this way.
     
  22. t2nerb macrumors newbie

    Joined:
    Feb 22, 2008
    #72
    You can try using: 'pmset -g log | egrep Wake' to see what's causing your computer to wake up.
     
  23. SNUKE macrumors newbie

    Joined:
    Sep 17, 2012
    #73
  24. SNUKE macrumors newbie

    Joined:
    Sep 17, 2012
  25. Barry83 macrumors newbie

    Barry83

    Joined:
    Sep 7, 2017
    Location:
    Germany
    #75
    my terminal shows this message
    Warning: This option disables TCP Keep Alive mechanism when sytem is sleeping. This will result in some critical features like 'Find My Mac' not to function properly.

    'pmset' must be run as root...

    any idea?
     

Share This Page