wifi scan results available how to

Post your questions and help other users.

Moderator: Martin

User avatar
xpdev
Posts: 59
Joined: 16 Sep 2014 06:20
Location: Italy

wifi scan results available how to

Post by xpdev » 16 Sep 2014 14:09

Hi guys...

how i may check if a wifi name is in the "Access_point" variable from "wifi scan results available" ?

May be with a script but i don't know how use it

Many thanks
Xiaomi MI 6

Rom Miui 10 EU STABLE

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: wifi scan results available how to

Post by Martin » 16 Sep 2014 16:29

Hi,

You could use a condition expression like containsElement(access_points, "WiFi123") or you could use a condition WiFi Available: WiFi123 in the flow to make the check.

Regards,
Martin

angelatwork
Posts: 186
Joined: 12 Feb 2014 01:45

Re: wifi scan results available how to

Post by angelatwork » 17 Sep 2014 08:58

A question in connection to this. I have a flow on my tab that is supposed to switch to a WiFi hot-spot on my phone when it is available. But it seems to work only sporadically. I cannot find an action or trigger to actually connect to an accesspoint, only to enable or to see if it is connected or to set priority. Can I make it connect without using control UI?
Thank you
Best regards,
AngelAtwOrk

mcyber
Posts: 37
Joined: 08 Nov 2013 14:21

Re: wifi scan results available how to

Post by mcyber » 17 Sep 2014 13:04

As per Martin example, you can use condition WIFI Available, and compare the result against a local or a global variable. If you have Android 4.3.x or above, you can also check for available APS without firing up WiFi (this requires to flag an appropriate option in WiFi advanced configuration panel into o.s. settings). The trigger could be timed or "on condition" or a mix of both or whatever good for you.
I have a reatively large set of flows that manage my wifi automatically. Unfortunately they rely on a number of structured variables (lists and the like), some of which need to be initialized manually, at the moment (so it would be a nightmare for other users to figure out how to set them up and for me to support their inevitable questions). As soon as there will be the possibility to export them much like flows, I'll post.
In the attached simple flow you can see a working yet simple pattern to achieve your specific goal. You need only to figure out how to populate the list against which compare the result of the scan. You can do in manually, for example, if you have a relatively stable set of Access Points you normally use, or you can type a list of APs as literals, comma separated, directly into the field, just to speed up your test. Your taste about trigger my be different, so you can change it at will (timed, location, multiple,... whatever). Trigger's only purpose is to evaluate the WIFI Available condition. This is a stripped down version of my original flow, just to explain the idea and let it work without issues. Nonetheless it works perfectly (when global variable is correctly set).
If you leave the supplied trigger as is, expect the scan to occour every 3-5 minutes, according to my observations and on my device (Note II). Check on yours and increase-decrease frequency to suit your taste (if you whish to have control over trigger frequency, you must use a different trigger or combination of triggers)
Please, remember that you must have 4.3.x, or above, and the wifi scan always on for this flow to work, as per my foreword.
Hope this will help.

http://automagic4android.com/flow.php?i ... 2424b11d37

mcyber
Posts: 37
Joined: 08 Nov 2013 14:21

Re: wifi scan results available how to

Post by mcyber » 17 Sep 2014 14:19

A bit off-topic.

The attached flow, would behave much the same as the one I posted above but doesn't require Android 4.3.x or newer. Like in previous sample, the core functionality, doesn't rely on trigger result, thus trigger can be modified at user need.

Just in case.

http://automagic4android.com/flow.php?i ... d8563ac8c2

angelatwork
Posts: 186
Joined: 12 Feb 2014 01:45

Re: wifi scan results available how to

Post by angelatwork » 17 Sep 2014 14:40

Thank you for your lengthy answer :-) ☺. Sorry, I mustn't have been clear enough. I do have a flow similar to yours. See attached flow. I have wifi enabled all the time on my tab, I only wish to automatically switch to my phone's hot-spot as a source when enabling it on my phone. I also have a trigger wifi enabled with the action wifi scan in another flow. But the flows will show that the access point is available, and set to priority 1 but it will not connect to that WiFi source (my phone's hot-spot ) automatically. Something is missing/ wrong or I need an action to connect to a certain WiFi soure :-)

Thanks again for taking your time!

http://automagic4android.com/flow.php?i ... 9a2168301d
Best regards,
AngelAtwOrk

mcyber
Posts: 37
Joined: 08 Nov 2013 14:21

Re: wifi scan results available how to

Post by mcyber » 17 Sep 2014 17:39

angelatwork wrote:Thank you for your lengthy answer :-) ☺. Sorry, I mustn't have been clear enough. I do have a flow similar to yours. See attached flow. I have wifi enabled all the time on my tab, I only wish to automatically switch to my phone's hot-spot as a source when enabling it on my phone. I also have a trigger wifi enabled with the action wifi scan in another flow. But the flows will show that the access point is available, and set to priority 1 but it will not connect to that WiFi source (my phone's hot-spot ) automatically. Something is missing/ wrong or I need an action to connect to a certain WiFi soure :-)

Thanks again for taking your time!

http://automagic4android.com/flow.php?i ... 9a2168301d
My post was in answer to the thread owner, xpdev. Next time I'll disambiguate by quoting. My fault.
I answered to you with another lenghty answer thinking that there would have been an Acrion to let device connect to a specific AP, but i found that there's not such a direct way to do it (my second fault). Have you tried to turn off wifi, when phone is in range and turn on it again? Maybe resetting connection would force Automagic to re-assign priority. If already connected, maybe priority is no longer accounted (connection continuity could be privileged with respect to other considarations - this make sense also).
Is it?
Last edited by mcyber on 17 Sep 2014 18:01, edited 1 time in total.

angelatwork
Posts: 186
Joined: 12 Feb 2014 01:45

Re: wifi scan results available how to

Post by angelatwork » 17 Sep 2014 17:59

Sorry, my fault! Thanks, will look into it!
Best regards,
AngelAtwOrk

mcyber
Posts: 37
Joined: 08 Nov 2013 14:21

Re: wifi scan results available how to

Post by mcyber » 17 Sep 2014 18:04

angelatwork wrote:Sorry, my fault! Thanks, will look into it!
:D :D :D We are runinng one after the other :D :D :D

I post while you post. Wile you answer I modfy. For a couple of days I'll keep quiet, so I'll be sure you'll have read my last version.

Reading at the definition of Set WiFi Access Point Priority i suspect that the priority is accounted only when APs are available but not yet connected. Disconnecting and reconnecting could do the trick at the cost of a short blackout. I'll try as soon as I can.

:D :D :D

angelatwork
Posts: 186
Joined: 12 Feb 2014 01:45

Re: wifi scan results available how to

Post by angelatwork » 17 Sep 2014 18:59

Yes , I saw that your text had completely changed when I was posting my reply :-D :-D :-D.

But your latter answer seems more like what I thought. It seems like it does not matter what I do if I don't check the option disable other accesspoints, nothing happens IRL, although the flow works fine.

If I look in the log after the flow has fired. Anitas_S4 is set as priority 1 and Dovado as 2 and the accesspoint list holds both Anitas_S4 and Dovado and the wifi access point Anitas_S4 is enabled =true. One would expect my tab to connect to Anitas_S4 when it is tethering, but No :-). Only if I check the option disable all other access points, then it will change from my LAN to my phone when the flow is fired. So we don't really seem to have the action to force the connection to a specific wifi, if you don't want to disable the other accesspoints. But at least I now with your help have an option ;-)

So you say we should stop seeing each other this way? :-P
Best regards,
AngelAtwOrk

Post Reply