Toggle mobile data on and off while away from WiFi

31 views
Skip to first unread message

Oliver G. Parker

unread,
Oct 24, 2016, 1:01:07 PM10/24/16
to Tasker
Hi, First post here, be gentle ... !

I'm coming to Tasker from Llama as I can see it's a more powerful piece of software. However I'm struggling to get to grips with it a little. 

I'd like to set up a task whereby when I'm not connected to a WiFi network and the screen is off, mobile data is turned on for one minute and then off for nine minutes. In this one minute that it's on then new eMail can be checked for. This means that mobile data is only running for 10% of the time and hence battery life is conserved. The 'phone is a Moto G3, running Marshmallow, rooted and with Secure Settings. 

I have a task called "Make Data Mobile" which has these stages in it; 

1. Turn Mobile Data Off (done with secure settings)
2. Wait 9 minutes
3. Turn Mobile Data on (done with secure settings)
4. Wait for 1 minute
5. GoTo Action Number 1

I have another task called "At Home", which has these stages in it; 

1. Flash "Welcome Home"
2. Ringer Volume Level = 4
3. Set screen lock timeout to 10 hours (done with Secure Settings) 
4. Turn Mobile Data Off (done with secure settings)
5. Stop task 'Make Data Mobile'

I have another task called "Away from Home", with these stages; 

1. Short lock screen timeout
2. Ringer Volume Level = 7
3. Perform task 'Make Data Mobile'

I have another task called "Display and Data Task", with these stages; 

1. Turn Mobile Data On (done with secure settings)
2. Stop task 'Make Data Mobile'

I have a profile called "Connected to WiFi", which runs whenever the 'phone is connected to my home WiFi. 
Entry Task > At Home
Exit Task < Away from Home

I have a profile called "Display and Data", which is triggered whenever the screen comes on and it isn't connected to WiFi. (It should make mobile data come on and stay on whenever the screen is turned on and there is no WiFi connection). 
Entry Task > Display and Data Task
Exit Task < Make Data Mobile

All tasks are run with the standard priority. 

(I don't know how to export the Tasker instructions as code but am happy to do so once I have worked out how.) 

I can understand what I want to achieve with this lot but the problem is that the task "Make Data Mobile" doesn't seem to be ended whenever the "Stop Task" instruction is given from either "Display and Data Task" or "At Home". This can be seen by the fact that the mobile data comes on for a while but is then turned off if you run the "Display and Data" profile, and I believe that Mobile Data continues to run in the background when the 'phone is at home. I am learning to understand the Run Log and I can see that 'Mobile Data' carries on calling functions even after it should have been stopped (i.e. after the "At Home" or "Display and Data" profiles have been invoked). 

I think therefore that my problem is to do with this task not being killed as it should. What am I doing wrong? Is it to do with the fact that it is a looping task? Is there another way of killing it entirely (and, to be clear, I want the task to stop at whatever point it has got to in it's 10 minute cycle, not to run to completion and then stop)? 

Would I do better to redesign the way I am trying to do things altogether? I can see that it could be done using variables, possibly with a few tasks to turn mobile data on and off while testing to see whether certain variables are high or low. This may lead to a more elegant and flexible solution. 

Thanks, in advance, for any help. 


Oli. 


Reply all
Reply to author
Forward
0 new messages