[App] Wi-Fi Keep Alive 1.4.2 - Don't let wi-fi turn off when screen goes off

Search This thread

shantzg001

Inactive Recognized Developer
^^ Mario, could you please mention these things:
1. What is the ROM version that you have?
2. What is the app version that you have? (latest is 1.2.1)
3. Did you enable the workarounds in the advanced options?
4. Can you please enable logging in the advanced options and send me logcat dump for this duration
 

maRioHD

Member
Mar 11, 2010
27
1
1. My rom is a deodexed frf91.

2. I am running version 1.3, which is the lastest version but i have always had problems with pandora on the nexus one. I think its just the hardware problem not pandora's fault.

3. I have enable both workarounds both didnt work.
 
Last edited:

shantzg001

Inactive Recognized Developer
Thanks Mario. Btw, by "app version" I meant the version of Wi-FI Keep Alive that you are using. I am not able to see the logs from my app in these logs but one thing is for sure that atleast the software is not turning off wi-fi.

This is because if that was the case, you should have seen a log like "setting ACTION_DEVICE_IDLE timer for ..." after you see the logs "D/WifiService( 85): ACTION_SCREEN_OFF" and/or "D/WifiService( 85): ACTION_BATTERY_CHANGED pluggedType: 2".

Do you face this failure immediately after screen is turned off or it takes some time? Does this happen even if you are doing a file transfer instead of using pandora?
 

FormelLMS

Retired Recognized Developer
Oct 28, 2009
2,647
376
Hm, I don't know, whats to do.
With or without this app, its the same.

If I ping the Nexus with enabled screen, I have pingtimes 1-100, with screen off I have 200 - 3000 and dropped.
 

maRioHD

Member
Mar 11, 2010
27
1
haha my bad, and yes i am running the lastest version of your app.

And the wifi stops the streaming a minute or 2 after the screen is already off, but for file transfers or downloads it stops it right away.

I dont know its weird, but oh well atleast the app turns wifi back on when screen is turned on. Before i was manually turning the wifi off and on again.
 

jbrinkley

Senior Member
Jan 12, 2010
179
12
florida
OP,

I will be working on my phones sat and sun probably all day. I have both versions and have been working on the att one for days with no luck. had your app on both phones and went through stock att build to frf50 and to geo411 froyo with stock radio, and one previous radio under that so far. Right now I'm checking all the kernels. NO luck with the att phone.
I'm starting to think it really is a hardware issue between the phones.
I'd really like a fix and would pay for one. let me know if I can help in any way.i can get logs or flash whatever, have a netgear and a linksys.
I'll keep an eye here for you.
thanks
 

shantzg001

Inactive Recognized Developer
OP,

I will be working on my phones sat and sun probably all day. I have both versions and have been working on the att one for days with no luck. had your app on both phones and went through stock att build to frf50 and to geo411 froyo with stock radio, and one previous radio under that so far. Right now I'm checking all the kernels. NO luck with the att phone.
I'm starting to think it really is a hardware issue between the phones.
I'd really like a fix and would pay for one. let me know if I can help in any way.i can get logs or flash whatever, have a netgear and a linksys.
I'll keep an eye here for you.
thanks

Could you please try v 1.3.0 and enable all 3 workarounds? Also, if it still doesn't work, please enable all workarounds and logging option in the app and take a dump of logcat for this duration ---> start logs from slightly before phones goes to sleep, then let it go to sleep and after the wi-fi connection breaks, then bring it out of sleep. stop logs.
 

jbrinkley

Senior Member
Jan 12, 2010
179
12
florida
worked with work arounds.
TMO phone with frf91 by geo411 and 2.6.34-925xxxcfs kernel.

only one unreachable in 8 minutes.
I'll leave it all night and see what happens.
tomorrow I'm going to check the att phone.
THANK YOU.
 

jbrinkley

Senior Member
Jan 12, 2010
179
12
florida
att phone stock everything 2.2 frf91

this is an instance of it not pinging. Sometimes it does and sometimes it doesn't.
I'm still playing with it

in order to get it to ping I have to set widget first then enable wifi from the power widget.

