Posts navigation

Android’s Greatest Flaw: Wifi Roaming

Over the years, like all operating systems, Android has had bugs uncovered and security flaws exposed. As you would expect, over time the worst of these have all been steadily patched and updated to provide one of the best (Open Source!) mobile device platforms out there. Unfortunately there’s one flaw that has never fixed, much to the frustration of a lot of users: that flaw is wifi roaming.

For the sake of clarity, let me explain what I mean by wifi roaming: essentially its a devices ability to intelligently select the best wireless access point to connect to at any give moment or put more simply: to connect to the strongest known signal. The setup for a multi wifi access point (or router) wireless network that allows this is well known but here’s a quick summary:

Wifi Roaming Setup

Your access points or routers will need to be connected somehow – generally this is done via CAT5/6 network cable.

Setup up your wireless access points (or routers) with:

The same SSID (wifinetwork name)

The same security type (for example WPA2)

The same passphrase/wireless key

Ensure they are on different channels, ideally 1, 6 or 11

While a relatively simple exercise for most equipment (as proven by all laptops and non-Android devices that have passed through my home), Android devices seem to desperately cling on to whichever wireless network you told them to connect to last.

Defining the Problem

I’m standing next to my WiFi access point downstairs, I have full signal bars and perfect connection. I then move upstairs (2 stories up) and move next to the AP located upstairs.

Expected behaviour:

The phone should notice that the AP it is connected to has very weak signal, barely 1 bar left near -85/-90 db which is hardly usable. On the next background scan it should also find the second AP has much better signal, around -45db and decide to ‘roam’ to the other AP.

Actual behaviour:

The phone maintains a persistent connection with the AP downstairs for hours and does not ‘roam’ to the AP upstairs causing bad connection and battery drain.

Example

Just to illustrate this, I use Wifi Analyzer on my Samsung Galaxy S4, as you can see from the image below, my phone insist on being connect to the access point with the lowest signal (it’s barely in range).

To add insult to injury everytime I manually tell it to connect to the other Access Point (depending on which end of the house I’m in) it asks me to re-enter the password as though its an unknown network:

The Solution

For the time being there are three potential solutions available, I’ll start with the simplest and work down to the most technical:

Solution 1: The App

The simplest solution is to install the free App “Wifi Roaming Fix” which forces the device to scan for (and connect to) a better access point on a schedule. Battery life may be slightly reduced but as the App authors point out, being connected to an Access Point further away can also be a better drain.

Solution 2: Edit Your Device Configuration

As Android devices have the ability to correctly scan and connect to the strongest access point – it’s just dorment (by accident or design, no one seems to know) it’s possible to re-activate it by editing the wpa_supplicant.conf supplicant file on your device. This is not for the feint hearted but details can be found on the following pages:

Solution 3: Reconfigure Your Wireless Network as a Mesh or WDS System

Another option is to reconfigure your wireless network as a Mesh (probably too expensive for most home users) or a WDS network. I haven’t tried this solution yet but will be doing so shortly as its something I’ve wanted to play with and test for a while as a budget Mesh alternative. As soon as I have, I’ll post a more comprehensive review.

TP-Link doing a fantastic range of wireless devices that support WDS, examples can be found here on Amazon:

36 comments on «Android’s Greatest Flaw: Wifi Roaming»

Thanks for the write-up. I found the Wifi Roaming Fix app (solution 1) independently but couldn’t understand why it would be necessary until I saw your article.

I hope this gets fixed in a future version but am not holding my breath – other networking bugs have existed in Android for years from the early versions – such as the DHCP bug which results in wrong IP addresses being used by Android.

Hey Ketan, Thanks for the post, the frustrating thing is I have two Samsung KitKat devices and one works fine (my Galaxy Tab Pro) and the other requires the password be repeatedly reentered (my Galaxy S4). Bob

Hey Bob, Does the option in Settings-Developer Settings-Always Allow WiFi Roam Scans, being Enabled do the same thing for us Nexus 7 (2012) Rooted, and running 5.1.1 users? I have always left it off but after reading your article remembered the option.

Hi Bob, i confirmed that the developer option in Lollipop solved my wifi problems. I have various devices, old and new. Now, i am really curious how can i do the same for Jelly Bean and KitKat. As many of devices i have non upgradeable to Lollipop

