1. Are you ready for the Galaxy S20? Here is everything we know so far!

Tasker WiFi Polling Not Working

Discussion in 'Android Apps & Games' started by GreatWhiteShark, Aug 13, 2017.

  1. GreatWhiteShark

    Thread Starter

    I have been testing wifi polling and can't get it to poll correctly. Here is my setup:

    Handset - WiFi Off

    Profile - PollWiFi
    Event - WiFi Near (no options)
    Task - Alert -> Flash -> "WiFi found"

    That's it. I have WiFi polling set to 30 seconds. But the profile never runs even though the notification says the PollWiFi profile is active. What am I missing here?

    The eventual goal is to have WiFi off, poll for when WiFi is near, and then turn WiFi on. Then when WiFi is not near, turn WiFi off.

    1. Download the Forums for Android™ app!


  2. Works for me ...

    Profile: WiFi Near (533)
    State: Wifi Near [ SSID:* MAC:* Capabilities:* Min. Activate Signal Level:0 Channel:0 Toggle Wifi:Off ]
    Enter: Anon (534)
    A1: Flash [ Text:WiFi Found Long:Off ]

    ... here's a guess ... jn /Preferences/Monitor uncheck Run In Foreground if it is checked.

    ... Thom
  3. GreatWhiteShark

    Thread Starter

    Did this run every 120 seconds (or whatever you have the WiFI polling value set to in preferences)? I can get it to run once but that's it. I unchecked run in foreground but that had no effect. The only way I was able to get Poll to run repeatedly was to create another profile with a time context of every two minutes from midnight until 11:59PM with a task that turns the Poll profile off and then back on again. And I'm not even 100% sure this is working consistently.

    It's just weird. I have double- and triple-checked the Android settings. I am using a Galaxy S8 with Android 7.0. I'm beginning to wonder if I have stumbled onto a Tasker bug.

    Edit: Toggling the WiFi Near profile with a time context profile has stopped working. The profile is toggled but still won't run.

    By the way, in your code above what is Anon (534)? I sometimes see those and never know what causes them unless I have an orphan scene.
    #3 GreatWhiteShark, Aug 13, 2017
    Last edited: Aug 13, 2017
  4. I think there are a number of issues going on here.

    I assume WiFi pooling refers to WiFi Scan Seconds. Mine is set to 120.

    If you have run in foreground on ... turn it off. If you don't then Tasker will only run when it is on the screen.

    When you change a preference you (usually) have to exit preferences before it takers place. You may have to exit Tasker.

    When you make any Profile, Task, or Scene change a check mark appears at the top of the screen. You must either tap the check mark or Exit Tasker for the change to register.

    You may have another profile active that is conflicting with the profile you are working on.

    Anon is what is displayed when you choose New Task (first entry) for an Entry task and when prompted for a name just hit return. It will use the name Anon.

    ... Thom
  5. It will trigger once. It will be marked as running until you eave the area that is near WiFi or toggle the profile.

    If you are trying to have it trigger every 2 minutes you could run a task that has a two minute timer that turns the profile off and then back on.

    ... Thom
  6. GreatWhiteShark

    Thread Starter

    Well, I think I've hit the wall. I deleted every profile except this one...nothing. Then I uninstalled and reinstalled Tasker and rebuilt the profile...nothing.

    A couple of things of note: I believe the Run in Foreground option refers to how the OS prioritizes the task. Background tasks are given a lower priority and are more prone to being killed by the OS if resources run low. However, I did see that every time I enabled or disabled this option, the profile would run once.

    I was also looking at the FAQ under the heading Why Won't My Profile Run. This may be an old FAQ, but Pent mentions two "activation" steps. The first is a green tick next to the profile. I've never seen that. But he also mentions the "On" button (I assume this is the green slider switch) in the "Profile List screen." Finally, he says to look to see if the profile is shown as active in the status bar pulldown. Again, I've never seen this.

    I can't use a timer profile as you suggested, because the associated task can only contain actions (not states). So I would have to have WiFi turned on all the time, which defeats the purpose of this thing in the first place.

    I'll keep plugging away and if you think of anything, let me know. Thanks for your help. :)
  7. The timing would be a separate task and not a profile.

    It is going to only trigger once. If you had an added Exit task it would be invoked when you no longer sensed a WiFi network,

    If you never move away from the spot where you originally triggered it it will not trigger again unless you toggle the WiFi network or toggle the profile.

    The reason this is not obvious is that your requirements are a little unusual. My experience has always been using this trigger to detect a specific WiFi network so that WiFi could be turned onin the phone to access it.

    An added note ... there can be multiple triggers for the same profile. In the Profile display select the trigger in the profile and select Add.

    ... Thom
  8. GreatWhiteShark

    Thread Starter

    Ooooh....let me give that a try. The only issue I might run into is that I live in a fairly congested area, so as I move from one place to another, chances are good that it will always sense a network nearby. But what you described is exactly what I am trying to do--scan for WiFi networks nearby with WiFi turned off on the phone using %WIFII.

    If a network is found, turn WiFi on. Then check %WIFII for *CONNECTION*. This is because I connect to several networks (home, restaurant, my parents' home, etc.) so I can't use a specific SSID. I could search for SSID1, SSID2, SSID3, etc. in the first WIFII% string, but if I added a new connection (SSID4) I'd have to change the search. By looking for any *CONNECTION* I can add/remove connections on the fly.

    If no connection is made, turn WiFi off and keep looking. If a connection is made, configure phone accordingly (Bluetooth off, autosync off, etc.). But as I write this, I see some issues, so I might have to rethink. :)
    chappy212011 likes this.
  9. When I didn't have Unlimited I used the following two Profiles. You can add as many SSIDs as you like. The purpose ... leave WiFi off unless I was in the range of either network.

    Profile: tlaOfficeFar
    State: Not Wifi Connected [ SSID:NETWORK-A/NETWORK-B MAC:* IP:* Active:Any ]
    Enter: Anon
    A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
    A2: Variable Split [ Name:%WIFII Splitter: Delete Base:Off ]
    A3: WiFi [ Set:Off ]

    Profile: tlaOfficeNear
    State: Wifi Near [ SSID:NETWORK-A/NETWORK-B MAC:* Capabilities:* Min. Activate Signal Level:4 Channel:0 Toggle Wifi:Off ]
    Enter: Anon
    A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
    A3: WiFi [ Set:On ]

    ... Thom
  10. GreatWhiteShark

    Thread Starter

    Yep, that's what I have concluded also. The way I had it set up, WiFi would constantly toggle every time it was near a network.

    I also found a work-around for the WiFi Near event not running. I created a profile with a time context that fires every three minutes. That's attached to a task that does nothing. Then I added a second profile entry for the WiFi Near. So far it seems to be working (fingers crossed).

    Profile: CheckNet
    Event: Time --> nothing
    Event: Wifi Near --> do my thing

    It's kind of kludgy, but it works! :)

    Thanks so much for your help and if I ever figure out why Wifi Near wouldn't run by itself, I'll let you know.
  11. You can have multiple SSIDs in the trigger. The "/" means "or".

    ... Thom
  12. GreatWhiteShark

    Thread Starter

    Ah! Good to know...thanks!


