wifi goes sleep even setting policy to "Always On"

Search This thread

Monrad

Senior Member
Nov 23, 2007
178
54
If it happens on every single rom you you installed, then apparently this is a hardware fault.
What "Base" do the Roms, you installed, created on?!
I mean based on what version of RUU?

I don't think it's a hardware fault, disabling the fast reboot setting and rebooting device solves the problem at home, wifi or data connection won't disconnect. Sill can't connect to my router at work.

I've tried 1.26 and 1.28 version. If it's a bug and it has not been addressed then it's very likely that the problem will persist.
 

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
I don't think it's a hardware fault, disabling the fast reboot setting and rebooting device solves the problem at home, wifi or data connection won't disconnect. Sill can't connect to my router at work.

I've tried 1.26 and 1.28 version. If it's a bug and it has not been addressed then it's very likely that the problem will persist.

It will sure solve the problem, after rebooting with fast boot off,
Wait till your battery falls below 10% and tell me will it still sustain the connection or not?

Some people on other threads reported the following, changing wireless settings on the router:
  • Disabling N-Band and reverting to G or B bands solves the problem for some.
  • Going to WEB encryption and abandon WPA/WPA2 solves the problem for others.
  • changing the channel width to 20MHz (Lower than channel 11, the default onmost of routers with N-Band) solves the problem to others.
 
  • Like
Reactions: Monrad

Monrad

Senior Member
Nov 23, 2007
178
54
It will sure solve the problem, after rebooting with fast boot off,
Wait till your battery falls below 10% and tell me will it still sustain the connection or not?

Some people on other threads reported the following, changing wireless settings on the router:
  • Disabling N-Band and reverting to G or B bands solves the problem for some.
  • Going to WEB encryption and abandon WPA/WPA2 solves the problem for others.
  • changing the channel width to 20MHz (Lower than channel 11, the default onmost of routers with N-Band) solves the problem to others.

At work I cannot change so much settings as the general rule is "if it's working then don't touch it" and it's working for most of our clients which is one of the main reasons the wifi router is there.

Today I'll let my battery go below 10% while I ping my phone. So far, pinging gets a bit unstable when the screen is off, but I don't lose packets at all. You can notice the difference as soon as you turn on the screen, ping time is lower.

Thanks for the tips.
 

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
At work I cannot change so much settings as the general rule is "if it's working then don't touch it" and it's working for most of our clients which is one of the main reasons the wifi router is there.

Today I'll let my battery go below 10% while I ping my phone. So far, pinging gets a bit unstable when the screen is off, but I don't lose packets at all. You can notice the difference as soon as you turn on the screen, ping time is lower.

Thanks for the tips.

When below 10% give it exactly 15 minutes on sleep mode,
and try to ping it again,
Most probably you'll loose the packages and connection as will,
Mobile network will kick in for 5-10 seconds and will disconnect.
If you unlock your phone exactly after 20 minutes starting the time you first put it on sleep mode, you'll notice no data connection at all on the Notification Bar!!

Please do this before changing anything on your router and report back wither the problem regenerates or not!!

Thank you in advance..
 

Pabson

Member
May 30, 2011
28
4
Region is Germany, de.
I'm running ARHD 3.0.0, baseband is 1.1204.103.14(in options), and 1.1204.90.13(in hboot).
Build is 1.28.401.8

Greets pabi

Gesendet von meinem HTC One X mit Tapatalk 2
 

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
When below 10% give it exactly 15 minutes on sleep mode,
and try to ping it again,
Most probably you'll loose the packages and connection as will,
Mobile network will kick in for 5-10 seconds and will disconnect.
If you unlock your phone exactly after 20 minutes starting the time you first put it on sleep mode, you'll notice no data connection at all on the Notification Bar!!

Please do this before changing anything on your router and report back wither the problem regenerates or not!!

Thank you in advance..

