[HOW TO]If your WiMax disconnects after 10 seconds of idle... - EVO 4G Android Development

If you live in an area where a WiMax signal is available but not yet official, you may experience this situation:
- 4g scans
- 4g connects.....wahoo!....but wait....
- 4g transmission sits idle for 10 seconds (you didn't use the internet at all for 10 secs.
- 4g disconnects and begins the whole connection process over and over again.
The constant disconnecting/reconnecting to 4g sucks for three reasons:
1. It slows the phone down like a mofo.
2. It drains the battery like a mofo.
3. Makes the battery get as hot as a milf.
SO....
I wrote a small batch file (MS Dos only) that will ping Google every 9.9 seconds (not exactly sure about the time frame, but it's close to 10 seconds). The script is below:
Code:
@echo off
:RENEW
cls
ping www.google.com
ping -n 13 -w 332 www.google.com >nul
goto :RENEW
Just paste that into a text file, save as a .bat, run it, and you're good to go. No more disconnecting/reconnecting to an unofficial 4g signal.
To stop the script, just hold ctrl and press 'C' and then follow the directions to terminate the batch.
For clarification:
1. Obviously, you must be tethered to a windows device for this script to work, it will not magically keep your phone connected to 4g if your phone is not tethered to the computer running the batch file.
2. This script will constantly send and receive data (a very small amount...it's just a ping), so don't leave it on all the time or overnight. I'm not responsible for you busting up your 5gb data cap, although it would be insane if this method did so. You'd have to ping google a "google" amount of times.
3. I know there is a way to change the 4g connection time-out from 10 secs to a higher interval, but I didn't want to modify something on my phone for an unofficial connection. My phone works fine on an official 4g connection.
I'm not sure if anyone will actually use this, but I thought I'd post my "work around" in case anyone faces the same issue as me.
Chris

Related

What if someone ping my phone constantly?

So we've got a smartphone that's connected to the Internet 7/24 and its IP address usually does not change, thanking to mobile IP.
From my PC, I can ping to my phone and my phone responses, even during the period of standby (dark screen).
What if someone ping my phone continuously? I think the battery will run out in an hour or so.
What we can do about this? You know hacks are probing ports all the time and they sure will find my phone. While they mostly cannot do any hack, but they'll drain out the battery.
Someone would really specifically want to annoy you or do you harm to ping your phone constantly, it is not as easy as it sounds. They would have to specifically want to do it to your phone.
About battery: I am not sure that sending a 1kb ping continuously would drain your battery that much quicker, as you're already connected to the internet and a similar process is already taking place to keep you that way 24/7. Even Direct Push Email will ping your phone once at least every 15 minutes, and Microsoft apparently found that an acceptable process.
We live in a world of hackers. Try watching your smartphone for a while and you'll see the data access is quite often (I have no push mail going on). Note: data activities use lots of power/battery.
ping dont hack the phone
i suspect that changing reception and therefore reinit with the service would be a bigger suspect
There's no risk on ping but if you need security then you can try a mobile firewall called 'ProtectStar Mobile Firewall'
This is not about hacking, it is about port probing that will drain the battery.

Data Auto Disconnect

I'm sure this is a noob question, but I can't find the answer on the forum.
I've seen a couple people reference automatically ending the data connections when they're idle. Can someone explain how this is done?
Is the desire to disconnect the data to save on battery life? Just curious. Thanks.
That's the main reason I want to do it...not sure about others...
I figured out two ways to do this for anyone else that's interested.
1) Using Advanced Config Tool (V3.3): Menu > More Settings > Connections. Check "Disconnect After" and set the timeout you want. This seems to work well for activesync connections (my mail is set to recieve every 5 min), but doesn't always work for on demand connections (Internet).
2) Comm Manager Pro. No instructions for this since I'm not using it (yet). But everything I've read looks like it does it.
Like I mentioned, I've got my email configured to sync every 5 minutes and I have a connection timeout of 30 seconds set in Advanced Config. This setup has drastically improved my battery life. Before this change, I got maybe 12 hours on a good day. With this timeout set, I could probably get 2 solid days. The only thing I haven't figured out is if the timeout is and idle timeout or an overall timeout. What I mean, is will the connection end after 30 seconds even if it's in use?
I'm interested in this as well, it would be even better if outlook or msn live would make a connection and disconnect after synchronizing.
I've been looking for the same solution. So far using advanced config settings will force disconnect no matter if it was idle or not. I'm looking for a solution to disconnect only when idle.
As of proof, set auto disconnect to 1 minute and using latest skype v3.0 start transferring a large file. After 1 minute data connection will be forcibly disconnected.
Any solutions for this?
Thank you.
Can someone help me find the timing setting in Advanced Config? I've looked through everything - using Energy 3.0 Rom (WM6.5) and don't see anything related to data disconnect other than under "Data Connections:" "GPRS disconnect:" and my settings are "Enable button and timer"
I don't see where the timer comes into play; don't really care if the connection gets cut off - I'd rather see a battery life improvement.....
I'm an absolute idiot. I just skimmed through the thread and didn't read the post above... *smacks forehead*
Its been posted in this very topic, and its only 5 replies long
xawen said:
I figured out two ways to do this for anyone else that's interested.
1) Using Advanced Config Tool (V3.3): Menu > More Settings > Connections. Check "Disconnect After" and set the timeout you want. This seems to work well for activesync connections (my mail is set to recieve every 5 min), but doesn't always work for on demand connections (Internet).
2) Comm Manager Pro. No instructions for this since I'm not using it (yet). But everything I've read looks like it does it.
Like I mentioned, I've got my email configured to sync every 5 minutes and I have a connection timeout of 30 seconds set in Advanced Config. This setup has drastically improved my battery life. Before this change, I got maybe 12 hours on a good day. With this timeout set, I could probably get 2 solid days. The only thing I haven't figured out is if the timeout is and idle timeout or an overall timeout. What I mean, is will the connection end after 30 seconds even if it's in use?
Click to expand...
Click to collapse
In advanced config the settings you are looking are not located in the list on first screen, the are in separate menu as described above.
And now I'll quote myself so my question will not get burred:
[email protected] said:
I've been looking for the same solution. So far using advanced config settings will force disconnect no matter if it was idle or not. I'm looking for a solution to disconnect only when idle.
As of proof, set auto disconnect to 1 minute and using latest skype v3.0 start transferring a large file. After 1 minute data connection will be forcibly disconnected.
Any solutions for this?
Thank you.
Click to expand...
Click to collapse
guys, found this
http://www.andrewsayshello.com/windows-mobile/auto-disconnecting-idle-data-connections-in-wm6/
hope this helps in some way
Thanks for the link, unfortunately it still disconnects even if data connection is in use.
WMLongLife can do this for you.
About the registry tweak that does this, I must warn you: it disables the ability to do voice and data simultaneously.
Chainfire said:
WMLongLife can do this for you.
Click to expand...
Click to collapse
Just checked WMLongLife and it seems that program does not quiet work if one doesn't use opera or wifirouter...
Chainfire said:
About the registry tweak that does this, I must warn you: it disables the ability to do voice and data simultaneously.
Click to expand...
Click to collapse
This is new for me...I thought that data connection cannot co-exist with phone call, period..
[email protected] said:
Just checked WMLongLife and it seems that program does not quiet work if one doesn't use opera or wifirouter...
Click to expand...
Click to collapse
Yes it does require a certain way of using your phone (current test version has specific settings - you can change this in next version). Just saying.
This is new for me...I thought that data connection cannot co-exist with phone call, period..
Click to expand...
Click to collapse
Yes it can, but it depends on several factors. Under ideal (and never actually occuring) conditions it can be done with 2G GSM (GPRS/EDGE). Normally, however, either GPRS/EDGE connection suspends ('pauses') during voice call, or with 2G CDMA voice call may not work at all while data connection active (depends on exact 2G CDMA network type).
With 3G GSM (UMTS/HSPA) it is quite possible (and normal) to do data and voice simultaneously, however for some reason the auto data disconnect registry tweak breaks it. I'm not quite sure why, but it does.
3G CDMA (EV-DO) behaves the same as 2G GSM with regards to simultaneous voice and data (data drops), however, EV-DO Rev. A behaves the same as 3G GSM (possible but broken by registry tweak)
Aside from this, it is also needed that your provider/network has the correct hardware to handle this. I'm not sure how common it is for this properly operating on EV-DO Rev. A, but for UMTS/HSPA early tower equipment was bugged and did not allow this. In Europe, most UMTS/HSPA towers have since been upgraded to allow simultaneous voice and data (and HTC handsets support this perfectly), but how this is in the USA I cannot say.
Hope that explains it (it is a bit messy explenation I know)
if this dowsn't work then i have no ideea what will )
http://forum.xda-developers.com/showthread.php?t=484084
tell me if worked for you
!!!!!
I had it set to disconnect (via Diamond Tweak software) after 1 minute of activity. I did this to preserve battery life, BUT BUT BUT
With 3g on, and even with 3g disabled all day and edge on, the battery still died in 8, 12 hours (3g, edge) with the connection disabling. i use the phone for a good number of calls, text, and some data every day.
AFTER i reenabled it to NOT disconnect after every 1 minute, i pulled over 24 hours on a SINGLE charge.
am i the only one that's experienced this??

