yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Nacrul:
Im using this variable too, but i delete the unused variables after extracting the SSID. I check sometimes all variables in use with flash all variables and the splitted variable needs too much space for me of not needed. (And also better programming style to delete variables u dont need anymore i think)
[Android Software Development] brandall:
Thanks for this Nacrul - I can understand clearing the variables is good 'house-keeping', but I didn't consider that not clearing them would take up resource. I've just tested this and indeed the variables %WIFII2 and %WIFII21 contain unnecessary data and clearing them does not affect the content of %WIFIPREF which was my concern.

I'll update this in the next release! (and look over all of my previous profiles!). Thanks again.

ps. 'flash variables' - I always 'speak' them - do you have an alternative method to quickly show their content??
[Android Software Development] brandall:
V2 Up

V2

Additional wait times added to allow data connection more time after switching from 2g to 3g

Added additional example of %WIFIWORK

%WIFIWORK & %WIFIHOME are reverted correctly to a value of 1 in the exit task

Unneeded split variables cleared for good housekeeping

Voice-overs removed (if you want to check your variables are assigning correct, add a pop up or speech anywhere!).

Adjusted positions of data connection to prevent lag.

Added time based notifications to show LAST successful sync

New %INCALL variable added to ensure 2g/3g switch does not happen during calls **.

* The %INCALL variables are already created in my CPU tutorial here. If you are not running these, then you'll need to create two simple profiles:

DuringCall - the event is 'phone offhook' and in the task 'variable set' %INCALL to a value of 2 (2 = call active)

EndCall - the event is 'phone idle' and in the task 'variable set'' %INCALL to a value of 1 (1= no call is taking place)

The above will come in handy in many other profiles I'm sure...

--------

Feedback needed as always please!
[Android Software Development] itsmejson:
hey brandall,

I'm thinking of trying ur profile out but first I had some questions.

I'm currently using this wifi automate profile that I found on the

tasker wiki :http://tasker.wikidot.com/yanawa. I was wondering if this would

mess with anything up in the data sync profiles that you created?

would they be ok to be used & turned on at the same time?
[Android Software Development] codryn:
You will add background data option too in next version? Will be a battery saver.
[Android Software Development] brandall:
Hi codryn, as the data connection is turned off completely, the background data cannot connect so therefore is already off!

You could amalgamate them, but the biggest difference is one focuses on location for data connection and the other simply a small time-frame... You'd have to make conditions depending on the location...
[Android Software Development] strictlyrude27:
brandall -

may consider a rewrite with new Tasker 1.1.1b options? for loops! arrays! goto labels instead of action numbers! WOO!
[Android Software Development] brandall:
I best get my ass to the beta download!! WHOOP!!
[Android Software Development] mefistofelis:
How could we modify it in order not to activate 3g if we use roaming, and only to try to synchronise via wifi?
[Android Software Development] Kurre:
You could modify sync script to check if roaming is active. Something like "activate mobile data if roaming isn't 1". Need to check some online help to see what's the right syntax for roaming. It shouldn't be hard task to implement :)
[Android Software Development] o2guru:
this is just what i was looking for thanks
[Android Software Development] kyogoku:
I rely on mobile data everytime and don't have any wifi connections thus the wifi is always of. so, I only need to use these two profiles right?

AutoSync.prf.xml

MobileData.prf.xml
[Android Software Development] Cutterstark:
thanks!

I'm getting an overlapping non nested blocks error on WIFI-AutoDiscon. Any suggestions?
[Android Software Development] brandall:
Ok folks, now I've finished the detective profiles I can concentrate on rewriting this over the coming days using the new arrays etc.

If you have any requests as to what would make the profiles more useful for your individual usage, please post and let me know and I'll see if I can build them in as it shouldn't be too difficult...

Watch this space!
[Android Software Development] brunoshady:
brandall

How can I do the following situation:

Wifi is on and lost connection.

So turn wifi off, and try again to connect on minute later turning wifi on.

if failed, increase a variable by 1 and the next atempt will be 2 times the value of this variable... so every time it fails to turn on and connect, it will wait more and more time to try again

its possible?
[Android Software Development] brandall:
Yes, that's possible by setting up a loop. I don't have the profiles installed at the moment as I'm working on other ones, so I'll have to just give you an overview.

1)Variable set %wifiwait to value 1

