after a recent crash both in software and hardware terms, my nexus 5 running android lollipop 5.0.1 could no longer activate wifi. when touching the toggle, it would just show “wifi turning on”, but it never got around to actually scanning for wifi networks or even displaying its mac address.
after quite some online research i tried toggling aeroplane mode, deleting /data/misc/wifi (root), doing a factory reset, upgrading to the newest android version (lollipop 5.1.1), flashing other ROMs and kernels, etc. but nothing seemed to work.
since there was also a physical drop involved, i opened the N5 to check if there was anything noticeable in the internals, e.g. the wifi antenna connector being loose, but nothing was obvious. there were also several reports of google replacing wifi-faulty nexus 5 handsets under warranty due to a “hardware” or “motherboard” issue, but i wasn’t quite ready to give up yet.
then i found this post, which detailed how a user just had to manually correct the mac-address in /persist/wifi/.macaddr in order to get it working again. it didn’t work for me, but after lots of toying around with other ideas, i finally just went ahead, opened root explorer, and deleted the entire /persist/wifi folder and rebooted the phone.
lo and behold, wifi is now working again like nothing ever happened.
maybe this will help somebody else in a similar situation?