[MOD][XPOSED][KK] Wi-Fi Deep Sleep

Search This thread

szunyi77

Senior Member
Sep 24, 2012
1,203
300
Szeged
Hello. Try the app now, but I can not turn off the WiFi. I am currently c-rom 4.4.2 and Boeffla kernel .. the module is active, and was also reboot .. What do you spoil? Thanks

Sorry for my bad english..
 

abusalimov

Senior Member
Mar 27, 2014
59
68
34
St. Petersburg
Hello. Try the app now, but I can not turn off the WiFi. I am currently c-rom 4.4.2 and Boeffla kernel .. the module is active, and was also reboot .. What do you spoil? Thanks

Sorry for my bad english..

Did you make the necessary changes to settings?
Also note that even after turning the screen off Android waits for about 15 minutes before actually shutting down a Wi-Fi connection. Until that, this timeout is reset each time you turn on the screen, that is if you are going to check it say every 10 minutes, it will never be turned off. Give it some time.
 
  • Like
Reactions: szunyi77

szunyi77

Senior Member
Sep 24, 2012
1,203
300
Szeged
Did you make the necessary changes to settings?
Also note that even after turning the screen off Android waits for about 15 minutes before actually shutting down a Wi-Fi connection. Until that, this timeout is reset each time you turn on the screen, that is if you are going to check it say every 10 minutes, it will never be turned off. Give it some time.

The settings are "never"! Is it true? I did not know the 15 minutes, I'm going to wait and watch.

Sorry for my bad english..
 

maxxhtc

Senior Member
Jul 25, 2013
182
17
What's the difference between turning wifi off manually before going to bed with regular mobile internet on and using this module :confused:
 
Last edited:

RonAmihai

Member
Apr 21, 2014
12
0
Great module It would be nice if you'll add few options:
1) Deep Sleep for 3G/LTE
2) while deep sleeping - every 5/10/15/30 minutes the wifi/3G/LTE is enabled for 30 seconds to check updates and turned off again till the next checking.

I actually use this app for this idea: https://play.google.com/store/apps/details?id=com.ggdiam.batterysaver
It's very simple and does the job nicely, but the dev doesn't update it anymore.
 
Last edited:

abusalimov

Senior Member
Mar 27, 2014
59
68
34
St. Petersburg
Great module It would be nice if you'll add few options:
1) Deep Sleep for 3G/LTE
2) while deep sleeping - every 5/10/15/30 minutes the wifi/3G/LTE is enabled for 30 seconds to check updates and turned off again till the next checking.

I actually use this app for this idea: https://play.google.com/store/apps/details?id=com.ggdiam.batterysaver
It's very simple and does the job nicely, but the dev doesn't update it anymore.

I'm not pretty sure about putting mobile internet asleep as well as Wi-Fi, I expect the phone to be online all the time after all. Though allowing Wi-Fi to wake up every N minute/hour sounds good to me, I probably should think about implementing this one day. Thank you!
 

Netuser

Senior Member
Feb 4, 2006
1,662
778
Toronto
There is something I dont understand, I thought that mobile data drain more battery then Wifi when used, so wouldn't turning off Wifi and using Mobile data instead will create more battery drain during the sleep ?
 

maxxhtc

Senior Member
Jul 25, 2013
182
17
There is something I dont understand, I thought that mobile data drain more battery then Wifi when used, so wouldn't turning off Wifi and using Mobile data instead will create more battery drain during the sleep ?
Yeah, that was my question about kind of. Can't really see the benifit atm. I'm sure there is one or else this thread wouldn't exist but keen to find out why :silly:
 

abusalimov

Senior Member
Mar 27, 2014
59
68
34
St. Petersburg
There is something I dont understand, I thought that mobile data drain more battery then Wifi when used, so wouldn't turning off Wifi and using Mobile data instead will create more battery drain during the sleep ?

Yeah, that was my question about kind of. Can't really see the benifit atm. I'm sure there is one or else this thread wouldn't exist but keen to find out why :silly:

Yeah, it is, in theory.
In practice keeping Wi-Fi on often causes certain wakelocks (like wlan_rx_wake) to drain more battery by keeping CPU active than a power needed to maintain a mobile data connection. The amount of time these wakelocks may take place depends on Wi-Fi router, I guess; at my home keeping Wi-Fi on during the night eats a looot more batter than when it is off and mobile internet is used instead. Also note that when Wi-Fi is on, all applications are aware that there is a high speed unlimited connection available, and thus may behave differently (start syncing heavy files, etc.).
 
Last edited:
  • Like
Reactions: maxxhtc

Jsheeler84

Senior Member
May 11, 2012
55
7
Having an issue with WiFi not reconnecting after phone is woken up from a deep sleep is this thread still active? Had to disable this module...

Sent from my Nexus 5 using Tapatalk
 

abusalimov

Senior Member
Mar 27, 2014
59
68
34
St. Petersburg
Having an issue with WiFi not reconnecting after phone is woken up from a deep sleep is this thread still active? Had to disable this module...

Sent from my Nexus 5 using Tapatalk
I've experienced this as well, though quite rarely. Didn't investigate this yet.