2)IF wifi is on, but not connected

3)Turn off wifi

4)Variable set %wifiwait to %wifiwait x 2 (tick do maths)

5)Wait %wifiwait minutes (press the icon to change the slider to a variable insert field)

6)Turn on wifi

7)Wait 30 seconds (or enough time to connect on your device)

8)IF wifi is on but not connected, goto action number 2 (or start of loop)

9)Variable clear %wifiwait

10)End if

11)End if

Something like that should do it...

I don't remember the name of the wifi on but not connected, it's been a while since I created these! But it's detailed in the opening posts somewhere.. Hope that helps!
[Android Software Development] zicovsky:
hey brandall, am trying out your profiles and whenever I try to add more SSIDs in the WIFI-AUTODISC I get an error message saying that there's an error with nested IF/ENDIF/ETC.

Since the out of the box comes with WIFIHOME and WIFIWORK only, I added a new one called WIFIGF but it won't work in AUTODISC.

Any ideas?
[Android Software Development] brandall:
No..... I can only assume that a Tasker update is the cause. I'm half way through updating these profiles so an update will be on its way soon - I don't get any errors myself, but have made a lot of changes - check back soon for the new version with arrays etc etc
[Android Software Development] :
Wifiprefcon ????

I noticed that on the first variable splitter Name:%WIFII splitter:<<<<<

For splitter i entered my SSID. Does that sound right.
[Android Software Development] dragunbayne:
I also get the error he is. Otherwise these profiles are awesome! Thanks a lot for all your work.
[Android Software Development] brandall:
hmmm... As soon as the latest beta version of Tasker is released, I'll release an updated version. The Tasker beta is awesome and makes things so much easier to create and edit... Keep an eye on this page.

I can't remember!! :eek: Sorry, I've had to uninstall all of my profiles apart from the one I'm working on... Wasn't the '<<<' separating out the SSID...? Really sorry I can't answer you right now - My brain is fried with current project...
[Android Software Development] bobcaruso:
Can anyone tell me how this stacks up against Juicedefender?
[Android Software Development] brandall:
I don't think I'm the most unbiased to comment... but, it can only use less resource as it only 'exists' for moments at a time.

Once you've got your head around the logic, you can personalise it more so it works exactly to suit your usage...
[Android Software Development] dragunbayne:
I believe they work better personally. Much less hassle. With JD I would periodically have issues with data not coming back on or not coming back on quickly enough. This is not an issue with Tasker. The Tasker profiles are cleaner and more efficient. Also I seem to get better battery life with the profiles, JD takes enough battery itself that the increase in battery life isn't as great as it could be.
[Android Software Development] nestroy:
Is there a possibility that I can switch between 2g/3g/WLAN when no data is transfered?

If tried to set a variable, on the Event Mobile Network (checked 2G for example) - but this is always running when I'm connected (not active) on a 2G network.

This would be useful, so i can start apps in 2G (Default State - cause the modem is melting my battery away if its in 3G/WLAN) - wait till the app loaded all data "initially" and then switch to 3G/WLAN - which cuts off the data-connection for about 2-5 Seconds.

Thanks in advance

Björn
[Android Software Development] brandall:
There is no way to detect data quantity via Tasker directly, although it would be possible via a script - that of course will increase resource and in turn drain your battery....

I'm a little puzzled though, is putting 3g/WiFi on for 2 minutes every hour really killing your battery?!? Have you looked in your battery monitor and checked that is the cause of the drain is..?
[Android Software Development] ogy_j:
Hi

I'm using your script and i want to know if it possible to put data or wifi on when you use an application like Gmail or browser...

I try to do it but i don't know why, autosync doesnt desactivate the wifi when it sync and not when i'm using the apps.

Data and wifi is cut off when i'm closing apps

Seems like %WIFIOC = 2... so %WIFIORS = 2... and so sometime autosync let the wifi on...

What i'm doing..When i'm launching app i want to use data, i put data and 3G on.