[Q] Frustrated! anything to keep 2G /3G connection alive?

Hi
i have no issues with wifi but
i am on android 2.2.1 cyanogen rom on htc magic 32B.. sometime 2G connection gets silenced. any ping thing using less data to keep it alive ?pinging every 10-20 seconds or similar? how can i keep 2G awake with least data traffic used and least battery usage. any app out there for 2G?
P.S. not asking about wifi.
irisiris said:
Hi
i have no issues with wifi but
i am on android 2.2.1 cyanogen rom on htc magic 32B.. sometime 2G connection gets silenced. any ping thing using less data to keep it alive ?pinging every 10-20 seconds or similar? how can i keep 2G awake with least data traffic used and least battery usage. any app out there for 2G?
P.S. not asking about wifi.
Click to expand...
Click to collapse
I've never heard of a cellular connection having such issues, but I guess it'll drop after a while with no traffic. I personally have email on IMAP idle going all of the time so I guess I'd never have this problem. What's the issue, it takes a second to reconnect?
I am also looking for an app to do this. my epic touch data connection keeps dying. once I get it if I keep using it its fine. but if i let it go idle it won't "reconnect" I can turn off 3g and then turn it back on and usually get it back as long as I keep it active.
SO also looking for a background "pinger" to keep the data connection alive till I get a fix for the connection issues.
DRiVER_helsinki said:
that "3G reconnet" - app didnt work as required...
i found solution:
"Android Terminal Emulator" , from google play.
Type in “ping -i5 www,google.com” , to start pinging with 5 second interval.
Press Home button and the Terminal Emulator will run in the background until you decide to stop it manually.
(Do this only if you have Unlimited Data Usage plan ofc )
[ps. i replaced first dot in the ping address with comma ,because xda think i as new member , are linking outside and complains. )
____________________________________________________
Shoutout to Kimi Räikkönen !
Click to expand...
Click to collapse
Clearing this up...
type:
Code:
ping -i 5 8.8.8.8
Where:
-i = interval of the address to be pinged with.
5 = number of seconds after a successful/unsuccessful ping.
8.8.8.8. = Address to be pinged onto.
So by that command, you'll ping the Google Server (8.8.8.8) within every 5 seconds...
Oh yeah, by the way, after you exit the Terminal Emulator, the pinging stops. So just run TermEmu on background (Home)...
Great tip. Thank you.

