yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Sumsar94:
Sv: [TUT] Tasker - Total Data Connection & Sync Control V4 [MASSIVE Battery Savings!!

I have done that, but when I'm long pressing the home button to import, I still cannot see the files from this script. I can only see prj.xml files from other scripts

Sendt fra min Galaxy Nexus
[Android Software Development] MorphiousGX:
Re: [TUT] Tasker - Total Data Connection & Sync Control V4 [MASSIVE Battery Savings!!

Make sure you put the files in their appropriate folders, or navigate to them. Screen shot?
[Android Software Development] trentonite:
long press on the profile text in the top left then long press on the task text to import the other file... i did that then exported it as a project for single import next time.

i did however have 1 question that maybe somebody can help out with. when it splits the wifi info to populate %WIFIPREF, it looks like the %WIFIPREF is getting saved with 2 line breaks on the top and 2 on the bottom. how would one trim the breaks? it is preventing %WIFIHOME being set to 2 because wifi home wont save my ssid with spaces to match
[Android Software Development] fonpacific:
I have an issue with this profile: whenever I'm in range of a preferred WiFi, if screen is off (and presumably in deep-sleep), it doesn't connect to wifi but connects to Mobile
[Android Software Development] MarcoBi:
I had the same issue.. Just add two wildcards in your matching string for you SSID, at the beginning and at the end, as in

*YOURWIFISSID*

this worked for me!

Sent from my awesome GT-I9100 running Cyanogenmod

via Tapatalk 4
[Android Software Development] berryman13:
Once I import the profiles, AutoSync, MobileData, WiFi-AutoDiscon and Wifi-OnOff, it auto-creates tasks - AutoSync, MobileDataOn, MobileDataOff, WIFI-1minDis, WIFIOnConVar and WIFIDisVar. Those tasks plus the one I imported, WIFIPREFCON all have the error triangle on the right side of the screen, which concerns me. Is there some out of date coding causing these to not function in the newer versions of tasker? I'd really like to give this script a shot cause it seems so robust compared to the others.

When I run the WIFIPREFCON task it doesn't put out any log file :(

Here's my logfile...I enabled logging, went to the task, ran it, turned off logging. Nothing extra should be there:

http://pastebin.com/6ugUC6ZH
[Android Software Development] tharansakthi:
hey [MENTION=984710]brandall[/MENTION], excellent tutorial.

I got one suggestion. Can a profile able to detect a event, that is download speed in data connection. And based on the given threshold, the data connection automatically switches off.

explaining further: Suppose I got my data connection is on and syncing and other data transmission is happening. Now I am locking the screen. Soon after locking the screen, a profile should monitor for the event of "downloading speed". If the downloading speed goes below the threshold value (say data transmitting at speed of 5KB/s for 10 seconds). If this happens the task should run to disconnect data (switching of data).

This helps us very much for downloading files, installing/updating multiple apps from playstore, etc, etc.
[Android Software Development] XBlackChaosX:
On the display on profile I see 3 red marks on 3 actions, what does that mean?
[Android Software Development] jdogzilla:
Looks like people have forgotten this tread for over 9 months now ... or is it so perfect that needs to more qs? Anyway, I'm going to try this out rather than buy an app to do the same. Hope it works.

---------- Post added at 11:27 PM ---------- Previous post was at 11:06 PM ----------

Looks like people have forgotten this tread for over 9 months now ... or is it so perfect that needs to more qs? Anyway, I'm going to try this out rather than buy an app to do the same. Hope it works.
[Android Software Development] Sir_gpm:
Do you mind share that paid app?.
[Android Software Development] kinglifer:
is there a one click solution to have this installed? Or a new way?

Thanks.
[Android Software Development] zoomol:
Hi,

Maybe this will sound weird, but can someone export this as a tasker project file (*.prj.xml)? I have 4.6u2m and can't import prf and tsk files...

Thanks
[Android Software Development] Adrianrff:
Any chance of posting an updated version of this? Tasker gives me an error when trying to import.

Thanks in advance.
[Android Software Development] jucares:
Same here!!!
[Android Software Development] y3mita:
Question?

Once clicked on these profiles, after setting up my SSID... am I to manually connect to WIFI or the script will do this itself?

I'm asking because, I disabled WIFI-DATA and then clicked on the 3 profiles but I do not see WIFI being connected??
[Android Software Development] brandall:
Wifi will connect whenever you set it to in AutoSync - look at the between hours (so it doesn't wake you up in the night) and then the repeat interval. So, for example between 8am and 11pm repeating every 1 hour. This is when it will auto-connect.

Two simple tests:

In your phone's settings, set your wifi off, data connection off, auto sync off and phone to 2g only.

1) Ensure you home wifi is switched on. Go into the task AutoSync (click on it and select edit) and press test. You should see your wifi switch on and connect and the sync icon appear. They then should disconnect at the end, returning the phone to the state it was originally in, with a notification of success.

2) Switch your home wifi off. Press test again, if you are running gingerbread you can see the wifi switch on in the notification bar, if not, perhaps a widget on the home screen? It will fail to connect, switch wifi off, switch the phone to 3g, switch the data connection on, sync, notify of success, before returning the phone to the original state again.

You could also try this with wifi connected originally to confirm it does not disconnect it once it's completed...

Providing you move the 'goto' action number accordingly, you could also add pop-ups between steps, to show the variables and what numbers and information they have populated with.

Hope this helps - if not, please let me know.
[Android Software Development] Coedy:
I am hideously new to Tasker...

I tried making my own profiles (went well!) but because I didnt know what I was doing I ended up doubting myself so got rid of them 'just in case' (Although I almost doubled my battery life!!! :D)

Have just finished installing/setting up your files now. Will give them a go tomorrow.

Do these profiles enable internet/wifi while the screen is on by the way? or do I have to manually overide them every time? Because will get super annoying...

Thanks! Will let you know how it goes! :)
[Android Software Development] y3mita:
thanks for so much detailed and easy to follow-up instructions! It works now, only problem is when home I would always like to stay connected thru WIFI... maybe using a nearcell value so it is always connected when home?