Code:
D/WiFiKeepAlive-AdvancedOptions(  748): Done!
I/ActivityManager(   79): Displayed activity com.shantz.wifikeepalive/.WiFiKeepAlive: 3891 ms (total 3891 ms)
D/WiFiKeepAlive-Main(  748): policyChoiceClickListener onItemClick Choice: Always On
D/WiFiKeepAlive-Main(  748): updateService
D/WiFiKeepAlive-Main(  748): Start Service
I/WiFiKeepAlive-BGService(  748): onStartCommand
I/WiFiKeepAlive-BGService(  748): Received Intent { cmp=com.shantz.wifikeepalive/.BGService }
D/WiFiKeepAlive-BGService(  748): deRegisterOnPlugged
D/WiFiKeepAlive-BGService(  748): registerForWifiState
D/dalvikvm(  644): GC_EXPLICIT freed 3 objects / 72 bytes in 52ms
D/dalvikvm(  349): GC_EXPLICIT freed 2006 objects / 140072 bytes in 109ms
D/dalvikvm(  427): GC_EXPLICIT freed 2952 objects / 196968 bytes in 57ms
D/dalvikvm(   79): GC_FOR_MALLOC freed 18590 objects / 943960 bytes in 101ms
D/dalvikvm(  412): GC_EXPLICIT freed 1048 objects / 52552 bytes in 61ms
D/dalvikvm(   79): GC_FOR_MALLOC freed 6421 objects / 804856 bytes in 93ms
I/power   (   79): *** set_screen_state 0
D/WifiService(   79): ACTION_SCREEN_OFF
D/SurfaceFlinger(   79): About to give-up screen, flinger = 0x1fe228
D/AK8973  (   64): Compass CLOSE 
D/StatusBar(   79): DISABLE_EXPAND: yes
D/GoogleLoginService(  175): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }
D/dalvikvm(  175): GC_EXPLICIT freed 925 objects / 46464 bytes in 64ms
D/dalvikvm(  644): GC_EXPLICIT freed 3 objects / 72 bytes in 56ms
D/dalvikvm(  579): GC_EXPLICIT freed 93 objects / 4232 bytes in 53ms
D/dalvikvm(  175): GC_EXPLICIT freed 340 objects / 17928 bytes in 68ms
W/GTalkService(  175): [GTalkConnection.15] doConnect: caught Could not connect to mtalk.google.com:5228.: (404)
W/GTalkService(  175):   -- caused by: java.net.UnknownHostException: mtalk.google.com
 
Last edited:

jbrinkley

Senior Member
Jan 12, 2010
179
12
florida
att phone, no sim and not pinging, even though is set with all the work arounds.

Code:
---- beginning of /dev/log/main
D/alogcat (  853): stopping ...
--------- beginning of /dev/log/system
W/InputManagerService(   79): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44ba5d78
D/WiFiKeepAlive-BGService(  748): Pinging gateway 192.168.1.1
D/WiFiKeepAlive-BGService(  748): pinged
D/dalvikvm(  579): GC_EXPLICIT freed 1551 objects / 139152 bytes in 62ms
D/dalvikvm(  644): GC_EXPLICIT freed 3 objects / 72 bytes in 51ms
D/WiFiKeepAlive-BGService(  748): Pinging gateway 192.168.1.1
D/WiFiKeepAlive-BGService(  748): pinged
D/dalvikvm(  349): GC_EXPLICIT freed 5410 objects / 420912 bytes in 91ms
D/dalvikvm(  427): GC_EXPLICIT freed 92 objects / 5064 bytes in 56ms
D/WiFiKeepAlive-BGService(  748): Pinging gateway 192.168.1.1
D/WiFiKeepAlive-BGService(  748): pinged
I/power   (   79): *** set_screen_state 0
D/alogcat (  853): stopping ...
D/alogcat (  853): paused
D/WifiService(   79): ACTION_SCREEN_OFF
D/SurfaceFlinger(   79): About to give-up screen, flinger = 0x1fe228
D/AK8973  (   64): Compass CLOSE 
D/WiFiKeepAlive-BGService(  748): Pinging gateway 192.168.1.1
D/StatusBar(   79): DISABLE_EXPAND: yes
D/skia    (   79): purging 195K from font cache [13 entries]
D/GoogleLoginService(  175): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }
D/dalvikvm(  175): GC_EXPLICIT freed 823 objects / 43184 bytes in 66ms
D/WiFiKeepAlive-BGService(  748): Unreachable
D/WiFiKeepAlive-BGService(  748): Pinging gateway 192.168.1.1
D/WiFiKeepAlive-BGService(  748): Unreachable
 