wifi sleep policy improvement

Hi all
Thinking about the Wifi Sleep Policy settings:
I could not find the exact details of what the different options mean, but with a little common sense:
a) When screen turns off :
- if you have a wifi connection established : When the screen times out, it will turn off wifi and swith to mobile data.
- if you do not have a wifi connection established : The phone is constantly scanning for known wifi networks. When the screen times out, it will turn off wifi and stop all scanning.
b) Never :
- if you have a wifi connection established : when the screen times out the phone will keep that connection.
- if you do not have a wifi connection established : The phone is scanning. When the screen times out, it will keep wifi ON and continue to scan permanently for known networks.
c) Never when plugged in: it is not very clear, but would say its b) if the phone is charging, and a) if the phone is not charging.
Thinking a bit about this, it appears to me that none of this options is the ideal situation.
I would say that the ideal situation is that if I have a wifi connection established, then keep wifi on and the connection for as long as the network is there.
But if I do not have a connection established, I would like the phone to turn off the wifi interface, and turn off all scanning so as not to drain the battery while I am on the streets away from home. Then only begin scanning when I turn the screen back on, and if it no wifi network to connect, then turn off wifi again when the screen times out.
In other words, I think the best situation is a mix of behaviours of a) when there is no wifi connection established, and b) if there is a wifi connection established.
Does this make sense ? or am I crazy? I'd like your opinions please.
Anybody thought about this before? Is there any app or mod that will implement this behavior ?
Thanks
Gonzalo
gbalerdi said:
Hi all
Thinking about the Wifi Sleep Policy settings:
I could not find the exact details of what the different options mean, but with a little common sense:
a) When screen turns off :
- if you have a wifi connection established : When the screen times out, it will turn off wifi and swith to mobile data.
- if you do not have a wifi connection established : The phone is constantly scanning for known wifi networks. When the screen times out, it will turn off wifi and stop all scanning.
b) Never :
- if you have a wifi connection established : when the screen times out the phone will keep that connection.
- if you do not have a wifi connection established : The phone is scanning. When the screen times out, it will keep wifi ON and continue to scan permanently for known networks.
c) Never when plugged in: it is not very clear, but would say its b) if the phone is charging, and a) if the phone is not charging.
Thinking a bit about this, it appears to me that none of this options is the ideal situation.
I would say that the ideal situation is that if I have a wifi connection established, then keep wifi on and the connection for as long as the network is there.
But if I do not have a connection established, I would like the phone to turn off the wifi interface, and turn off all scanning so as not to drain the battery while I am on the streets away from home. Then only begin scanning when I turn the screen back on, and if it no wifi network to connect, then turn off wifi again when the screen times out.
In other words, I think the best situation is a mix of behaviours of a) when there is no wifi connection established, and b) if there is a wifi connection established.
Does this make sense ? or am I crazy? I'd like your opinions please.
Anybody thought about this before? Is there any app or mod that will implement this behavior ?
Thanks
Gonzalo
Click to expand...
Click to collapse
Sleep Policy is pretty simple:
Never means the wifi radio is never turned off. This is default now on Honeycomb and up, with fairly good reason.
When screen is off means.. the radio is turned off when the screen goes off regardless of whether you have a connection.
Only when plugged in means that the wifi radio is only turned off when the screen is off and it's not plugged in.
Sounds like you want Tasker http://tasker.dinglisch.net/
It will let you do what you describe.
Juice Defender will, as well, but it's terrible terrible software.
As to your problem, on most devices, scanning is usually reduced quite a bit when the screen is off. It's not as much of a battery drain as people think.
I'm in the habit of disabling wifi when I'm not at home or in the office. There's really no reason to leave it on when you're not going to be using it unless you want open network notification.
Thank you , I didn't know that the default is now Never. I'll set it this way.
And I guess I don't really have a real life problem, it's just that it got me thinking and came to the conclusions above.
And thanks for the link to the app, I will check it out.
Gonza
edit: oh I see you are the wifi fixer dev. Thanks so much for both replies.
Is your phone rooted? Do you have root explorer and sqlite installed. Then you can have more control over the time wifi goes to sleep after screen is turned off.
BUT: it remains on for 15 minutes by default.
Now start root explorer. Navigate to
/data/data/com.android.providers.settings/databases and open settings.db
If you have sqlite installed you seesome tables. Open secure table.
Add New record. name is wifi_idle_ms and give it a value in milliseconds you want.
Default (if wifi_idle_ms is not present) is 15*60*1000 ms. I have 60000 (1 minute)
Cheers
I use juice defender. Why is it such a terrible software? I've not used others, so I have no means of comparison. Perhaps you can enlighten me?
ZanshinG1 said:
Sleep Policy is pretty simple:
Never means the wifi radio is never turned off. This is default now on Honeycomb and up, with fairly good reason.
When screen is off means.. the radio is turned off when the screen goes off regardless of whether you have a connection.
Only when plugged in means that the wifi radio is only turned off when the screen is off and it's not plugged in.
Sounds like you want Tasker http://tasker.dinglisch.net/
It will let you do what you describe.
Juice Defender will, as well, but it's terrible terrible software.
As to your problem, on most devices, scanning is usually reduced quite a bit when the screen is off. It's not as much of a battery drain as people think.
I'm in the habit of disabling wifi when I'm not at home or in the office. There's really no reason to leave it on when you're not going to be using it unless you want open network notification.
Click to expand...
Click to collapse
androidapk.net said:
I use juice defender. Why is it such a terrible software? I've not used others, so I have no means of comparison. Perhaps you can enlighten me?
Click to expand...
Click to collapse
I'd like to hear that opinion too
JD is not terrible terrible. It is terrific terrific. Honest, it really work flawlessy and it does pretty well what the OP wants. Just for the sake of it, I'm trying to replicate with tasker what JD does, but, you know... it just does it better.
tweakradje said:
Is your phone rooted? Do you have root explorer and sqlite installed. Then you can have more control over the time wifi goes to sleep after screen is turned off.
BUT: it remains on for 15 minutes by default.
Now start root explorer. Navigate to
/data/data/com.android.providers.settings/databases and open settings.db
If you have sqlite installed you seesome tables. Open secure table.
Add New record. name is wifi_idle_ms and give it a value in milliseconds you want.
Default (if wifi_idle_ms is not present) is 15*60*1000 ms. I have 60000 (1 minute)
Cheers
Click to expand...
Click to collapse
Thank you! Yes I am rooted, I am running CM7 latest kang, but I did not know all this.
Gonna give it a try
Interesting. It works indeed! If one knows a bit about Unix shell, I did the modification via adb shell. Obviously the phone must be rooted and have sqlite3 (the binary) installed.
This is how to do it:
- connect the phone via USB to the PC
- execute "adb shell" (adb must be installed) from the DOS prompt. You are into the phone
Then execute the following steps:
Code:
su
cd /data/data/com.android.providers.settings/databases
cp settings.db settings.db.ORIG
sqlite3 settings.db
Now you are "inside" the db. Type ("sqlite>" is just the prompt):
Code:
sqlite> select * from secure;
and check if wifi_idle_ms is not present. If it isn't, as it shouldn't, type:
Code:
sqlite> insert into secure values(60,'wifi_idle_ms',30000);
where instead of 60 you can write any number that is not used already in the list, being that the unique key in the table.
I used 30000 (30000 microseconds = 30 ms) but one can put the value s/he prefers.
Miche1asso said:
Interesting. It works indeed! If one knows a bit about Unix shell, I did the modification via adb shell. Obviously the phone must be rooted and have sqlite3 (the binary) installed.
This is how to do it:
- connect the phone via USB to the PC
- execute "adb shell" (adb must be installed) from the DOS prompt. You are into the phone
Then execute the following steps:
Code:
su
cd /data/data/com.android.providers.settings/databases
cp settings.db settings.db.ORIG
sqlite3 settings.db
Now you are "inside" the db. Type ("sqlite>" is just the prompt):
Code:
sqlite> select * from secure;
and check if wifi_idle_ms is not present. If it isn't, as it shouldn't, type:
Code:
sqlite> insert into secure values(60,'wifi_idle_ms',30000);
where instead of 60 you can write any number that is not used already in the list, being that the unique key in the table.
I used 30000 (30000 microseconds = 30 ms) but one can put the value s/he prefers.
Click to expand...
Click to collapse
Thanks to Miche1asso for the commands, you've made my day :good::fingers-crossed:
This thread is good, useful, it did help up reduce the default wifi idle timeout :good: Just tested on xperia sola, perfect on my custom idea idle timeout (to 120000ms)