Also, been using your CPU* profiles for a couple of days and weird thing happened today on a phone call... my phone turned off!
[Android Software Development] brandall:
We were all hideously new at one point! Fiddling is the best way to learn!

To double check what you mean - do you always want your wifi to be on when the screen is turned on, or on permanently? At present, these profiles will only take effect at the repeat time you set in AutoSync, otherwise your standard settings will apply. Perhaps if you've manage to test today it's ok for you? - if not, let me know how you need your phone to behave and we'll sort out adjusting the profile for you/others who may want the same.

Hope it goes well :eek:
[Android Software Development] brandall:
No problem, pleasure.

I try to avoid nearcell due to potential increase in battery drain by activating that monitor. If you have other profiles that already use it, then it would make no difference and would be an obvious option.

Alternatively, if you aren't bothered about having wifi on the moment you step through your door at home and could wait until the next scheduled sync, you could add an IF statement to NOT switch wifi off IF %WIFIPREF = your home SSID. Could also add 'between hours' to it too, so it still switches off post bed time or not in the morning etc etc... Let me know if you struggle and I'll guide you further.

Hope the CPU profiles are working out well!? Have you updated to V2 of these sync profiles where it prevents switching from 2g/3g when a call is active? That would end the call. If the phone actually switched off completely, then it's something you'll need to monitor further - if the call came in when the phone was in sleep, the governor and frequency would have remained at those settings as the profiles are frozen. It may be they were not sufficient to power the radio and whatever else your phone was up to at the time? Let me know if it happens again as you could add CPU values into CPU-DuringCall to give it a boost.
[Android Software Development] pasteyface:
Tasker - not recognising root?

HI,

I've tried a few things with Tasker to save battery and switch WiFi and Data depending on certain conditions but not tried using the CPU settings before. I downloaded your profiles, imported them and tried to set them up in Tasker but keep getting the "sorry, that action is not supported in your device" message.

I read and followed the instructions that are suppoed to solve it - checking that Superuser.apk is in /system/app and that su is present in the $PATH directories but it still won't work. I'm Rooted and S-Off.