When problem regenerates:
Turn your phone completely off
With "fast reboot disabled"
Charge it, for good time, to make sure it exceeds 10%
Turn it back on
The problem will be gone, till battery falls again below 10%.
I always charge it all the way up to 100% after restarting it
Good luck

Sent from my HTC One X using xda premium
 

Monrad

Senior Member
Nov 23, 2007
178
54
Ok, when the battery was 9%, I left my phone alone and waited 16 minutes. Tried to ping, no answer. Turn on phone, WIFI has been disconnected and I had no data connection.

As soon as the screen turned on, I could see data connection firing up and some seconds later wifi started also and connected to my network at home. Now I turned off the screen again and I'm waiting another 15 minutes while I ping the phone.

I'm using Insert Coin ROM in case you want to test it.

EDIT: waited more than 15 minutes and wifi was still working.
 
Last edited:
  • Like
Reactions: adazamim

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
Ok, when the battery was 9%, I left my phone alone and waited 16 minutes. Tried to ping, no answer. Turn on phone, WIFI has been disconnected and I had no data connection.

As soon as the screen turned on, I could see data connection firing up and some seconds later wifi started also and connected to my network at home. Now I turned off the screen again and I'm waiting another 15 minutes while I ping the phone.

I'm using Insert Coin ROM in case you want to test it.

EDIT: waited more than 15 minutes and wifi was still working.

Thank you for your feedback,
Give it exactly 20 minutes, then ping,
I know this is time consuming, and I've been there believe me,

I'd be so grateful if you could provide your WiFi router's settings:
Band (N, B, G, mixed B/G)
Channel (6, 9, 11)
Security encryption (WEB, WPA, WPA2), (TKIP, or AES)

Thank you
 

Monrad

Senior Member
Nov 23, 2007
178
54
Thank you for your feedback,
Give it exactly 20 minutes, then ping,
I know this is time consuming, and I've been there believe me,

I'd be so grateful if you could provide your WiFi router's settings:
Band (N, B, G, mixed B/G)
Channel (6, 9, 11)
Security encryption (WEB, WPA, WPA2), (TKIP, or AES)

Thank you

Ill try again tonight with the 20 minutes pause.

I'm using a Linksys WRT160N V3 with Tomato firmware. I'm attaching my config. Sec type is WPA/PSK2 Personal, AES Encryption.
 

Attachments

  • wcfg.jpg
    wcfg.jpg
    128.1 KB · Views: 325
  • Like
Reactions: adazamim

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
Healthy WiFi Router Settings - Mode: B/G Mixed - Sustain connectivity below 10%

I have modified the WiFi Settings on my CISCO-Linksys WAG120N
To the following (Please refer to attached pic)

  • Network Mode: B/G Mixed (No N-band, N band is disabled)
  • Radio Band: Standard (20 MHz channels)
  • Standard Channel: 9 (2.452 GHz)

Results:
  • Healthy connection during the whole day WiFi, and Mobile network
  • When battery falls below 10% and the "Low Battery" alert pops up, the connction stayed on and no diconnections at all
  • Restarted my phone and monitored, the connection stayed on with no disconnections
  • The monitor was held over periods of test awakening after sleep mode (15 min, and 20 min)
  • Disconnected from WiFi and monitored the Mobile network to be connected over periods of test awakening after sleep mode (15 min, and 20 min)

****NOTE****
The tests were held under the following conditions:
  • Only applications that came with the phone are the ones (Installed/Updated)
  • No other apps were downloaded during the test period
  • No Bluetooth devices were paired during the test period
    [*]WiFi Encryption protocol was unchanged "WPA2 Mixed (TKIP or AES)"

Experiments to continue:
I will continue this test, but will use other router WiFi settings,
I will monitor and give a feedback.

Hope above helps.
 
Last edited:
  • Like
Reactions: skanj

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
None Healthy WiFi Router Settings - Network Mode: Mixed (N-band) Fault Regenerates

