[Nexus 5 Q&A, Help & Troubleshooting] jpsflores:
Possible fix

Hello all!

I registered here so that i could share a possible solution to the stuck wifi problem. On my nexus the BT was also stuck most of the time.

Been having the problem for about two weeks and was about to do a clean install and, if the problem persisted, call Google support. Thing is, I had the feelling it was software related and that the hardware was ok.

I´m not sure if BT, Wifi and NFC use the same hardware but the fact was that wifi worked for a few days, BT for a few more and NFC was always functional.

I did some extensive research thru the web and it seemed that this problem was not nexus unique and seemed to be related with wpa_supplicant.conf or wpa_supplicant in the bin file.

On this page, mind you the text is pretty old and not entirely android related:

http:_//_blog.linuxconsulting.ro_/2010/04/porting-wifi-drivers-to-android._html (I can't post links yet so just copy past and remove spacing)

I found this little snippet that caught my attention:

Seems that you can add ap_scan=1 to your wpa_supplicant.conf depending on the drivers you have.

After some more research on the subject of ap_scan i found that:

It seems that addind ap_scan=1 imposes that wpa_supplicant.conf handles the scanning and AP selection. IF there's something wrong with the driver, and not with wpa_supplicant as i originaly thought, this could bypass the problem.

So I added ap_scan=1 just before the device identification lines in wpa_supplicant.conf, reeboted, and now the wifi and bluetooth toggle normaly. I've tried ap_scan=0 (the driver handles the scanning) and the problem returns, so ap_scan=1 does allow you to toggle the wifi and BT on.

I can't yet verify that the phone actually connects to a wireless network and has the same stability and range as before as I'm at work and there's no wireless here.

Therefore I ask for your help to verify this "fix" and thoughts on this.

Sorry if the post is a mess. Both english and programming aren´t my native languages...

My device is a Nexus 5 with stock 4.4.4 KitKat and root.

Greets.

---------- Post added at 10:29 AM ---------- Previous post was at 09:46 AM ----------

So, quick update:

Managed to find an wireless network around and connected to it. Some time later, no sure how much, the phone rebooted.

Some time after that the wifi and Bt were stuck again. Accessed wpa_supplicant.conf and deleted the new wireless network information. Rebooted and all was functional again.

Seems the fix is incomplete as any rewrite of the wpa_supplicant.conf reinduces the initial problematic behaviour...

____________________ Extra Update_______________________

Ok, so it seems that the wpa_supplicant.conf is suposed to have ap_scan=1 by default.

After boot and when I connect to a wifi network my file resets and shows without ap_scan=1 and instead of:

ctrl_interface=wlan0

its

ctrl_interface=data/misc/wifi/sockets

Wifi with a conf. like this never works. If I manualy "correct" the file and reboot, the wifi toogles on, but after a wifi connect gets busted up again.

by now I've done:

- copy wpa_supplicant (the bin file) from a stock 4.4.4

- Check file permissions for all wpa_supplicant files

- dirty flash the stock build (it's my original build so less harm done i guess)

- 2 Clean installs

- 6 factory resets

And the problem persists.

I've called google support and they are sending a new phone as we speak. Now I'm not sure if it's a software or hardware problem (maybe a combination of the two?) but I figured it would be better to reroll a device instead of trying to fix this one as this problem is cleary out of my league.

Thank you all!