When i leave the apps, i'm waiting 1min then i cut off data. That's all (try to make it work well, then i'll try to use wifi then data..)
[Android Software Development] brandall:
The two profiles will be coming into conflict. The ORS part of the variable stands for 'original state' so if you were already using wifi/data when the profiles started, it wouldn't turn them off at the end. If you killed one of these apps and the data during that period then ORS would have switched it back on at the end of the data tasks..

I'll have a ponder of how to just leave the settings alone rather than 'setting' them to what they were... It'll be in the next version.
[Android Software Development] lodder:
Here is a profile that measures the current traffic found on the tasker pro group:

https://groups.google.com/d/topic/taskerpro/vERKytZeoCs/discussion
[Android Software Development] ogy_j:
Yes, maybe I can't reproduce the bug...

What I want is to do a Juice Defender like, but it don't work well on my phone so i chose Tasker and your profile... But 've got a problems when I'm using an application with data.. My rules doesn't work like I want or like JD... arg...
[Android Software Development] brandall:
Good find! I'll have a look at how he did it :)

Certainly have a look at the link lodder posted above. It's quite high level and the files it uses will vary from device to device no doubt, but the logic is there for you to use.
[Android Software Development] lodder:
I have tried it and it somehow works but in order to make it work like JD you need to build a loop and check every 1min / 30sec which will consume a lot of power which wouldn't make it very usefull.
[Android Software Development] brandall:
Agreed, would no doubt take more resource than it could save... Perhaps a script could do it better, but still unlikely to be a battery saver..
[Android Software Development] Clarkkent434:
I am having trouble my phone wont find the the SSID. I replaced the SKYXXXX with my SSID it did not work. What should I do?

Also I have the Verizon Galaxy Nexus so the 2/3g doesn't work since it is CDMA/LTE phone not GSMA. But is there a way to integrate the Team BAMF 4G LTE toggle. I have tried but can't wrap my head around it.
[Android Software Development] brandall:
Sorry for the delayed reply, did you solve the SSID issue? As far as the LTE toggle goes, I would suggest posting in the google group about that, as it's perhaps something the dev would want more information on.
[Android Software Development] LeopardSurd:
Hello guys!

I need a little help with a profile.

I use Tasker to disable connection when I watch a movie on my phone but after I close the movie player (I use Vplayer) I want it to bring back Mobile Data and Wifi. Also I want it to check if after a while (40 sec) WiFi is connected. If not, Tascker should disable WiFi.

Here is what I have done:

Profile: Connection

Context: App>VPlayer

Task: Connection off

1. Mobile Data set Off

2. WiFi set Off

End Task: Connection back

1. WiFi set On

2. Wait 30 sec

3. WiFi set Off if %WIFII !~ *connect*

It doesnt work if after I close the movie player and there is no connection available: the WiFi remains On after 30 sec.

Please give me an advice. Thanks in advance!
[Android Software Development] brandall:
Just before the WiFi set off action at the end, use an Alert, Flash action with %WIFII as the text. This will show you what is held in the variable and if using *connect* is the right thing to do. Let me know
[Android Software Development] LeopardSurd:
No, it doesnt work but I made some changes that works without problems. Here are the results:

Profile: WiFi Connected Detect

State: Wifi Connected

Enter Task: Variable Set %Connected, 1

Exit Task: Variable Clear %Connected

Profile: Connection Off if App

Context: App > Here I chose Games or Movie Player apps from the list

Task: Connection off

1. Display Timeout 20 min

2. Wait 30 sec

3. WiFi set Off

4. Mobile Data set Off

End Task: Connection back

1. WiFi set On

2. Mobile Data set On

3. Wait 30 sec

4. Wifi Off If %Connected Isn't Set

The Profile „ WiFi Connected Detect” is crucial also for checking if WiFi is connected for other profiles that use context like Event>Screen Off or Time>Repeat every xx min (for me 30 min). I use the both and they work without problems. Let see in battery usage will be better
[Android Software Development] brandall:
Thanks for sharing. Not sure how it differs from the %WIFIOC variable though?
[Android Software Development] Pirol_62:
I'm sitting in the same boat.

WIFIOC ist set correctly to 2.

WIFIPREF contains the right Network SSID.

But WIFIHOME ist not set to 2. Even I copied the content out of WIFIPREF directly into the If Clause.

I have no idea why. It worked a certain time before.

regards
[Android Software Development] lcampori:
network traffic count, loop control

I've hopefully managed to create some tasks to condition connectivity on network traffic. As an example, I've set the threshold as in Juice Defender: 10kb/15secs.

Juice Defender (which I use) does a terrific job as this regard, but, you know, I've tried just for the sake of it

the whole thing is based on the aforementioned google thread.

interfaces names and files have to be set according to your device.

to get rid of some EOF readings, I use a second reading just to make sure to have a valid entry.

task "Network"

Set Var %RXW=0

Set Var %RX2=0

Test File /sys/proc/net/class/*wifi*/statistics/rx_bytes to %WIF on error continue

Test File /sys/proc/net/class/*G2*/statistics/rx_bytes to %NG2 on error continue

Read Line /sys/.../*wifi*/.../rx_bytes to %RXW if %WIF is set, on error continue

Read Line /sys/.../*G2*/.../rx_bytes to %RX2 if %NG2 is set, on error continue

Read Line /sys/.../*wifi*/.../rx_bytes to %RXW if %RXW=EOF on error continue

Read Line /sys/.../*G2*/.../rx_bytes to %RX2 if %RX2=EOF on error continue

Var Set %RTX=%RXW+%RX2 do math on

then cycle to compute network traffic in i.e. 15 secs

task "Change"

var Set %CHG=20000, label=1

perform Network

var Set %OLD=%RXT do math on

wait 15 secs

perform Network

var Set %CHG=%RXT-%OLD do math on

if %CHG>10000 goto 1

just make sure task priorities are ok, since there are subroutines involved.

the task "Change" has to be included in the corresponding profile after screen goes off.

maybe.

what do you think?
[Android Software Development] brandall:
I'm really baffled about this... I'll do some more tests. You could try a wild card of * each side of the SSID. E.g *SKYXXX* I think pattern matching can be used there. Can't test right now.

New version is on its way as soon as the next release of Tasker is out which corrects the errors in the scenes I use for the preferences.
[Android Software Development] brandall:
Looks really good, thanks for sharing. Could you export and attach the profiles and tasks please, to make it easier to try out?
[Android Software Development] lcampori:
of course, here it is.

I've edited a couple of typos in the previous post, but the .xml.txt file should be ok.

as visual test I've set up a notification for each step in the cycle.

there are 3 interfaces involved, Galaxy S uses eth0 for wifi and svnet0 and/or pdp0 for mobile data, I do not know which one is correct so I use both of them.

let me know if this is useful.

EDIT:

it looks like I made a few changes to the tasks, but I'm sure you'll figure out how to deal with the threshold and name changes.
[Android Software Development] wucinac:
how do i install this in my SE Mini?
[Android Software Development] lcampori:
I've set up a complete profile+task .zip with the network traffic counter.

no txt files this time :) format is now correct, I hope.