Last edited:

jbrinkley

Senior Member
Jan 12, 2010
179
12
florida
att when when the ping workaround is working. I run through your widget and then set wifi on from power widget.
(with SIM installed)


Code:
D/WiFiKeepAlive-Receiver(  413): Received intentIntent { act=android.net.wifi.WIFI_STATE_CHANGED flg=0x10000000 (has extras) }
D/WiFiKeepAlive-BGService(  413): checkWorkArounds
D/WiFiKeepAlive-BGService(  413): stopWorkArounds
D/Tethering(   87): eth0 is not a tetherable iface, ignoring
D/WifiService(   87): ACTION_BATTERY_CHANGED pluggedType: 2
D/WifiService(   87): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44b94a50}
D/WifiStateTracker(   87): Reset connections and stopping DHCP
D/WiFiKeepAlive-Receiver(  413): Received intentIntent { act=android.net.wifi.WIFI_STATE_CHANGED flg=0x10000000 (has extras) }
D/WiFiKeepAlive-BGService(  413): checkWorkArounds
D/WiFiKeepAlive-BGService(  413): doWorkArounds
D/WiFiKeepAlive-BGService(  413): Acquiring WiFi Lock
D/WiFiKeepAlive-BGService(  413): Acquiring Partial Wake Lock
D/WiFiKeepAlive-BGService(  413): Setting Ping timer on
D/WifiService(   87): acquireWifiLockLocked: WifiLock{WiFiKeepAlive-BGServicewifilock type=1 binder=android.os.BinderProxy@44c8a490}
I/wpa_supplicant(  638): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00
I/wpa_supplicant(  638): WPS-AP-AVAILABLE 
I/wpa_supplicant(  638): Trying to associate with 00:26:f2:fc:dc:c0 (SSID='android' freq=2457 MHz)
I/wpa_supplicant(  638): CTRL-EVENT-STATE-CHANGE id=-1 state=3 BSSID=00:26:f2:fc:dc:c0
D/WifiStateTracker(   87): Disabling interface
I/wpa_supplicant(  638): CTRL-EVENT-DRIVER-STATE STARTED
D/NetworkStateTracker(   87): setDetailed state, old =DISCONNECTED and new state=CONNECTING
D/NetworkStateTracker(   87): setDetailed state, old =CONNECTING and new state=SCANNING
D/LocationMasfClient(   87): getNetworkLocation(): Returning cache location with accuracy 199.0
D/NetworkStateTracker(   87): setDetailed state, old =SCANNING and new state=CONNECTING
D/ConnectivityService(   87): ConnectivityChange for WIFI: CONNECTING/CONNECTING
D/ConnectivityService(   87): Dropping ConnectivityChange for WIFI: CONNECTING/CONNECTING
D/ConnectivityService(   87): Dropping ConnectivityChange for WIFI: CONNECTING/CONNECTING
I/wpa_supplicant(  638): CTRL-EVENT-STATE-CHANGE id=0 state=4 BSSID=00:26:f2:fc:dc:c0
I/wpa_supplicant(  638): Associated with 00:26:f2:fc:dc:c0
I/wpa_supplicant(  638): CTRL-EVENT-STATE-CHANGE id=0 state=7 BSSID=00:00:00:00:00:00
I/wpa_supplicant(  638): CTRL-EVENT-CONNECTED - Connection to 00:26:f2:fc:dc:c0 completed (auth) [id=0 id_str=]
D/NetworkStateTracker(   87): setDetailed state, old =CONNECTING and new state=CONNECTING
D/WifiStateTracker(   87): DhcpHandler: DHCP request started
D/NetworkStateTracker(   87): setDetailed state, old =CONNECTING and new state=OBTAINING_IPADDR
D/ConnectivityService(   87): Dropping ConnectivityChange for WIFI: CONNECTING/OBTAINING_IPADDR
I/dalvikvm(  404): Jit: resizing JitTable from 4096 to 8192
D/NetworkStateTracker(   87): setDetailed state, old =OBTAINING_IPADDR and new state=CONNECTED
D/DataConnectionTracker(  162): disableApnType(default)
D/DataConnectionTracker(  162): setEnabled(0, false) with old state = true and enabledCount = 1
D/DataConnectionTracker(  162): EVENT_APN_ENABLE_REQUEST 0, 0
D/DataConnectionTracker(  162):  dataEnabled = true, enabledCount = 1, isApnTypeActive = true
D/ConnectivityService(   87): ConnectivityChange for WIFI: CONNECTED/CONNECTED
D/WifiWatchdogService(   87): (android.server.ServerThread) android (00:26:f2:fc:dc:c0) does not require the watchdog
D/ConnectivityService(   87): adding dns 192.168.1.1 for WIFI
D/ConnectivityService(   87): erasing net.dns2
D/Tethering(   87): Tethering got CONNECTIVITY_ACTION
D/Tethering(   87): MasterInitialState.processMessage what=3
E/HierarchicalStateMachine(   87): TetherMaster - unhandledMessage: msg.what=3
D/Smack   (  206): [XMPPConn] close connection, notifyClosed=false
E/ConnectivityService(   87): connected default network is not mActiveDefaultNetwork!
W/Smack/Packet(  206): notify conn break (IOEx), close connection
I/GTalkService(  206): [ServiceAutoStarter] --- connectivity changed
I/GTalkService(  206): [ServiceAutoStarter] --- start GTalk service ---
I/MediaUploader(  433): No need to wake up
E/ConnectivityService(   87): connected default network is not mActiveDefaultNetwork!
E/ConnectivityService(   87): connected default network is not mActiveDefaultNetwork!
E/ConnectivityService(   87): connected default network is not mActiveDefaultNetwork!
D/WorkQueue(  396): DownloadQueue.Worker: WorkQueue thread loop finished!
D/dalvikvm(   87): GC_FOR_MALLOC freed 15636 objects / 884264 bytes in 113ms
D/MobileDataStateTracker(   87): default Received state= DISCONNECTED, old= CONNECTED, reason= dataDisabled, apnTypeList= default,supl,mms
D/NetworkStateTracker(   87): setDetailed state, old =CONNECTED and new state=DISCONNECTED
D/ConnectivityService(   87): ConnectivityChange for mobile: DISCONNECTED/DISCONNECTED
D/ConnectivityService(   87): getMobileDataEnabled returning true
D/ConnectivityService(   87): adding dns 192.168.1.1 for WIFI
W/GTalkService(  206): [GTalkConnection.15] doConnect: caught XMPPError connecting to mtalk.google.com:5228.: (502)
W/GTalkService(  206):   -- caused by: java.net.SocketException: The operation timed out
D/Tethering(   87): Tethering got CONNECTIVITY_ACTION
D/Tethering(   87): MasterInitialState.processMessage what=3
E/HierarchicalStateMachine(   87): TetherMaster - unhandledMessage: msg.what=3
D/Tethering(   87): Tethering got CONNECTIVITY_ACTION
D/Tethering(   87): MasterInitialState.processMessage what=3
E/HierarchicalStateMachine(   87): TetherMaster - unhandledMessage: msg.what=3
I/GTalkService(  206): [ServiceAutoStarter] --- connectivity changed
I/GTalkService(  206): [ServiceAutoStarter] --- start GTalk service ---
I/MediaUploader(  433): No need to wake up
I/GTalkService(  206): [ServiceAutoStarter] --- connectivity changed
I/GTalkService(  206): [ServiceAutoStarter] --- start GTalk service ---
I/MediaUploader(  433): No need to wake up
D/NetworkLocationProvider(   87): onDataConnectionStateChanged 1
D/WifiService(   87): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44b94a50}
D/WorkQueue(  396): DownloadQueue.Worker: WorkQueue thread loop finished!
D/dalvikvm(  433): GC_EXPLICIT freed 2011 objects / 136760 bytes in 65ms
D/WiFiKeepAlive-BGService(  413): Pinging gateway 192.168.1.1
D/WiFiKeepAlive-BGService(  413): pinged
I/power   (   87): *** set_screen_state 0
D/WifiService(   87): ACTION_SCREEN_OFF
D/SurfaceFlinger(   87): About to give-up screen, flinger = 0x1fe228
D/AK8973  (   64): Compass CLOSE 
D/StatusBar(   87): DISABLE_EXPAND: yes
D/GoogleLoginService(  206): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }
D/WiFiKeepAlive-BGService(  413): Pinging gateway 192.168.1.1
D/dalvikvm(  443): GC_EXPLICIT freed 2171 objects / 165880 bytes in 58ms
D/dalvikvm(  170): GC_EXPLICIT freed 5421 objects / 332512 bytes in 66ms
D/WiFiKeepAlive-BGService(  413): Unreachable
D/NativeCrypto(  206): Freeing OpenSSL session
D/dalvikvm(  206): GC_EXPLICIT freed 5494 objects / 463016 bytes in 102ms
D/NativeCrypto(  206): Freeing OpenSSL session
D/dalvikvm(  218): GC_EXPLICIT freed 1935 objects / 117576 bytes in 57ms
D/WiFiKeepAlive-BGService(  413): Pinging gateway 192.168.1.1
D/dalvikvm(  317): GC_EXPLICIT freed 1787 objects / 96632 bytes in 64ms
D/WiFiKeepAlive-BGService(  413): Unreachable
W/GTalkService(  206): [GTalkConnection.15] doConnect: caught XMPPError connecting to mtalk.google.com:5228.: (502)
W/GTalkService(  206):   -- caused by: java.net.SocketException: The operation timed out
D/SntpClient(   87): request time failed: java.net.SocketTimeoutException: Connection timed out
D/dalvikvm(  413): GC_EXPLICIT freed 3358 objects / 363792 bytes in 79ms
D/dalvikvm(  404): GC_EXPLICIT freed 4397 objects / 266480 bytes in 89ms
D/NativeCrypto(  404): Freeing OpenSSL session
D/WiFiKeepAlive-BGService(  413): Pinging gateway 192.168.1.1
D/WiFiKeepAlive-BGService(  413): Unreachable
D/WiFiKeepAlive-BGService(  413): Pinging gateway 192.168.1.1
D/WiFiKeepAlive-BGService(  413): Unreachable
W/GTalkService(  206): [GTalkConnection.15] doConnect: caught XMPPError connecting to mtalk.google.com:5228.: (502)
W/GTalkService(  206):   -- caused by: java.net.SocketException: No route to host
 