I have modified the WiFi Settings on my CISCO-Linksys WAG120N
To the following (Please refer to attached pic)

  • Network Mode: Mixed (N-band, N band is enabled)
  • Radio Band: Auto
  • Wide Channel: 4 (Wide channel is the N-Band channel)
  • Standard Channel: 2 (2.417 GHz)

Results:
  • Test was made when battery is already blow 10%
  • All previous WiFi hot spots were "Forget" before the test begins
  • Fault regenerates exactly after 15 minutes, when I unlock phone, no data on the notification bar
  • Restarted my phone and monitored, Fault regenerates in 15 minutes
  • Disconnected from WiFi and monitored the Mobile network, Mobile data down, after 15 minutes

****NOTE****
The tests were held under the following conditions:
  • Only applications that came with the phone are the ones (Installed/Updated)
  • No other apps were downloaded during the test period
  • No Bluetooth devices were paired during the test period
    [*]WiFi Encryption protocol was unchanged "WPA2 Mixed (TKIP or AES)"

Experiments to continue:
I will continue this test, but will use other router WiFi settings,
I will monitor and give a feedback.

Hope above helps.
 
Last edited:

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
None Healthy WiFi Router Settings-Mode: Mixed (N-band lower channe) Fault Regenerates

I have modified the WiFi Settings on my CISCO-Linksys WAG120N
To the following (Please refer to attached pic)

  • Network Mode: Mixed (N-band, N band is enabled)
  • Radio Band: Auto
    [*]Wide Channel: 3 (Wide channel is the N-Band channel) (Lower channel than previous test)
    [*]Standard Channel: 1(2.412 GHz) (Lower channel than previous test)

Results:
  • Test was made when battery is already blow 10%
  • All previous WiFi hot spots were "Forget" before the test begins
  • Fault regenerates exactly after 15 minutes, when I unlock phone, no data on the notification bar
  • Restarted my phone and monitored, Fault regenerates in 15 minutes
  • Disconnected from WiFi and monitored the Mobile network, Mobile data down, after 15 minutes

****NOTE****
The tests were held under the following conditions:
  • Only applications that came with the phone are the ones (Installed/Updated)
  • No other apps were downloaded during the test period
  • No Bluetooth devices were paired during the test period
    [*]WiFi Encryption protocol was unchanged "WPA2 Mixed (TKIP or AES)"

Experiments to continue:
I will continue this test, but will use other router WiFi settings,
I will monitor and give a feedback.

Hope above helps.
 
Last edited:

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
Conclusion - Do not use wide channel N Band (40 MHz channels)

As most of nowadays routers have N-Band capabilities with 40 MHz channels width,
It's now clear that the driver of the WiFi modem is the problem.
It cannot sustain connection over N-Band 40 MHz channel width, when battery falls below 10%.

Conclusion:
  • Always set your router to Standard Channels with 20 MHz width.
  • If you know that the router you'r about to connect to is N-Band, try to keep your battery above 10%, if the battery is about to get below 10%, disconnect from the N-Band router immediately to avoid conflicts on the driver and avoid restarting.
  • You can charge your phone to a decent amount above 10% and then reconnect to the WiFi N-Band without any problems.

Update:
I used Channel: 11 B/G Mode, Standard 20 MHz,
Fault regenerates.

I'll revert back to channel: 9 B/G Mode, Standard 20 MHz

Hope these information helps
 
Last edited:

DanteGR

Senior Member
Dec 14, 2010
3,767
1,387
Thessaloniki
www.facebook.com
OnePlus 11
Hello all.
The wifi and mobile data disconnect for me too when i leave screen off for a long time i.e. 15-30 mins or so.
Mind you that this happens regardless of the battery left... It even hapens if the battery is full..