I'm using an InsertCoinHD ROM with an altered CM7 HBoot so I suppose some of the file Tasker needs must be in different directories.

Any ideas how to get this working - I like the look of your ideas and am eager to try them out.

Thanks in advance
[Android Software Development] brandall:
Hi Pasteyface

Are you getting this error on the sync profiles or the CPU profiles? I couldn't tell from your message.

Check out this thread about similar issues - http://groups.google.com/group/tasker/browse_thread/thread/f8de14324a073ae6 the Tasker Beta download link is there too if you want to try that and see if the updates work for you. Don't forget to backup your tasks and data first!

Let me know if you still have a problem.
[Android Software Development] boogerboy72:
Do you know how well this will interact with cm7 and the fact it and SetCPU don't get along well? im interested in trying this stuff out, but im concerned about the two getting along.
[Android Software Development] pasteyface:
Thanks Brandall,

Installing the beta seems to have done the trick, thanks for the tip and your quick reply.

Looking forward to trying these to squeeze some extra battery life out of my Desire. I'll let you know how I get on,

Regards
[Android Software Development] brandall:
If you're referring to the AutoSync profiles, they shouldn't make a difference.

If you mean CPU frequency and governor profiles, my honest answer is I don't know... as I don't use CM I'm unaware if there is a custom kernel or CPU script that will interfere... I really wouldn't have thought so... You could use the CPU-SayState to find out what the standard set up is and when/if the governor changes in screen off etc. If it doesn't then I can't see an issue at all... If it does, then I'm sure someone could guide you to the script that controls it - I would be interested to know.

Perhaps I could ask you to post over in the CPU Profiles thread http://xdaforums.com/showthread.php?t=1018245 if anyone has used it successfully with CM, there have been quite a few downloads of it now, so someone must have... The thread could do with a bump too!
[Android Software Development] brandall:
Result!

I'll look forward to your feedback
[Android Software Development] y3mita:
there's an app superpower that does most of your tasker tasks! you are very smart and I thank you for sharing your skills here at xda
[Android Software Development] brandall:
I thank you for the compliment :cool:

Tasker is very addictive, the plan is to replace all of my apps with it! I shall be posting tutorials as I go :eek:!
[Android Software Development] Gramlengo:
Amazing work Brandall!

I'm using both these and the CPU control profiles you made, absolutely love it!

One question though, I want AutoSync to be ON for the entire time I am connected to WiFi (so lets say I'm at home, and connected to my wifi network).

Whenever I disconnect AutoSync will be switched off again.

Any suggestions?
[Android Software Development] brandall:
Appreciate the feedback and glad they are working out for you!

I need to give this a little more thought and I've had similar requests on private message (people with less than 10 posts can't post here) about the phone being on charge/and at home too.

For now, I think all you will need to do is add an IF statement to the Auto-Sync 'set off' action, using the %WIFIPREF variable. So the action will become set auto-sync off IF %WIFIPREF does not match 'enter your home wifi SSID).

I can't test it right now, but I think that'll do it? Let me know!

For completeness, we really should then add an entry to disable the AutoSync profile until you are no longer connected to your home wifi - there's no point it running unnecessarily if you are permanent connected and on auto-sync. Problem is though, if you disable it, it needs re-enabling and that can't be done in an exit task as it will be disabled! Erm, perhaps a new entry in the exit task WIFIDisVar to turn the AutoSync profile back on... ?