A non-suck Tasker data management script

Suggestions or questions are welcome!
Description:
Here is a simple-ish script I wrote to manage data flow on my phone. Mobile data on/off is easy enough but what most users have a hard time pulling off is when to toggle wifi on and off with minimal consumption. Using local tower states is pretty common but it's inaccurate and slow; additionally my method uses less battery life.
Room for improvement:
The only thing I would like to do in order to improve this is to have the script not disable data when downloading or streaming. This is possible but is unique per device per ROM so I can't really go into detail about how to do it. As a summary though there's a file that is written to that keeps information about bytes traffic. You just read this file to determine how much data is flowing in a specific interval and if it exceeds a certain amount then don't turn off data just yet. It's also a known issue where with some devices the 3G state change won't register when toggling manually while connected to wifi.
Features:
Wifi and 3G will disable two minutes after the screen is off so it's not constantly toggled through intermittent use.
On some phones or providers the 3G status becomes unknown when in a call or when connected to wifi; this script works around that.
Unlike most data management apps this one will remember your 3G status should you manually change it, in case you don't want 3G on at all.
Data is still checked on an hourly basis(this can be adjusted of course).
Fast and accurate wifi connecting with very minimal power drain.
Just a few things explained for those curious:
I check the phone state to ensure that 3G isn't detected as manually disabled when your provider uses 3G to place calls.
I check the screen on time because on some phones/ROMs the 3G doesn't actually register as toggled until the screen flickers back on. Because of this 3G appears to only become disabled once the screen turns back on and it can be registered as manually turning it off.
The wifi timer exist so the script won't check for a wifi too frequently.
You can adjust the hourly checks under Cycle 3G.
What version of Tasker is this developed under? Just curious, I'm running the 4.0 beta, and I just had to back out of b19 to b18 because of issues with my data management profile. I'll try yours out, it sounds a lot better than mine...
Can't seem to get this to work...tasker wont recognize the file
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2
It's working great for me on 4.0b18. I still need to look at the logic being used as to what causes it to 'wake up' and connect to wireless, is it simply a delay after screen on, or are you also looking at other factors?
Tasker 1.3.3u2
My friend had problems getting his to recognize the profile as well. I'm not sure why.. It might have to be in the proper directory. You might also have to make a new profile tab for it. Hopefully rpr69 can give us some insight.
But to answer your question as to how I check Wifi...
When screen turns on I immediately try to connect to Wifi before trying 3g. 3g will still enable briefly after for phones that require it for MMS. If Wifi isn't connected after X seconds then it disables Wifi and won't try again for 10 minutes. If it does connect successfully there will be no 10 minute wait next screen on.
Added manual toggle memory to Wifi as well. I'll post the changes later and update the zip file.
Are you importing the profile, or just dropping it in a directory? The proper way is to import into a new project. In 1.3 of Tasker (from memory, it's been awhile), you need to pull down from the top of the Tasker top bar which should then give you the Projects tabs. Long press on the Home tab, and you should get an 'import' option, navigate to where you downloaded the project file on your phone and select it, and it should create a new tab for it, with the profile and tasks under it. If you had previously just manually copied the xml file into the projects directory, move it out of there or the import may fail.
Looking forward to the update!
Ok got it to work I forgot is was a project and kept trying to import only a profile. It seems great so far!!!
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2
To make it so it won't check wifi when you don't want it to add the following...
ProfileName - Record Wifi State
Trigger - State > Wifi Connected *
Enter Task - Set Variable %wifistate to 1 if screen ~ on
Exit Task - STOP If %ScreenOnTime + 2 > %UPS
......Set Variable %wifistate to 0 if screen ~ on
then under task "Data Types On - Type 2 P2"
very first line add - If Then > %wifistate = 1
Place a closing End If at the very bottom, and move the "Mobile Data > Set On (if %3GState = 1)" second from the bottom, just above closing.
I also just uploaded the xml file again to the main post.

Categories

Resources