Profile Data Sync (every 30 mins, battery>15%,screen off) triggers connectivity on for 30 seconds.

Profile ScreenOnOff (screen on) triggers connectivity on, then waits for screen to go off, cycle to measure network traffic every 5 secs, if above 3500bytes/5sec it keeps connectivity alive, otherwise turns it off.

the %HOME location variable turns on wifi before mobile data if at home. It has to be set of course on location-

Hope it helps to enhance your great work.
[Android Software Development] brandall:
Thank you :) I'll check this out in detail this weekend. Good work.

Are you getting errors?
[Android Software Development] Diskb0x:
Thought I'd take the plunge and try this profile on my phone in replace for the Juice Defender ones on the wiki site.

Think I followed all the instructions but although it's going through the motions of turning wifi/3g on and off and displaying the autosync success notification I'm not receiving any new emails.

If Brandall hadn't been so good it writing a complex profile I'd start troubleshooting it but I'm not quite sure where to start.

Suggestions most welcome.....
[Android Software Development] brandall:
:) thanks for the compliment. I had this issue on a custom ROM once... I switched ROM and it worked. Have you made sure that your emails are set to update correctly? Start off with the lowest sync time and see if that kick starts it. Also, have an email in your outbox and see if that sends. Let me know.
[Android Software Development] Diskb0x:
Hmmm I should have elaborated a little more:

Here's what I have:

ROM: Temaseks #59 CM7 rom

Email Client: Gmail app from gapps - not using the email app

This app doesn't have any sync settings as it's push I believe.

I started the profiles with the following settings:

wifi - off

2g - on

background sync - on

auto sync - off

This is what I'm seeing:

The phone constantly has 2g connection when idling - i.e not syncing

it syncs every 30 mins

