Very confused about how to manage WiFi

Post your questions and help other users.

Moderator: Martin

Post Reply
Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Very confused about how to manage WiFi

Post by Econdoc » 28 Sep 2016 14:59

Although my AM skills are improving, I am still having trouble figuring out how things work and how they fit together. I have lots of questions! :D

Trigger: Wifi Scan Results Available
Condition: Wifi available
Actions: Init Wifi Access Point List, WiFi Reassociate, Wifi scan

How do these relate to each other? I have read the descriptions, but I remain confused.

For example, the description for condition Wifi Available reads “The condition WiFi Available checks whether one specific WiFi access point is currently available. The condition waits for the first available scan result when wifi has just been enabled and no scan result is available yet.” (My underlining.)

I am sure that this means something, but I do not understand it. What scan does this refer to? Something that I need to initiate from AM? Something the operating system automatically does? Do I have to execute Wifi Scan myself to make this work?

The description for WiFi Reassociate says this: “The action WiFi Reassociate reconnects to the currently active access point.” Why would a reconnect be necessary? Won’t the device automatically reconnect to the current access point? When would I use this action?

I realize that Action Wifi Scan triggers WiFi Scan results available. I just don’t understand when one would do this.

Anyone willing to hold my hand and walk me through this?
Thanks in advance.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Very confused about how to manage WiFi

Post by MURTUMA » 28 Sep 2016 19:01

Econdoc wrote:The condition WiFi Available checks whether one specific WiFi access point is currently available. The condition waits for the first available scan result when wifi has just been enabled and no scan result is available yet.
The condition checks if there is a wifi-hotspot that you can connect to available. You can check for a specific hotspot by defining its SSID, for example "wifi-home" or what ever your home network's name is. Or you can check for any available hotspot by using wild card: "*". The underlined text is just technical info how the condition works and can be mostly ignored. However, it means: your phone scans for wifi hotspots just like you scan your surroundings with your eyes. The condition checks from that scan result for what ever you have asked it to check. If your phone has not completed the scan, there is no results available and the condition will wait until the scan is complete and results available.

Your phone makes the wifi scanning on its own when you enable wifi and again from time to time when enabled. You don't have to worry about that.
The description for WiFi Reassociate says this: “The action WiFi Reassociate reconnects to the currently active access point.” Why would a reconnect be necessary? Won’t the device automatically reconnect to the current access point? When would I use this action?
I'm not exactly sure about this, I haven't had a situation where should I need this action.
I realize that Action Wifi Scan triggers WiFi Scan results available. I just don’t understand when one would do this.
Your phone has a timer for scanning wifi from time to time so mostly you don't have to think about that. However, with action Wifi scan, you can start the scanning at your will. Like the documentation states, it may fasten the connecting to wifi in some cases. When you fire up the action, you need a second flow with trigger Wifi scans available to process and react to the scan results. Without this trigger the afore mentioned action would be pretty useless.

Also, like I stated earlier, your phone scans for networks on its own too. The trigger can also be used in that situation. Example: you walk to a local bar and enable wifi manually. When your phone finds the bar's network, the flow triggers and does what ever you've configured it to.

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Re: Very confused about how to manage WiFi

Post by Econdoc » 29 Sep 2016 11:16

Thanks, Murtuma, for the very helpful response.
I would like to pursue your last point, where I walk to a local bar. :D :D
Seriously, if I understand your point, I can speed up my connection to the wifi at the bar doing the following: (Assume the SSID of the bar is “localbar”)

I would need
A Trigger: Execute Wifi Scan when wifi is turned on.
A Trigger: Wifi Scan Results available (I don’t need to do anything with this? It just needs to exists?)
A Trigger: Wifi Connected (with SSID = localbar)

Is my logic correct? The sequence correct?

Thanks again.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Very confused about how to manage WiFi

Post by MURTUMA » 30 Sep 2016 19:35

Econdoc wrote:A Trigger: Execute Wifi Scan when wifi is turned on.
A Trigger: Wifi Scan Results available (I don’t need to do anything with this? It just needs to exists?)
A Trigger: Wifi Connected (with SSID = localbar)
When you enable wifi on your device it starts scanning immediately, so you won't need action Wifi scan if you enable wifi at the range of "localbar".