Glad it’s not just me noticing this. We are using our phones as VoIP handsets and if you move throughout our building the call quality tanks as our devices just don’t want to move on to a different AP.

I found solution one unreliable as it will often keep failing to connect to a point, yet if I disable/re-enable Wifi the phone will then connect.

Yep this is driving me mad – in the past few weeks, my android tablet also started acting up. Two WIFI networks at opposite end of the house, same SSID, different channels, same password – my Galaxy Tablet Pro will NOT remember both of them at the same time. If I connect to one AP, when I walk to the other end of the house it refuses to connect to the other – if I force it, it asks for the password. GRRRR indeed!

Do you have any idea what “Always allow Wifi Roaming Scans” actually does? You said you would try it – did it work? The inability to wander around my house and Android to keep up with my various APs is very annoying. I have followed all of your links (#1 doesn’t work for me) but as usual on the internet they peter out in the usual “I don’t know why you’re moaning as it works for me” babel. Or the threads just peter out of their own accord.

Update: The Always Allow WiFi Roam Scans option being Enabled in Setting gs-Developers Options worked for me as I traveled from one AP to another and my rooted Nexus 7 (2012) running 5.1.1 Lollipop dropped the fading AP and connected instantly to the newer and stronger AP closest to me.

Always allow WiFi roaming scans on lollipop works for me. I use public xfinity wifi and when it’s not on and I turn on WiFi, the xfinity spot usually only shows one or two bars, 3 max. After I turn on roaming scan, automatically disconnects from the weak one and goes to a newer, stronger xfinitywifi public spot with full bars. Xfinity public WiFi has automatic login based off your devices MAC address so no need to login again, it’s automatic.

BOB, Ok. The “….allow WIFI roam scans…” from Developer Options worked on my Lolli Galaxy S4 from At&t. For a year and many months I looked for a solution as my home is 3 stories. Enabled 2 routers with all proper settings (same ssid and passwords). One router is 5 Ghz only. The other produces both 2.4 Ghz and 5Ghz. The Wifi-Roaming Fix app is useless and lacked consistency. Many bugs in my personal experience.

I did come across your write up a while ago but didn’t want to try the 3rd method. Recently I came across your page once again and read about the Develop/Allow wifi scans option and have been using it and playing around with it for a couple of weeks. My results are as follows: 1. It does what we were expecting it to do: switch to the strongest signal at around 75-65 db [per wifi analizer app]. 2. It works even better when you select the Smart Network Switch selection which picks best option between 5 Ghz, 2.4 Ghz, and mobile networks. I would never use this setting in the past cause on many instances, I would be home watching something online thinking I’m on wifi, but signal was weak and phone would be using data [high bills those days for my data usage]. At&t prob programed phones this way on purpose to increase data usage. So with both of these working together, now my phone always uses not only the strongest connection, but the one with best Ghz link speed. 3. CONS: if you restart your phone, or it updates itself, restarts itself, or anything that makes the phone restart, will remove/clear your setting on the Developer Options screen. So I’m having to check on it every now and then to make sure the box is checked for wifi scans to happen. 4. CONS. This setting might use more battery. But in my case, I don’t care cause my phone is nearly 2 years old and I’m having to have it plugged in almost all the time and everywhere. So I did not do a follow up on battery consumption. You be your own judges on this.

I’m also about to change this phone for the S6 but feel much more comfortable getting it now that I KNOW it can do wifi roaming within multiple routers. Too bad I came about this information so late. It would’ve save me some money, restless nights searching online, and frustrations with app that didn’t work

It seems to me that some of you may be misunderstanding some key points regarding what WiFi roaming is and how it works. Additionally, as far as WiFi roaming scanning, I think some of you may not fully understand what the hardware requirements are and that these requirements do not exist on all WiFi adapters and consequently do not exist on all phones so allow me to explain.

Wifi roaming can only occur between Wireless Access Points (WAP) that are connected to each other in real time and are configured to be able to offer roaming. This is a feature you almost never see on home WAPs and is considered more of a enterprise / campus grade feature. You usually require a WiFi controller which is a separate piece of hardware and all WAPs are configured to use that controller. Additionally, some companies offer hosted roaming features (such as AeroHive) where the controller exists on the cloud and you subscribe to the roaming service. The WAPs connect to the manufacturers roaming service and you may a monthly fee to use it. When you have proper Wifi roaming set up, there is nothing you need to configure on any device to use it. There is nothing that can be set to use it. Once you connect to a network which allows roaming, it is handled entirely by the WAPs and the controller and a phone cannot do anything to affect that. When you pass a zone where you would begin to have a stronger connection from a newer WAP than the one you are currently connected to, the controller detects this via data sent from the WAPs and it coordinates for one WAP to stop sending data to you at the same millesecond that the new WAP should start sending data to you. This happens in a manner where it is almost invisible to a connecting device.

When you set two “base stations” or home wifi routers or proper WAPs or whatever to have the same SSID, security type and password, you have not set up roaming. You have set up a manner for your device to move from one connection point to another connection point without re-authenticating to the wireless network but the new WAP that you are connecting to knows nothing about your previous connection. In fact you will have to re authenticate but your device, whether it’s a phone, laptop or whatever, will automatically re authenticate because due to the environment you have set up. This whole transaction though does require your device disassociates with the previous WAP and reassociates with the new WAP and this will cause a short outage time. If you are using a TCP based application such as watching a video on YouTube and if that video is not buffered enough or the buffer empties while you reassociate than there will be a delay. TCP is connection based and the reassociation time is usually shorter than the the TCP timeout time so typically no data will be lost. If you are using a UDP application with is commonly used with real time communications such as VoIP and video chat than you will probably lose data (silence during the VoIP call) and you may even get disconnected and have to reconnect.

Because of the reassociation which must occur, it’s a best practice in wireless design that you do not reassociate with a new WAP until you no longer able to communicate with the WAP you are connected to. Remember that proper roaming does not require reassociation to a WAP and the connections transition from one WAP to another, automatically through the controller and because proper roaming does this at the WAP level instead of at the connected device level, this can happen without data loss and reassociation times. When you are not using proper roaming i.e. when you have only configured two WAPs to have the same SSID / password / security type, than your device will make the intelligent decision of not disassociating from the WAP you are connected to until that WAP is no longer usable. The WiFi hardware and software you are using does not know what software you are running and it would be bad design to have it interrupt your YouTube or VoIP chat only because it knows you may be receiving a better signal now from a completely different WAP than the one you are already connected to. Additionally, there is no way for your phone / laptop / etc to know if the other WAP with the same set up is even connected to the same network. As an example, you and your neighbor may have thought you were setting up roaming by configuring two routers with the same set up so you could “roam” the Internet when walking from one house to the other but your houses are not connected and if you are streaming something to/from your home network like Chromecast and you reassociate to another network with it’s own devices than suddenly your connection will be lost.

All of the reasons above is why your phone does not “roam” the way you think it should roam and it’s specifically because you really are not implementing proper WiFi roaming in the first place.

The last point I want to make is that any app which claims to be able to pre-emptively scan for networks, as well as the developer option “Allow Wi-Fi roaming scans” may not work as you expect because there is a good chance your WiFi adapter built into your phone, or laptop, whatever will probably not have the hardware requirements to do what you need. Almost all WiFi adapters will only support one radio per frequency. If you have a phone that only supports 2.4Ghz than it will, almost definitely, only have one radio for 2.4 Ghz. If you have a phone that supports 2.4Ghz and 5Ghz, it will also almost definitely have one radio for 2.4Ghz and one radio for 5Ghz. When you are associated with a WiFi connection, meaning your phone is connected to it and transferring data over it than your phone is using that radio for the connection. When it is using that radio for the connection than it is unable to switch to scan mode to search for other WAPs or connections. A WiFi radio will either be scanning for connections or associated with connections but one radio cannot do both simultaneously. Almost all phones are built to only have one radio per frequency as are consumer grade WiFi adapters such as the one built into your laptop and any you would buy from Best Buy, etc. Multi radio adapters are special case adapters that are typically used for network testing or development or other professional means. They are more expensive and end user consumers do not need them. Keep in mind that developer options are, as the name implies, designed for developers and should not be used casually by average users. That specific WiFi option is probably used by Android developers as well as software developers using emulated devices.

HI Joseph, Thank you for your explanation. I also have a problem with all the Android devices with two major wifi issue. Our deployment is enterprise campus deployment and the Android devices are not roaming seamlessly. But Apple devices and window devices roam perfectly. 1. Android device stuck at obtaining IP address (need to turn off the wifi and turn on back) 2. Need to turn on the wifi scan from developer mode. ( but this does not help completely and still disconnect in some points.) Also the setting disable once the device is rebooted.

Oh! P.S. Ubiquity UniFi WAPs do allow for true roaming using what they call Zero-Handoff. The premise is that it works the same as WiFi roaming from the point of view of how they connect to the device and how your device transitions from one WAP to another WAP. I’ve only read about this a couple months ago when I was considering purchasing them but I did not so I am unfamiliar with the details of how they accomplish this but I read good reviews that they do do it properly. I’ve also read that they can only do this after you upgrade the firmware but I don’t know if that’s still the case. It may be included in the models they sell now vs. then.

I’ve been struggling big time with this issue and have tried pretty much all the suggestions on this page. I’ve started with Fortinet WAP’s, which didn’t roam properly and now I have Ubiquiti UniFi UAP-LR’s with ZH enabled and I still have issues with VoIP calls disconnecting when I walk through the house. Is this just an unresolvable Android issue?

Hey Jet, I have a Ubiquiti network at home and it works great. First thing I tried was roaming with Skype and it worked great. Do you have a Ubiquiti controller running? As I understand it, zero hand off won’t work without a controller running all the time.

Joseph – all very interesting but doesn’t help answer my (and the OPs) issue that flitting between APs on our home network seems to work fine for Windows laptops but is problematic on Android phones. Why should it be any differen?. Interestingly I have no issues on my Samsung android tablet but do on my Harrier android phone and both have 5.0.2. Go figure! The phone report’s no internet connect frequently when I have moved to the other end of the house, and I have to manually reconnect, after which it works without any problems.

Agree with Simon BB to a degree. Joseph’s post is indeed very informative but equally unhelpful. I also noticed that, unlike Simon, despite my laptops and both my latest generation Android phones not “roaming”, my iPhones (4 and 4s) always seem to be able to switch seemlesly to the strongest WiFi signal. My home setup is a main WiFi router supplied by my ISP and aPowerline WiFi extender. Unless the iPhones have the extra bit of hardware which Joseph mentioned about, in which case his post makes perfect sense, there must be something else going on.

I agree – I guess it really depends on your exact definition of wireless roaming and I haven’t been able to find an authoritative one. What Joseph describes to me I would call WDS (or at a stretch, mesh) not Wifi Roaming which is the ability of the device to move from one wifi SSID to the other (hence roaming). For me, the “Always Allow Wifi Roaming Scans” tweak solved the issue and despite what Joseph says, this allows me to walk around with my phone jumping from one AP to another, keeping in the same IP address and with only a glitch in connectivity. The glitch to me is the only visible difference from a user perspective between this setup and a true mesh.

Thank you for this article, and also thanks to the participants in the insightful discussion. This has been bothering me for months and I’m glad to be on the track of a solution.

For what its worth, my now dead Nexus 5 navigated my 2 wifi router home configuration without having to reconnect most of the time, while the replacement Samsung S6 has had to always be told to switch. Both phones on Lolliop. Both routers using same ssid and pass phrase.

Question: If “Always allow wifi roaming” is enabled under Dev settings on Lollipop, will that affect battery use even when WIFI is disabled? Or does this feature recognize when the antenna is shut off, and stop scanning for roaming changes?

I know this thread is a little old, but wanted to share this point. With the Ubiquiti WAPS as mentioned before, they manage the whole fully meshed work for you, and if you walk around with your laptop, it will jump from one wap to another the way we expect it to. They are solid and I have in some locations 15-20 of them all meshed and they work great.

I do see that with Android, this isn’t the case, it does fall in love so to speak with the wap it connects to initially and doesn’t let go…. Have a tech trying the developer option now on site and it will probably resolve the roaming from the Android side.

MJ, Also note that only the old generation Ubiquiti WAPs do their proprietary Zero Latency Handoff. The newer range don’t. I have been trying to determine whether they do 801.11r and preauthorisation (which is the Standards based way to do roaming) but I have not yet got an answer. Steve

Well I didn’t bother me in any of the comments but I’m sure someone pointed out to whoever on this article which by the way it’s great article thank you very much, I just hold down the network that I don’t want being connected to anymore and then choose the option “forget network” and that does the trick right there it never automatically connects to any unwanted connections! 😀 Same here, re-entering the password s if ita NEVER been connected! Lolz BUT fair enough if I “forgot it” in the first place LOL 😅 thank you again I’ll be bookmarking and watching for new articles on this site!!