Sent from my CoreDroid powered HTC One X via Tapatalk 2
 

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
Hello all.
The wifi and mobile data disconnect for me too when i leave screen off for a long time i.e. 15-30 mins or so.
Mind you that this happens regardless of the battery left... It even hapens if the battery is full..

Sent from my CoreDroid powered HTC One X via Tapatalk 2

Hello DanteGR,

My analysis was based on the stock rom.
The latest release of it specifically.

I suspect you haven't shut-down your phone with "Fast Reboot" disabled.
Here's what to do:

  • While you're connected to the WiFi network, you have a problem on, go to> Settings> WiFi> And long press on the router's name> Select "FORGET".
  • Go to Settings> Power> Un-Tic "Fast-Reboot"
  • Now long press the "Power" button and select "Restart" and confirm the prompt.
  • Wait till your phone restarts and fully load Sense give it 15-20 seconds un-touched.
  • Go to> Enable WiFi> Connect to the router you need.
IMPORTANT:
  • Do this ONLY when your battery level is above 10%.
  • If your router's WiFi is an N-Band, try your best not to have battery drops below 10% while you're connected to the router, the problem will simply regenerate.
  • Before dropping to 10% disconnect WiFi from your N-Band router immediately.
  • Charge your phone to over 10% and connect again, or leve it in charger and connect again,

Please monitor 15-20 minutes of connection on sleep mode.
Please give us your feedback,
Thank you!
Hope above helps.
 
  • Like
Reactions: DanteGR

DanteGR

Senior Member
Dec 14, 2010
3,767
1,387
Thessaloniki
www.facebook.com
OnePlus 11
Hello DanteGR,

My analysis was based on the stock rom.
The latest release of it specifically.

I suspect you haven't shut-down your phone with "Fast Reboot" disabled.
Here's what to do:

  • While you're connected to the WiFi network, you have a problem on, go to> Settings> WiFi> And long press on the router's name> Select "FORGET".
  • Go to Settings> Power> Un-Tic "Fast-Reboot"
  • Now long press the "Power" button and select "Restart" and confirm the prompt.
  • Wait till your phone restarts and fully load Sense give it 15-20 seconds un-touched.
  • Go to> Enable WiFi> Connect to the router you need.
IMPORTANT:
  • Do this ONLY when your battery level is above 10%.
  • If your router's WiFi is an N-Band, try your best not to have battery drops below 10% while you're connected to the router, the problem will simply regenerate.
  • Before dropping to 10% disconnect WiFi from your N-Band router immediately.
  • Charge your phone to over 10% and connect again, or leve it in charger and connect again,

Please monitor 15-20 minutes of connection on sleep mode.
Please give us your feedback,
Thank you!
Hope above helps.

Thank you very much for replying my friend :)
Well to tell you the truth, diabling the fastboot option in power settings is one of the first things i do when flashing a new rom because i want my device to restart from scratch every time i reboot so that shouldn't be the prblem right?
It has been nearly a whole hour now that i have been connected to my wifi at home (screen off all this time) and it has not disconnected yet. I'm at 60% battery level so i will see if it disconnects if battery gets lower.
Last night though I am pretty sure that i was at about the same battery level and it got disconnected ny itself.. That's some strange stuff mate :(
Weird thing is why does the mobile data also get disconnected when wifi does. Maybe it's a more general deep sleep phone problem?
If I get disconnected again i will try ur suggestions step by step and see where that leads me.
Thanks again :)
 

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
Thank you very much for replying my friend :)
Well to tell you the truth, diabling the fastboot option in power settings is one of the first things i do when flashing a new rom because i want my device to restart from scratch every time i reboot so that shouldn't be the prblem right?
It has been nearly a whole hour now that i have been connected to my wifi at home (screen off all this time) and it has not disconnected yet. I'm at 60% battery level so i will see if it disconnects if battery gets lower.
Last night though I am pretty sure that i was at about the same battery level and it got disconnected ny itself.. That's some strange stuff mate :(
Weird thing is why does the mobile data also get disconnected when wifi does. Maybe it's a more general deep sleep phone problem?
If I get disconnected again i will try ur suggestions step by step and see where that leads me.
Thanks again :)