The scanning is executed periodically when wifi is enabled. Some people increase the timer to increase battery life. If you already have the wifi enabled when entering the range of "localbar", you just might do that in between of scannings so you have to wait until next scan before your device finds the network, but with Wifi scan you can execute the scanning at will. However, generally the interval is so low that the action does not give you noticeable benefits, but you'll find out the best by experimenting.

Trigger Wifi scan results available does not need Wifi scan action. It's the other way around. The trigger executes even after your device has done scanning on its own, however, the action needs the trigger to process and react to the scan results. Without the trigger the action is pretty useless.

The most simple solution would be:
TRIGGER: Wifi scan results available; "localbar"
ACTION: do what ever you want to do when entering the wifi's range. Actions Enable wifi access point and Set wifi access point priority might interest you in this case.

briney
Posts: 6
Joined: 10 Jul 2013 13:19

Re: Very confused about how to manage WiFi

Post by briney » 28 Dec 2017 22:03

Hi Guys. I was looking at "WiFi Reassociate" to possibly solve a problem for me. I use a powerline to boost my wifi upstairs. However, my android 7 phone will persevere with a poor wifi signal strength and not look for a stronger wifi unless wifi drops out altogether. Do you think it is possible to measure the strength of the wifi signal (using Condition "Wifi signal level") and when it drops below a specified strength, then use "wifi reassociate" to pick up the cloned powerline signal? Will it pick up the stronger signal, or will it pick up the same low strength signal it was previously on? Thanks.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Very confused about how to manage WiFi

Post by Desmanto » 29 Dec 2017 18:11

briney wrote:Hi Guys. I was looking at "WiFi Reassociate" to possibly solve a problem for me. I use a powerline to boost my wifi upstairs. However, my android 7 phone will persevere with a poor wifi signal strength and not look for a stronger wifi unless wifi drops out altogether. Do you think it is possible to measure the strength of the wifi signal (using Condition "Wifi signal level") and when it drops below a specified strength, then use "wifi reassociate" to pick up the cloned powerline signal? Will it pick up the stronger signal, or will it pick up the same low strength signal it was previously on? Thanks.
I also use powerline, have main wifi router is on 3rd floor, secondary at 1st floor. Occasionally, I will have the problem switching between both, but maybe only 5-10% of the time. Most of the time, it will switch perfectly.

To scan it, use condition : Wifi Available. It will provide all the variable you need, put condition debug dialog to check which one you need. It should be {level} in this case. It is in dBm unit, so -40 means you are very close to the wifi, -90 means you almost lost the signal. Scan for your SSID and check it.

But the problem is, wifi available will only give you the highest level signal if you check on same SSID. So even though you are at upstair, connected to 1st floor wifi with only -80 dBm (not yet lost), when it scans the wifi, it will report the signal level of your stronger wifi at upstair (lets say -55 dBm). This happen only for same SSID. I don't know if this is android's feature, or automagic's. If you set for different SSID, then it will switch smoothly then. But that will cut the connection for a moment, wifi roaming is not possible anymore.

It is very difficult for me to test the Wifi Reassociate. My phone immediately switch on the fly as I roam to 1st floor. Check the debug dialog, the BSSID already changed without me noticing. Probably you should try it out if the reassociate will pick up the stronger one. But somehow it will still be hindered by the wrong reporting of the highest signal (not the current connected one).

You can read more about my test at http://automagic4android.com/forum/view ... f=4&t=6900
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

xdauser
Posts: 35
Joined: 05 Aug 2015 17:55

Re: Very confused about how to manage WiFi

Post by xdauser » 29 Dec 2017 19:57

Maybe it depends from ROM how wifi roaming is implemented. In my case I have couple of APs around the house on both floors. If I decide to leave management of roaming to system sometimes it sticks to AP which is not optimal (not the strongest one) but not "enough" weak to disconnect from. I managed to improve this behavior by making flow which scans signal strength of connected WI-Fi and when it drops below certain level it switches WiFi off and on again to connect to different (stronger) AP. Unfortunately re-connecting to stronger AP cannot be done on-fly without this trick. It works pretty well.

Post Reply