wifi is checked and if available connected to - if not 3g is turned on

I get the sync symbol in the notification bar so it looks like this is working though I've not checked whilst it's on to see if the setting is ticked

When sync finishes the phone revers back to 2g and I get the notification message to say data successful at 1631

As far as I can tell, mobile data is not suppose to turn off entirely but just want to check that's the case.

If there's nothing I've done wrong I'll probably backup the CM rom I've got and install one built from stock (Modaco GR6) and see what happens.

Have I missed anything?
[Android Software Development] g_BonE:
@brandall, is the locale execute plugin still needed - given that tasker includes similar functionality already? also there is the "secure settings" plugin which is free and has some terminal execution functions.

thanks for being this innovative and inspiring in regards to tasker !
[Android Software Development] denzel09:
Thanks

Inviato dal mio GT-S5570 usando Tapatalk
[Android Software Development] mefistofelis:
Could you update the profiles to be able to work with the latest tasker version?
[Android Software Development] grojas:
First, excellent work!. No doubt Tasker is an incredible application especially because save use multiple applications open, performing multiple tasks and of course consuming resources. Again, excellent work!.

I'm testing your profiles and tasks with strictlyrude27 modifications. The %WIFIPREF remains with the SSID of the wifi with which I am connected but with blanks at the beginning and end of SSID, therefore do not match the values ​​placed in the array %WIFILIST, therefore I am never connected to a WIFI known at least, of course, I manually turn on or off the wifi receiver of my phone. For example, if my SSID is wifi1 when WIFIPREFCON task is executes, the variable %WIFIPREF get the value xxwifi1xxxxxxxxxx (the x indicates the blanks I mention), you follow?.

This prevents get the SSID from %WIFILIST and, therefore, not properly run the other profiles or tasks.

Any ideas?, suggestions?. Thanks for your time.

Cheers!
[Android Software Development] Clarkkent434:
I never did get it to work. I have tried several different wifi but no use on my Galaxy Nexus.
[Android Software Development] t00dy:
hey, great work!! ;) but sadly i have the same problem! I tried everything, well almost, strictlyrude27 mod seems to be to hard for me, for a tasker beginner!

1. The biggest problem I with WIFI-AutoDiscon not firing up if %WIFIOC = 3. I changed the context from Event to State and determned Variable Value there. This seemed to work. But then i noticed that i get error in the task WIFI-1minDis error: the task has overlapping non-nested blocks... :confused: And wifi still did not turn off after i left my prefered area of WiFi. I have replaced End if with Stop at the same contitions (if %WIFIOC = 2) without success. Funny thing is that if i try out the Task (using play button) the WiFi turns off. Please help! I am running Tasker 1.2

2. One question about preffered. The var %WIFIPREF can contain any SSID to which i am currently connected, and not just determined one's like %WIFIHOME or %WIFIWORK. So if i am at my neighbours flat it will still be able to sync through wifi, however i'm not sure if i want that!

3. It would be nice to implement CHRG variable, to be still able to sync if batt is below 25% and charging, like discussed here

Keep up the good work

Cheers

Excuse my English please ;)

EDIT: 1. I tried to replace End if with Goto now. And for a brief second i saw Wifi turrning off, but in a 0,5 s it turned back on. Strange indeed! So i thought, maybe because there is no end Task (although the Task WIFI-1minDis ends with Stop), so i added something i.e. Flash wifi off, i saw the flashed message after the milisecond wifi toggle :S (see attached images). Please help me, i really need this feature to work, as i do not want to run/drive around with my wifi on :S Thanks
[Android Software Development] vtaca:
just remove that entire action and all will be fine.
[Android Software Development] raiderkilo:
Hi

after upgrading to ICS have I trouble with data control in tasker
[Android Software Development] papete:
Same problem.....
[Android Software Development] Sumsar94:
Sv: [TUT] Tasker - Total Data Connection & Sync Control V4 [MASSIVE Battery Savings!!

I know this is an old thread, but maybe someone can help me out.

I can't see the xml files in tasker when I'm trying to import them.

I have tried with other xml files, which are named prj.xml instead of tsk.xml and prf.xml as these are.

Is the script compatible with the newest version of tasker?

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

The scripts are compatible. The prj files are project files. To open you need to go under preferences and disable the beginner mode. Once you do that you will see a home button. Long press and you are in business