My brain hurts :eek: ! Have a mess around (don't forget to backup so you can just restore if you mess up) and I'll give this further thought tomorrow if you need me to!
[Android Software Development] pasteyface:
clarify

Set the profiles up yesterday according to the step through. Charged up fully last night and left phone on overnight - only lost 7% from midnight to 8;00 but then today battery dropped down to 20% by 16:00 - much quicker than before. Phone was hotter than ever so something is making the processor work hard. When plugged it into the USB on my laptop a message came up saying there wasn't enough power to charge - never seen that before.

So not good but curious to find out what is wrong.

EDIT - this relates to CPU profiles not the Wifi ones
[Android Software Development] brandall:
Hi pastey

Going to paste your reply in the other thread in case someone else has experienced this and fixed it.

http://xdaforums.com/showthread.php?t=1018245
[Android Software Development] Techvir:
Brandall : thanks for the work in tasker profile.

I had a question for you.

When i am at work , the work wifi is open network. My phone connects to the network.

However for the internet connection to kick in , I need to open the web browser and accept a cookie . This is a 3 step process.

1.Open web browser

2. accept a certificate ( pop that comes after i open the web browser)

3. accept a policy

This process is valid for 6 hours. So i have to redo this every 6 hours.

Can this be automated with tasker ?
[Android Software Development] brandall:
Hi drgopoos, profiles are a pleasure.

I can't replicate this, so I'm working from imagination here....

[Q1] Does your wifi normally just disconnect with your screen off, or is there some expiry notification?

[Q2] How often are you set to sync when you are at work?

A crude workaround would be to add actions into the relevant task that:

If your wifi is connect to work SSID, but no internet connection

Open Browser at correct URL

Apply button click to accept cert

Apply button click to accept policy

Screen off or kill browser or hide Browser

I don't know if the above can be performed with the screen off in the background though.

Alternatively, every time your work SSID is detected on a scheduled AutoSync, kill the browser (to kill the cookie and perform above)

Alternatively, a countdown task to perform the above task 5hrs 58mins after cookie was previously added - Would need to kill/delete the orginal cookie. Or 6hrs 1min after the last time when relevant SSID = work.

Final thought - if that doesn't work, post me a logcat when you perform these actions at work in #code# quotes and I'll see what can be done in the background. Oh and maybe we can just overwrite the cookie with one of our own ;) attach that too.

Let me know!
[Android Software Development] Techvir:
Brandall,

Thanks for the quick reply.

First to answer ur Q

1. I keep wifi running all the time.

Regarding disconnecting from my work wifi: Its always connected even if the time period of internet connection expires(6hrs time limit). Only the internet connection is lost at that time.

2. My autosync is default. I have my mails pushed and is important for work

I am going to try your suggestion out when i go to work tmw. Will keep u posted.

Hope u got my PM about the orientation question.

Thanks
[Android Software Development] brandall:
With your answers above, I can think of a number of ways we can achieve this. Let me know how the auto-screen-clicks etc go - if it's too crude, we'll move on.
[Android Software Development] brandall:
V3 Up

V3

REMOVED ALL LOGCAT ACTIONS

[Should the running task be interrupted, the logcat may continue to be written to /sdcard/taskerlogcat.txt. Please check that this file is not present! If it is, delete it.]

If you are really interested in the logcat contents to see what your device is up to when it has a data connection, V2 is stable and works well - the above considered.

Credit (and apologies) for the above - pasteyface

Other than the above, only minor tweaks.
[Android Software Development] Nacrul:
Hi brandall,

Now im back after posting a little bit ;)

A few things i discovered.

1. If i have a 3G connection while the autoSync is activated the connection is cut not set back to the values before. (Only WIFI is saved)

2. The sounds dont work for me (i just disabled them)

3. On my phone the switching between 3G and 2G always resets also the phone connection for a few seconds. (In my case i will remove this feature because i always want 3G or no connection, just wanted to share)

I will modify your profiles and then share my experience here. Great job so far.
[Android Software Development] brandall:
Hi Nacrul, good to see you back!

If you always want 3g, then as you've done removing the 2g/3g will save the unnecessary discon time. There is currently no inbuilt variable to check the data connection type.

However, this can be achieved with a new profile - 'state' = 'mobile network' and then we would create a variable using 'variable set' to perhaps %MOBDATA2G = 2 (for connected) at the same time setting another %MOBDATA3G = 1 (for not connected).

Using the above in the same way as 'wifi original state' (%WIFIORS) we could revert the data connection to what it was when AutoSync started.

My concern would be how often the newly created data connection monitoring profile would activate if you are in an area where you switch between 2g/3g reception a lot - and if this would use resource? In addition 2g/3g is not a constant and could change mid AutoSync whereas wifi was either on or off at the start...

I waffled there didn't I! Please post back with your update so others can use if in the same situation :)
[Android Software Development] lodder:
Thanks it's great just what I needed.