Any time and will be waiting for your feedback.
I noticed that you have the same exact Radio version on your phone, even with the custom rom, as mine on the stock rom.
Maybe it's a Radio bug, maybe HTC will find a way to update radio.
Good luck.

Sent from my HTC One X using xda premium
 
Last edited:

DanteGR

Senior Member
Dec 14, 2010
3,767
1,387
Thessaloniki
www.facebook.com
OnePlus 11
Any time and will be waiting for your feedback.
I noticed that you have the same exact Radio version on your phone, even with the custom rom, as mine on the stock rom.
Maybe it's a Radio bug, maybe HTC will find a way to update radio.
Good luck.

Sent from my HTC One X using xda premium

Ok will do.
But I want to add two things.
Firstly, I want to ask ur opinion as to whether this is a hardware fault or not. Reason I'm asking is because i'm still in the DOA period and can take back the phone to change for another new one.
Secondly, I don't think the problem is only router/wifi related because mobile data also gets switched off when the problem appears. Am I right in saying that?
But then again, if it is a software fault why don't all users have it??
Very confused :confused:
 

adazamim

Senior Member
Sep 24, 2010
524
130
Cairo
Ok will do.
But I want to add two things.
Firstly, I want to ask ur opinion as to whether this is a hardware fault or not. Reason I'm asking is because i'm still in the DOA period and can take back the phone to change for another new one.
Secondly, I don't think the problem is only router/wifi related because mobile data also gets switched off when the problem appears. Am I right in saying that?
But then again, if it is a software fault why don't all users have it??
Very confused :confused:

Sure, I totally agree, and I'd go for a hardware fault,

The problem is that I haven't got confirmation from other users that they have encountered the problem!!

Maybe it's there and they do not know,
Bear in mind that not all users leave their phones to drop below 10%
Not all users connect to an N-Band wifi routers!!