Also try enabling Scanning always available[\b], I didn't notice any increase of battery consumption. Effectively the mod will only prevent connecting to a net when showing unlock screen. I'm not sure about whether this would fix your issue though.
 

noneandnonly

Member
Aug 19, 2014
48
11
I'll probably use this and test it a bit on my Huawei Ascend P6 until I find a solution which disables WiFi connectin only for certain apps or whitelists only certain apps.

Or does anyone know about a module or app that allows me to whitelist certain apps (like messengers) so they can use my WiFi but apps not on the whitelist would be blocked from using my WiFi connection (so they won't wake my phone)?
 

Pkt_Lnt

Inactive Recognized Contributor
Dec 26, 2011
7,894
5,804
SLO
I'll probably use this and test it a bit on my Huawei Ascend P6 until I find a solution which disables WiFi connectin only for certain apps or whitelists only certain apps.

Or does anyone know about a module or app that allows me to whitelist certain apps (like messengers) so they can use my WiFi but apps not on the whitelist would be blocked from using my WiFi connection (so they won't wake my phone)?

Better Wifi On/Off will let you whitelist apps for wifi.
 

VooDoo`

Senior Member
Sep 3, 2010
159
16
Hi,

I like this module so much, unfortunately it doesn't work at my office wifi. There the WiFi connection is constantly up. How can I find out what keeps the WiFi connection alive? Is this a router problem? Any tips?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    Only for Android KitKat.

    Once installed this mod prevents Wi-Fi from waking up during device sleep mode and when you turn on the screen without unlocking it (to look at the clock, for example).

    Background

    Normally Wi-Fi can be awakened and kept on due to Wifi locks held by certain applications that often use to abuse this opportunity. This results in Wi-Fi being turned on over up to the half of the total sleep time (or even more) which in turn of course eats the battery. Another issue is that once turned on by a single application it notifies and awakes lots of other apps that may start, for example, their heavy synchronization tasks, etc., making everything even worse.

    Auto Wi-Fi apps

    Nevertheless, Wifi lock is a good mechanism when used carefully, and generally it should be respected when deciding whether to switch Wi-Fi on and off. This becomes a problem for most of Wi-Fi management apps found in Play Market: they can switch Wi-Fi off in the middle of a Skype call just because the screen was turned off.

    The solution

    This mod alters a system state machine responsible for managing Wi-Fi so that once put to sleep it can not be woken up by any application that requests a lock. Wi-Fi is only put asleep when no application holds a lock. That is it doesn't cancel locks held already, but once all of them are gone, no one else is able to aquire a new lock until the screen is turned on and unlocked. This doesn't apply to special high performance Wifi lock, it still can be aquired as usual even in asleep mode (anyway, it seems that applications does not use to use this lock too often, so the battery should not became an issue).

    Installation
    1. Download and install Xposed framework
    2. Then install Wi-Fi Deep Sleep module and activate it
    3. Reboot
    Usage

    To make the mod to take an effect proceed to Settings -> Wi-Fi -> Advanced and make sure that:

    • Keep Wi-Fi on during sleep is either Only when plugged in or Never (increases data usage)
    • Scanning always available is turned off
    The module provides no user interface, nor it runs any services in a background: only modifies a corresponding part of Android. You won't be able to notice it in the main menu or in a task manager. Think of it as a patch that can be turned on and off through Xposed installer.

    Source
    The mod is open source (with permissive MIT licence), the source code is available on my GitHub.


    XDA:DevDB Information
    Wi-Fi Deep Sleep, Xposed for all devices (see above for details)

    Contributors
    abusalimov
    Xposed Package Name: ru.abusalimov.xposed.wifideepsleep

    Version Information
    Status: Stable
    Current Stable Version: 1.0

    Created 2014-05-16
    Last Updated 2014-05-15
    2
    Probably a really stupid, obvious question but.....

    If I turn wifi off manually, as I normally do leaving the house...etc... I assume this module will be of no use to me? Would only work if wifi was on, but not being accesed or used by me? Having wifi off means its off, right?

    Yes, you're right. The mod only affects a code which come into play when Wi-Fi is switched on manually (see also "Usage" for necessary settings).
    1
    Interesting. I assume this would mean no push notifications, etc.

    Yes, unless there is a mobile network available. That is the mod would be more useful for a phone rather than for a tablet.
    1
    So I've had the wlan Rx wake lock for some time now and am really blooming forward to this fixing it. However once I enabled this module my drain got worse and I made the WiFi setting changes..
    5ehysyby.jpg
    ype3e5y6.jpg


    Sent from my Nexus 5 using Tapatalk
    1
    Well I rebooted after enabling the module. And I'm not sure if these would interfere but I'm running the Franco kernel and had the pia VPN app running during the log above. The only reason the battery lasted for 16 hours or so is because I have WiFi-o-matic auto switching off WiFi overnight.

    Sent from my Nexus 5 using Tapatalk

    Ah, wait, it seems that I've found a suspicious piece of code that I might miss to handle properly. But it is only responsible for updating battery stats, not for real battery consumption. I'll fix it soon.

    BTW I use franco kernel too, but this can't be related to the issue. Thanks for the info though. ;)

    P.S. I'm not sure how it will work with WiFi-o-matic, the mod is designed to work with stock Wi-Fi management (no apps).