I have tried to build the same but It was slightly more complex then it actually needed to be.

But my only concern is: if mobile network is connected and the autosync starts, when the autosync is finished does it kills the mobile network or not?

The toggle of mobile network, is done by using APNdroid right?

Keep up the good work
[Android Software Development] Nacrul:
Im just testing my changes.

Mobile data stays on if the screen is on (ive made a profile that switches data on if screen switches on)

Wifi and autoSync stay on if connected to the home network.

I will post the modified profiles when i get home.
[Android Software Development] Nacrul:
here my modified profiles:

Changes (i hope its a complete list):

1. Changed the Autosync start conditions to every day and less than 20% battery

2. Changed Wifi conditions:

- dont save WIFIORS

- if connected to a prefered WIFI while autosync then dont stop wifi (so i dont need WIFIORS anymore) dont stop autosync too (this is stopped if WIFI is disconnected)

- Dont change Mobile Data mode (i only use no data or as fast as i can ;) )

- If screen on at the end of Autosync over 3G then dont disable 3G data (because if screen on then i seem to use 3G, but you also need a Screen On and a Screen off profile to enable and disable 3G) I add them later.

I hope i mentioned everything, if not then ask ^^

Cant add the other profiles right now because tasker is disabled (i dont know why yet)
[Android Software Development] brandall:
Hi lodder,

The profiles are set up to kill the data connection afterwards and align syncing at set the periods you decide. If this doesn't suit, you can always adjust them so the data connection remains on (although that slightly defeats the object) or once you've had a play around, the data connection could turn off only under the circumstances you choose... Let me know if you need further guidance, or have a look at how Nacrul is adjusting them to suit him above for ideas ^ or my previous reply to him in post #45

These profiles don't use APNdroid - I assume it is no longer required for any devices as Tasker has added this functionality. If this isn't the case, please let me know.
[Android Software Development] brandall:
Nice work! Good to see you've managed to completely personalise! I'll reference your post in the FAQ - Thanks. If you're using my CPU profiles, there are display off/on states already - you could just add in an action to '+/Tasker/Perform Task to kick off the off/on tasks you want above...
[Android Software Development] torsrex:
I tried to add these profiles, and have done excactly as described, but I can't get my phone to disconnect when it looses the signal (wifi on but not connected).

The task just stop... My wifi's ssid is: Molland if that is helping.
[Android Software Development] brandall:
Ok - time to do a bit of flashing! First, reboot your phone - Tasker seems a lot more reactive after.

In the task WifiPrefCon, you need to check the variables are assigning correctly. Add actions of +/notifications/flash (enter %WIFIHOME for example in the text box) after variables should have been assigned. See if the values flash up correctly.

If you do this in AutoSync, make sure you adjust the 'go-to' action number accordingly. The SSID may be case sensitive, so check that too. Test as detailed in this post.

Let me know if you're still stuck. Good luck.
[Android Software Development] lodder:
Yes, I know and thats why I use them but with wifi you have build it in. I was only thinking to build it in for mobile internet as you might be using it for surfing.
[Android Software Development] brandall:
It would be ideal, but unfortunately Tasker doesn't have the variables built in for 2g/3g/mobile data. Check out this post on how you could implement it, by setting up a separate profile that creates 2g/3g variables which you could use. I'm still not sure whether to put these in V4 or not...

Let me know if you want further guidance.
[Android Software Development] Nacrul:
Thats my next step. I downloaded your profiles and maybe modify them tomorrow. Then i will post the result in the other thread,
[Android Software Development] torsrex:
Ok, I have located the problem. The wifi-OnCon won't enter it's exit task (WIFIDisVar). I have tried to disable all the other tasks without any luck.

How do I make the task enter it's exit task?

Thanks for the help!
[Android Software Development] brandall:
Oops!! I think you've just spotted an error! In WififDisVar is your first action 'go to' action 6?? It should be 7!!

Well spotted... Let me know if this is just mine, or if I've uploaded it wrong!
[Android Software Development] torsrex:
It was at 6, but when I changed it to 7, everything worked!

Time for setting up the autoSync-profile. ;)