Force connection to selected WiFi AP?

Post your questions and help other users.

Moderator: Martin

Post Reply
Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Force connection to selected WiFi AP?

Post by Wibbly » 03 Sep 2018 14:52

Anyone have a flow that does this?

My use case is to connect only to a specific AP under certain conditions, otherwise connect to any AP that's been configured.

I'm thinking Set WiFi Access Point Priority might work, with priority set to 1(?). Should I only need to run this flow once? Problem with this method is it's not officially supported anyway. I'm using Pie.

Or maybe is the right method is to use Enable WiFi Access Point using the Disable other access points check box. At least that's presumambly using a supported API. But how do I go about re-enabling all the other disabled access points again afterwards? I presume I use Init Variable WiFi Access Point List and recursively call Enable WiFi Access Point with each configured AP? What should the flow look like that would do this?

APs that have been disabled but remain configured are presumably not distinguished as such in the standard Pie settings user interface?

Anyone go any experience of this?

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

Re: Force connection to selected WiFi AP?

Post by Desmanto » 03 Sep 2018 18:21

Setting priority doesn't ensure it will always connected to the most favored one. I have set my wifi ac as the first priority, but still sometimes it can connect to the n one.

I ever thought about using some kind of periodic timer to cover it. So Flow A with wifi connected trigger. It checks if it connects to n, then it will scan for the ac one. If it found it, it will reconnect to that instead. If not found, then it will activate a periodic timer every minute to scan for the wifi ac again, until it can connect to it. But it uses periodic timer, which should be avoided if possible.

Your method seems to be better. I just know we have that action Enable Wifi AP :lol: So you can enable single SSID and disable all other for that condition. When you need to reenable all other AP, simply use global pattern * and uncheck the Disable other AP. It will re-enable back all the AP. No need for recursive enabling them. But as I test, even disabling them, if the enabled wifi is not available, it will still reconnect to the disabled ones.

I don't what happen to the wifi SSID when they are disabled in Pie. But in Oreo 8.1, they stay the same, not distinguishable from the enabled one. So probably it is like that by default. Disabling them simply prevent connection to them when the enabled is available.
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.

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: Force connection to selected WiFi AP?

Post by Wibbly » 03 Sep 2018 19:10

Thanks

Post Reply