jbrinkley

Senior Member
Jan 12, 2010
179
12
florida
god I was hoping this fix worked for the att version. Pandora stops after the song is finished. G voice and g email doesn't get through.
But at least it reconnects upon waking. Wouldn't do that in the previous version.
inbuilt sms get through while screen locked, yesterday that wasn't working either.
But with your widget disabled it was fine. (as far as going back to 3g)
So it's progress. I just want GV sms to get through at my house all day on wifi.
thanks for the effort.
 

shantzg001

Inactive Recognized Developer
None whatsoever..Basically what I see is that so far the app is now able to maintain the wi-fi service alive for most people but some folks (like jbrinkley) see the issue that even if wifi is alive itself, the data isn't going through. I've added a couple of changes to do a few more things, which I don't want to put into the market without testing as I don't see this issue on my devices. Plus it has some more logs enabled.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    UPDATE: Potential work arounds for folks having problem in sleep policies not working correctly have been put in version 1.2.0 onwards. Please redownload to test and let me know. Read this for more details.

    IMPORTANT: If you are having wi-fi issues in sleep even after using this app, please let me know the following
    1. Device/Phone Name and Rom version
    2. What is the app version that you have?
    3. Did you try all the combinations of various workarounds in the advanced options?
    4. Can you please enable logging in the advanced options and send me logcat dump for this duration

    I did an app to change the wi-fi sleep policy quickly so that you can control whether wi-fi is disconnected or not whenever screen turns off. What's more is that I also did a widget for it, so you can just tap on it to cycle through the various sleep policies.

    I hope this can help some people out who get frustrated when their download breaks off as the screen goes down or worse, it switches to slow and expensive mobile data connection which runs your account balance down in a jiffy before you realize it..

    You can look for more details on this page (and also report any bugs or suggestions):
    Android Wi-Fi Keep Alive

    Just try out this app by searching for "wi-fi keep alive" in market or scanning this barcode:
    chart


    Note: Many would wonder what would be the need of this app when we have a setting for this built-in in android. These are the reasons:
    Yes, that is true but as I mentioned earlier in the thread. The reasons to do this app are:
    1. Quick access. The setting for this is buried too deep and I wouldn't like to have this set to "never" (e.g.) all the time. I'd like to do it in a tap whenever I'm doing something that doesn't require me to look at the screen but wi-fi needs to be on. You can just tap on the widget and on you go. Otherwise you have most of the settings anyways in Android (for wi-fi/gps/sync/etc), why would you need widgets for them?
    2. The android in-built settings don't work always. Although the app provides pretty much the same options to the user as the in-built setting provides but I'm trying to include work-arounds in the back end that would really make it work.

    TODO/Coming Soon
    * Configurable pinging interval
    * Suggestions welcome

    Known Issues:
    1) Known issue with “on when plugged in” policy is that if you are already plugged in while changing anything in the app, workarounds don’t take place until you plug out and plug in again
    2) This is not a known issue with the app but with wi-fi on some devices itself that it stops working on leaving it idle even if the phone is not sleeping. This is not the purview of this particular app and it might not solve it, although few folks say that this app helps in this scenario as well.
    3) Some routers/settings are also known to cause issues with wi-fi in sleep. The correct pattern has not been identified yet but many people report that they can stay connected to wi-fi in sleep with some routers but with other routers, it fails. (Work Around 3 might help in such cases but not always)
    4) While adding widget, the main app screen will pop-up for widget configuration. You need to choose any one policy (even if desired one already selected) otherwise widget will not be added

    Notes:
    1) Please press Menu key in the app and select “Help” to see details about policy and workaround options.
    2) Please report any bugs here along with the above mentioned details (labeled IMPORTANT so that i can fix the issues.

    Changelog:

    02-August-2010 -> 1.4.2
    * Better looking & smaller icons (including widget). Thanks a lot to "rori~" for designing the icons :) Do checkout his other work in the forum. He has designed a lot of nice morphs/themes etc (Note: If the new icons don't appear on existing widget, please delete the widget and add it again)
    * Space optimization so that the app takes lesser space on phone.

    22-July-2010 -> 1.4.1
    * Fixed a bug that can cause wi-fi to keep reconnecting in quick succession in certain situations.

    22-July-2010 -> 1.4.0
    * Added workaround 4 (Re-associate automatically with access point if all else fails. Needs workaround 3 to be enabled)
    * Support for small screens (e.g. XPeria X10 mini)
    * Widget/Icons size optimizations for older Android versions
    * Resource optimizations for lesser space and faster loading
    * Misc. under-the-hood UI tweaks for better/consistent layouts across different screen sizes/densities/android versions.

    11-July-2010 -> 1.3.0
    * Added workaround 3 (Ping the router gateway regularly)
    * Lot of optimizations for battery savings.
    * Apply workarounds without needing to select the policy again

    06-July-2010 -> 1.2.1
    * Changed "Advanced options" to button instead of text
    * Bug Fix for a Force Close
    * More Optimizations
    * Help and Info Menus (to explain options and workarounds)
    * Option to disable/enable debug logging

    04-July-2010 -> 1.2.0

    * Added workarounds to take care of sleep policies not working on some phones
    * Optimized the code a bit for faster operations
    * Added Configuration screens to widgets (pops up whenever widget is added)

    28-June-2010 -> 1.1.0

    * Added Widget

    27-June-2010 -> 1.0.0

    * Initial Version