1. Download our Official Android App: Forums for Android!

Tasker WiFi Polling Not Working

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

  1. GreatWhiteShark

    Thread Starter
    16

    Aug 13, 2017
    6
    2
    16
    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.
     

    Advertisement

  2. Thom

    Thom  
    VIP Member
    1,243

    Feb 16, 2011
    11,604
    4,788
    1,243
    Male
    Software Developer
    Keene, NH USA
    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
    16

    Aug 13, 2017
    6
    2
    16
    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. Thom

    Thom  
    VIP Member
    1,243

    Feb 16, 2011
    11,604
    4,788
    1,243
    Male
    Software Developer
    Keene, NH USA
    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. Thom

    Thom  
    VIP Member
    1,243

    Feb 16, 2011
    11,604
    4,788
    1,243
    Male
    Software Developer
    Keene, NH USA
    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
    16

    Aug 13, 2017
    6
    2
    16
    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. Thom

    Thom  
    VIP Member
    1,243

    Feb 16, 2011
    11,604
    4,788
    1,243
    Male
    Software Developer
    Keene, NH USA
    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
    16

    Aug 13, 2017
    6
    2
    16
    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. Thom

    Thom  
    VIP Member
    1,243

    Feb 16, 2011
    11,604
    4,788
    1,243
    Male
    Software Developer
    Keene, NH USA
    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
    16

    Aug 13, 2017
    6
    2
    16
    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. Thom

    Thom  
    VIP Member
    1,243

    Feb 16, 2011
    11,604
    4,788
    1,243
    Male
    Software Developer
    Keene, NH USA
    You can have multiple SSIDs in the trigger. The "/" means "or".

    ... Thom
     
  12. GreatWhiteShark

    Thread Starter
    16

    Aug 13, 2017
    6
    2
    16
    Ah! Good to know...thanks!
     
    buathonghadchaiyapom likes this.

Share This Page

Loading...