WiFi will not switch On/Off after device has been sleeping for few minutes

444 views
Skip to first unread message

MS

unread,
Jun 5, 2014, 8:57:27 AM6/5/14
to tas...@googlegroups.com
I created a profile called "Intermittent Background WiFi" which, while the screen is off, will periodically switch on WiFi for 1 min to sync - Basically a battery saver.

Issue is, the profile triggers correctly according to the Run Logs - it didn't show any errors, BUT the WiFi does not come On even though there are no errors. Here is the profile and tasks:

Profile
Time - From 7:00 every 5m Till 00:00
+
Display State Off
>>> Enter Task: WiFi Intermittent State


Task - WiFi Intermittent State
  1. WiFi: On
  2. Wait: 15sec
  3. If %WIFII ~ *CONNECTION*
    1. Wait: 1min
  4. End If
  5. WiFi: Off
I also added BEEPS after every action to test where it gets stuck. At no.3, condition is NOT matched and so it goes onto 4 and 5 immediately. This is because WiFi does not come on at no.1.

Task Settings: 
Collision Handling: Abort Existing Task
Keep Device Awake: Checked (because after 1 min, Tasker may be closed/paused by the system).

Device: Samsung Galaxy S3, 4.1.2 JellyBean
Tasker: 4.3u4

I think it's something to do with Tasker and Device falling asleep. It stops the WiFi activation.

Any ideas?

Brandon Horwath

unread,
Jun 5, 2014, 12:52:54 PM6/5/14
to tas...@googlegroups.com
I'm thinking with the display off context, settings are restored once the display comes back on?

Jacob Klein

unread,
Jun 6, 2014, 2:18:44 PM6/6/14
to tas...@googlegroups.com
Yeah, try this.

Disable the Wi-Fi off task and then run it. After it ran turn on your screen and does the Wi-Fi turn on? Or does it stay off?

Jacob Klein

unread,
Jun 6, 2014, 2:20:36 PM6/6/14
to tas...@googlegroups.com
Also uncheck restore settings in the profile settings, that may make it turn off too given the profile goes inactive once the display is on. -for testing purposes that is that will help

MS

unread,
Jun 6, 2014, 3:59:29 PM6/6/14
to tas...@googlegroups.com
Hey guys, sorry for the late reply.

@Brandon
I replaced the Display State Off with Display Off Event but that didn't work - the profile never became activated.

@Jacob
1. I tried the WiFi Off task disabled - WiFi never came on. It stays off.
2. I checked the profile settings, there is no option for Restore Settings :? It only has:
  • Launched Task Priority (5)
  • Cooldown Time (00:00:00:00)
  • Limit Repeats (Unchecked)
  • Enforce Task Order (Checked)
  • Show In Notification Pulldown (Checked) 
Also, one more thing. I have disabled the Tasker Notification from Application Manager as I don't want a permanent icon in my notifications - I understand that this can cause problems if Android closes Tasker. But, Tasker's settings are still set to Run In Foreground (Checked).

Other testing I've performed
I created another Profile involving WiFi life this:
Profile
Name: WiFi On When In Use
Display State On
Enter Task: WiFi On
Exit Task: WiFi Off

Task: WiFi On
WiFi Set: On

Task: WiFi Off
WiFi Set: Off

This profile works every time, WiFi comes on when screen switched On and WiFi goes off when screen switches Off. Reason I think why it works is because when Screen goes On or turns Off, CPU is becomes awake OR remains awake shortly after screen goes off.

Run Log shows that ALL the actions executes without any errors including the WiFi set ON and WiFi set OFF actions... So I'm not sure what the problem is... Could be the "Keep Device Awake" fault inside Task Properties or Android 4.1.2 firmware issue.

Matt R

unread,
Jun 6, 2014, 4:53:35 PM6/6/14
to tas...@googlegroups.com
First, disable all Tasker profiles (at least, any that do anything with WiFi). Then, create a time profile for 5 minutes from the current time (set the to and from times the same). And set it to turn WiFi on. Then exit Tasker via the back button (to save the profile), make sure WiFi is off, and turn the display off, wait 10 minutes, then check if the WiFi is on.

Matt

MS

unread,
Jun 7, 2014, 11:23:52 AM6/7/14
to tas...@googlegroups.com
@Matt

I tried that, WiFi stays off. WiFi:On command ONLY work if screen is on (because CPU is awake). During screen Off, it doesn't work.

Brandon Horwath

unread,
Jun 7, 2014, 12:51:08 PM6/7/14
to tas...@googlegroups.com
Maybe select, 'keep device awake' in task properties setting?

MS

unread,
Jun 7, 2014, 1:22:49 PM6/7/14
to tas...@googlegroups.com
@Brandon

I have already enabled that setting. It is having no effect.

My temporary work-around is:

1. Use SecureSettings plugin to wake up device (Screen dim + cpu)
2. Switch on WiFi
3. Wait 1 min
4. Switch off WiFi
5. SecureSettings, release wake up device (screen goes off.

This seems to work, but I wonder if this is efficient? Whole point of this profile is to save Battery usage by the WiFi in the background (while screen is off), but this workaround might use more battery than it saves... Any thoughts?

Matt R

unread,
Jun 7, 2014, 1:41:45 PM6/7/14
to tas...@googlegroups.com
In the android settings, do you have it set to keep WiFi on during sleep?

Matt

MS

unread,
Jun 7, 2014, 2:56:31 PM6/7/14
to tas...@googlegroups.com
@Matt

No, it is disabled. 

"WiFi timer" is switched Off, and 
WiFi sleep policy setting is set to Never.

I tried the SecureSettings Wake Up action (CPU only) - didn't work, WiFi stays off.
But, the SecureSettings, Wake Up action (Screen dim + CPU) works.

This indicates it's a Tasker bug on JellyBean 4.1.2 - "Keep Device Awake" in the Task settings doesn't work.

Matt R

unread,
Jun 7, 2014, 3:39:46 PM6/7/14
to tas...@googlegroups.com
Well, if you tried waking the CPU with secure settings and that didn't work, I don't think it's Tasker's "keep awake" that isn't working. Sounds like a problem with your device. Are you using a custom ROM or xposed?

Matt

MS

unread,
Jun 7, 2014, 3:44:50 PM6/7/14
to tas...@googlegroups.com
I'm using the original ROM that came with my device. No that's a lie... It came with 4.1.1 jelly bean, then I updated it ONCE when I was prompted by the system to 4.1.2 - so yeah, I guess you can say it's original, not custom/xposed.

MS

unread,
Jun 7, 2014, 3:51:35 PM6/7/14
to tas...@googlegroups.com
Should I update my device to 4.3? I've been prompted with the update message but I rejected it because other people with the same device as mine (Samsung S3), who updated it from 4.1.2 to 4.2 to, finally the latest, 4.3 had so many firmware problems... Battery drain, couldn't answer calls, and lots of other things.

I updated it to 4.2 few months ago, and I exxperienced the same problems (battery drain, calls, etc). I had to send the phone off to Samsung for repair and have them Flash it back to the Factory ROM, 4.1.2... Ever since, I've rejected further updates. I suppose it's not worth the risk.

Matt R

unread,
Jun 7, 2014, 4:33:48 PM6/7/14
to tas...@googlegroups.com
I dunno. Maybe try uninstall and reinstall of Tasker? Make sure you backup your data first (menu > data > backup).

Matt

MS

unread,
Jun 7, 2014, 4:36:32 PM6/7/14
to tas...@googlegroups.com
@Matt

Tried that already, still the same... Guess I'm out of luck.

Brandon Horwath

unread,
Jun 7, 2014, 9:05:11 PM6/7/14
to tas...@googlegroups.com
Have you tried the beta?

MS

unread,
Jun 8, 2014, 7:30:45 AM6/8/14
to tas...@googlegroups.com
@Brandon

I installed the m beta version. Tested the WiFi again, still the same issues as before. I noticed something though. This is the order of the Actions:

  1. Say: "Preparing Synchronisation"
  2. WiFi: On
  3. Wait 30 Secs, Until %WIFII ~ *CONNECTION* - problem here is that even though the TimeOut is set to 30 seconds, it just continues to wait past that...
    In fact, nothing happens even after waiting for 5 minutes. So I turn on the screen and unlock the phone to see where it got stuck, and ITS THEN that it displays the "Connected to xxxx wifi" toast and says "Synchronising" at Action 4 (1). It seems to "hang"

    This happens with both the 4.3u4 and the beta version. Does this help at all?

  4. If %WIFII ~ *CONNECTION*
    1. Say: "Synchronising"
    2. Wait 1 min
  5. End If
  6. WiFi: Off
  7. Wait 15 Secs, Until %WIFI ~ off
  8. Say: "Synchronisation Complete"

Brandon Horwath

unread,
Jun 8, 2014, 12:22:10 PM6/8/14
to tas...@googlegroups.com
As Matt said then, looks like you'll need to enable the option in settings to keep WiFi on while device is asleep.

Otherwise, while your phone is asleep it's not actually connected.

MS

unread,
Jun 8, 2014, 2:22:06 PM6/8/14
to tas...@googlegroups.com
@Brandon

Changed that setting too, still not working. I think it's safe to conclude that it's my device that is faulty. Unless anybody else is having the same issue with this device (Samsung S3, 4.1.2) who can share anything now or in the future, I'll monitor this thread for updates. But in the mean time, many thanks to all of you that have responded.

Brandon Horwath

unread,
Jun 8, 2014, 3:18:30 PM6/8/14
to tas...@googlegroups.com
Samsung S3, 4.1.2

By any chance, do you have your Bluetooth on?

A friend owned two of those both needed replacing, due to factory defect with BT interfering with WiFi. Specifically, WiFi was shutting off while the screen was off if the BT radio was on.

MS

unread,
Jun 8, 2014, 3:38:51 PM6/8/14
to tas...@googlegroups.com
I have never turned on my Bluetooth in the 18 months I've had this phone, not sure if my phone has this issue. I've switched it on now and will monitor the WiFi if it goes off... If my S3 has this fault, I will send it off to Samsung as it's still under warranty for further 6 months.

MS

unread,
Jun 8, 2014, 3:44:36 PM6/8/14
to tas...@googlegroups.com
Thing is, I know S3 has a lot of problem with 4.1.1 and above, but for my device, 4.1.2, WiFi has never has any problems. It never disconnects randomly, it never freezes, WiFi stays on if I leave it on after switching the display off (it doesn't disconnect as you described), no WiFi issues whatsoever.

It's just that Tasker seems to have trouble controlling the WiFi after screen goes off. Which is very strange. I tried Juice Defender too, this too had issues controlling the WiFi with the screen off. It's definitely the 4.1.2 update that has some internal bug that's causing this. Tasker and Juice Defender are both very highly rated so clearly they can't both be buggy.
Reply all
Reply to author
Forward
0 new messages