Tasker Forum


⚙No repetitive tasks for you, let your Android device handle it!⚙
Total Automation, From Settings to SMS. Here are only some
of the things you could do with Tasker. Its real power is the flexibility to combine contexts and tasks however you wish: https://tasker.joaoapps.com/exampleuses.htmlAutomations
Make your phone a true smart
phone! Why remember to change the volume every day when you leave home when your phone can do it for you? Automate stuff based on the app you're in
, the time of day
, your location
, your Wi-Fi network
, Received SMS or Calls
, the currently playing song
and many other (130+) states and events! Check out how easy it is to create an automation: https://www.youtube.com/watch?v=s6EAbLW5WSkActions
350+ actions allow you to truly customize your phone like never before! Send SMS, create notifications, change almost any system setting like Wifi Tether, Dark Mode, Always On Display, change any volume, control Do Not Disturb, open apps, file manipulation, control music playback, get your location... you get the idea. If you can think of it, Tasker can probably do it for you! Note: root is NOT (I repeat NOT) required for majority of the functions.
However, a few of the actions (like the Airplane Mode action and the Mobile Data action on some devices) require root. Regarding those few actions that do require root, this is because of Android security policies that developers cannot work around. ☑ Other Triggers
Manually trigger your actions via launcher shortcuts, quick setting tiles, widgets, long-pressing volume buttons, media buttons (like the ones on your BT headsets or headphones), Bixby button, Navigation Bar, Notificaitons and more! ☑ Join - Remote Tasker
Adding Join (https://play.google.com/store/apps/details?id=com.joaomgcd.join) to the mix will even allow you to trigger tasks from another Android device or PC! ☑ Scenes
Design your own UI and use it to display any info you want or trigger any task! ☑ App Creation
Create your own standalone apps to share or sell with the Tasker App Factory (https://play.google.com/store/apps/details?id=net.dinglisch.android.appfactory)! ☑ Developer Friendly
A lot of 3rd party developers already allow you to perform actions in their apps and listen to their events/states through Tasker! Check out a list of plugins https://tasker.joaoapps.com/pluginlist.html. You can also call most of the Web APIs from Tasker with the powerful HTTP Auth and HTTP Request actions! Check out an example https://youtu.be/yAt2D1XmgUI. ☑ 7 day trial - one time payment to unlock
Get it here: https://tasker.joaoapps.com/download.htmlUseful Links
Starter Guides: https://tasker.joaoapps.com/guides.html Pre-made projects: https://forum.joaoapps.com/index.php?resources/ Official Support Forumhttps://groups.google.com/forum/#!forum/tasker Community full of people willing to help: https://www.reddit.com/r/tasker/ It's not possible to fix problems reported via Play Store Comments so please use the "Report Issue To Developer" option in the app > Menu to do so. Note
: Tasker uses the BIND_DEVICE_ADMIN permission in order to provide the System Lock functionality

February 15, 2020
Last Updated

Share This Page