See how unique the problem is!?
I will keep on searching for other users with exact same unique case and will ask them to report back if they have the problem or not...:(
 

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    OK, I've read most of this thread and had already tried all the non-dev options including "hidden" power management menus, always on data, unchecking the "put data connections to sleep", and so on. Nothing worked. I was having the same problem with my Evo 3D ROM and it was repeatable: set the time manually to something like 3am, put the phone down, and in about 20 minutes, you could watch the phone drop from the router. Turn the screen on and NO data connection. I wanted this solved because I need a consistent data connection even at night, so I went to work. After examining some logcats, I came to this thread because I found that what was disconnecting the data connections was "Smart Sync" and this thread came up in a Google Search. Turns out Smart Sync IS the culprit. How I fixed it in my ROM...

    The command to disconnect is coming from /system/app/Settings.apk. Decompile that apk with apktool and here's what you have to do:

    You need to make mods to two files in the decompiled smali:

    - com/android/settings/framework/activity/powersaver/SmartSyncDataLinkTurnOffReceiver.smali
    - com/android/settings/framework/activity/SmartSyncDataLinkTurnOffReceiver.smali

    In those two smali files, we need to kill these two methods:

    - SetAlarmTurnOffMobileDataLink
    - SetAlarmTurnOffWifiDataLink

    We do that by simply putting a "goto" command near the top and the corresponding :goto label at the bottom. Example:

    .method public SetAlarmTurnOffMobileDataLink(Landroid/content/Context;I)V
    .locals 11
    goto :goto_0 <--- put this line right under the "locals" declaration
    ...
    and at the bottom of that same method, put in the goto label:
    ...

    :goto_0 <--- put this line right before "return-void"
    return-void
    .end method

    That's it. Recompile and push the Settings.apk back to your /system/app folder and chmod the file 644. I realize that's not "common jargon" but anyone familiar with apktool and doing mods will be able to help you. I did it on my ROM and hopefully the above will be enough info to help anyone do the same. After the above change, my phone stayed online all night with no data dropping. Even better, it didn't appear to draw ANY more power than with this hard coded crap enabled. So I hope this helps.

    Seems like there should be some way to turn off "smart sync", or at least the tendency for "smart sync" to completely cut off your data connection. If someone finds such a method in the settings somewhere, I'll feel a bit foolish, but given that we're at page 30 in this thread with no solution, I kinda doubt that'll happen. Of course, there are no guarantees that this will work on all platforms just because it worked on the Evo 3D, but I think it will given the code.

    Also, there are obviously multiple ways to do the above job. You could delete all the code in the entire function and just leave it with "return-void". I choose to "jump around" the code, rendering it dormant just because I prefer to leave the (now dormant) code there should I choose to go back in the future and look at what WAS being done. That's just personal preference.

    Edit: I found more junk you have to remove to solve this completely. See this post.

    Mike
    14
    I actually found more code involved in the data link shutdown. My solution on page 30 worked most of the time. If you shut the screen off after midnight, it'd keep a connection all night. However, I found that if you shut the phone's screen off before midnight, say 11pm, and it had been sleeping a while and passed the midnight marker while the screen was already off, it'd shut down: again from 12am to 7am. I found the culprit with some sniffing of the logcat. As an addendum to my prior solution, to get rid of this crap completely, you have to kill (comment) all instances of these two method calls in the power saver and smart sync smali's (again, these are in Settings.apk):

    setmobiledataenabled
    setwifienabled

    In the Evo 3D ROM, I found these in the following files in com\android\settings\framework\activity\powersaver:

    PowerSaverModeReceiver.smali
    SmartSyncDataLinkTurnOffReceiver.smali
    SmartSyncIntentService.smali
    SmartSynServiceReceiver.smali

    In those files, just put a # at the front of every line that has starts with "invoke" and ends with setmobiledataenabled or setwifienabled in the same line. These methods are used in many of the smali files and many of them are fine, but in my eyes, they should never be called from the power saver or smart sync code because I don't want those objects affecting my data connection: only bad can come of that. I tested multiple times and now the data connection no longer drops as it passes the midnight barrier.

    I even found some occurrences of setwifienabled in SystemUI.apk and killed those too (only the ones involved in power saver) for good measure. They're in:

    PowerSaverOperation.smali in \com\android\systemui\power

    Mike
    6
    OK. Here you go. Give this a try.

    Kinda hard flying blind (I don't have your device to test), so let me know how it goes.

    Mike
    6
    Mikeyxda and all following this thread I'm sorry to inform you that the method described above is not working on our devices :(
    Many thanks for the feedback though Mikey.
    Really appreciate it bro :)

    Wait... don't give up yet. :) I downloaded your flash and, while it looks like you got both of the methods in SmartSyncDataLinkTurnOffReceiver.smali, you did not deactivate the ones in the other file: SmartSyncScreenOnOffTimeReceiver.smali.

    Open SmartSyncScreenOnOffTimeReceiver.smali and put in those same goto's to bypass the code in these two methods so that it goes to the return-void:

    .method public SetAlarmTurnOffMobileDataLink(Landroid/content/Context;I)V
    and
    .method public SetAlarmTurnOffWifiDataLink(Landroid/content/Context;I)V

    Once you hack those other two, I think you'll be set.

    I'd do it myself and produce a flashable ZIP but I don't have the framework for your device and don't want to download the whole ROM and extract the framework and overwrite my dev environment. Not a big deal but a bit of a pain if you can already do it.

    Mike
    4
    Hi guys, have you tried configuring an Exchange account and disabling SmartSync from that account?

    CM9 report: 3:11hrs have passed, my phone has been sleeping for some time and not a single disconnection.

    Tomorrow I'll try to connect to my problematic router at the office.