Justin Merrill, MBA, BS .:|:. Platform Engineer

Platform | DevOps | SRE | K8s | GitOps | IaC | CICD | Security | IAM | Cloud | Software | Data | APIs

Allwinner A10 / A13 / A31 PlatformAndroid OSDIY / Mods / RepairMobile DevicesNetworking

Android – Unable to Start Wi-Fi, Never Connects, Switches Off After a Few Seconds

DISCLAIMER: I’m only trying to help you out if you’re at your wits end, like I was, with this issue. I took a lot of risks, and this is a fairly risky procedure, as there are many variables that are hard to account for. That being said, USE THESE TIPS AT YOUR OWN RISK! I’m not liable or responsible for anything that goes wrong. I’m just trying to help in a last resort situation. DO NOT DO ANYTHING UNTIL YOU HAVE READ THROUGH THE ENTIRE POST so you know what you are getting into, and whether you feel comfortable enough to take these risks!!!

UPDATE: I’ve given up on this cheap little tablet as the overheating issues and slow performance were a SERIOUSLY FRUSTRATING user experience. At the very least though, I learned a great deal about flashing custom Android ROMs and modifying the Android operating system through the ABD interface. Don’t be shy about posting your own user experiences and issues or “magic tricks”. I’m curious what you discovered in your trials.

http://code.google.com/p/android/issues/detail?id=1124
Since this Issue Tracker board was probably the most specific help to my issue, I am going to post this very long winded and details walk through (more like stumble-through, really…) here before anywhere else. It will probably end up on my personal blog, but perhaps with a little more edits and less detail. You’re welcome. 🙂

After about 2 days of major issues with playing around with different things mentioned all over the web, and learning all kinds of new things about ROOTing and ROMs for Android… I finally was able to fix this issue with WiFi turning off just a few seconds after I switched it to on in the Settings menu.

This fix was probably the hardest hardware/software troubleshooting fix I’ve had since the years of Windows 95/98, and I have been building my own computers since 2000, and writing code for web sites/applications for 10+ years, collectively.

This fix may not be the answer to everyone’s issues that have posted in here, but I think the vast majority of you could benefit from the 3 days (straight) I’ve been trying to fix this issue. If anything, you may learn something that will lead you to your own answer or fix from this post. I know I certainly have learned a lot about Android OS and related devices…

I will assume that this fix should work for a phone as well as a tablet since most of you posting here are having phone problems that were (practically) the same as my “WiFi turning off” issues.

Thankfully, I have 2 identical tablets (yes, tablets, not phones) that I was able to use in order to get this figured out. (The ex girlfriend didn’t know what she was missing when she gave it back after the break up, lol.)

MAKE SURE YOU BACK UP YOUR WORKING (or mostly working) ROM .img FILES BEFORE YOU GO ANY FURTHER!!!

In fact, I recommend backing up all your Apps, Pictures, Contacts, etc etc with a the plethora of tools that do that kind of thing available on the web. Experiment with backups and restores at LEAST TWICE before you go any further!!! I recommend taking a “clean ROM Flash” system setup, and taking your back driver directory up from that “fresh install”.

You don’t want to go backwards in case something goes wrong!! I had a few issues where my USB sockets were getting loose and coming unplugged just enough to screw up my ROM flash during the process. I don’t even want to tell you what I had to go through to fix that, but it did involve shorting the soldering points of the tablet battery to wires for long enough to “hard reset” the device… not fun.)

I was able to play around with a lot of different ROM utilities and such, and I seriously doubt that I could have done any of this without root access.

Sidebar: You MIGHT be able to use Windows Command Prompt with the “ADB root” command in order to make it happen, but I had a Root-ed ROM that came “stock” with my tablet(s).

Be sure to have USB Debugging enabled on your tablet/phone when you plug in through USB cable. It’s a pretty good idea to download the latest Android SDK Tools as well, as it came in handy probably more than anything else, though its not completely necessary so long as you have the Android Debugging Bridge (ADB) drivers installed to your PC/MAC.

http://developer.android.com/tools/sdk/tools-notes.html

What FINALLY worked for me, was using the “ADB logcat” command from the Windows Command Prompt (aka DOS prompt) and figuring out which directory my Wifi drivers were located in. Mine happened to be in a rather obscure directory: /system/vendor/modules but you will most likely be looking for a directory (aka folder) with quite a few files with a *.ko file extension, and you will likely find at least one file in there with *nvram* in the file name with a *.txt file extension, but every file system seems to be different. Use common sense and I’m sure you will be able to located these.

Once I found where the drivers were, I used root level access in the ADB command prompt (DOS = Start-> Run -> cmd.exe), the Android SDK Tools AND ALSO with 2 different apps. They all seem to have their strengths and weaknesses (but I admit this is probably overkill). The apps are for ROOTED devices, but they may or may not help you out if you’re not rooted already:
1) SManager ads – https://play.google.com/store/apps/details?id=os.tools.scriptmanager&hl=en
2) Root Browser Lite – https://play.google.com/store/apps/details?id=com.jrummy.root.browserfree&hl=en

(Obviously you are going to have a tough time getting these apps to your phone or tablet if you’re not online, so Google Search for the *.apk files and transfer them via USB, or use your PCs internet connection through “USB Ethernet”. There is also the option to put these onto an SD card with some adapters.)

I tried a few things to change the permissions of the ENTIRE directory. You can either use the Properties feature in the 2 apps I’ve mentioned above, which you will basically be setting all 9 checkboxes to “checked”, (there is actually 12, but the other 3 are sometimes a PITA to get set; but I just kept trying over and over again until it worked… sometimes…) which is the equivalent of setting chmod to 777 (or 7777 if you can get all 12).

These last steps are the part that took a lot of trial and error. I *think* the permissions to the driver files are not easily changed on the first (or even 5th…) try because they are in use, and need to be released.

The best way I was able to set the permissions to “wide open” (Read + Write + Execute) was through the ADB command prompt. I’m not going to go into gorey detail here about how to use a Linux-style BASH command line, but if you use ‘LS’ and ‘CD’ to change directories, and maybe read a tutorial or two on using ADB Command Line Tools, you should be able to figure it out fairly quickly. You don’t need to master it, just use it enough to get it done.

You are going to want to save the directory with all the files in it that you found to be the place where your device drivers are. To make it easy, put it in C:backup_driversmodules
[[My directory with the drivers was called “modules”, but make sure you name yours EXACTLY the same name as your drivers directory to make this easier.

I recommend doing all this from a FRESH REBOOT, and leaving the tablet in “Sleep Mode”. I was able to get both tablets (and my Android phone for that matter) to recognize in the Windows Command Prompt for the ADB Tools while they were “dark and sleepy”, you should too. If not, check some setting on the phone/tablet until you can.

Now… for the risky part.

This is my best attempt at an example of what the process looks like from the command prompt (You will have to replace directory and file names to suit your situation! The double bracket [[ ]] stuff is my comments that won’t show up IRL):

C:>adb help all

[[ blah blah blah goes here – read it for more details on all the features!! ]]

C:>adb devices
C:>adb shell

[[activates the ADB Shell Tools!]]

user123@android:/ $ su
su

[[This grants “SuperUser access – notice the $ changes to # in the next prompt – that’s how you know you’re “ROOT” User]]

root@android:/ # chmod 7777 /system/vendor/modules/
chmod 7777 /system/vendor/modules/
[[ You may get an error of some sort here. if you do, try the same command with only 777 – Three 7’s instead of Four!]]

——————-
Ok… now you are at a crossroads. What I suggest, is running through these last few steps BEFORE you power down and reboot your device. If it works, GREAT! You’re done!

If it DOESN’T work the first try, you *COULD* grow a pair, take the risk, and and reboot RIGHT after you delete the drivers directory, BEFORE you restore the backup driver files. This will allow your system settings to refresh, and clear up whatever gunk there is that’s keeping your wifi from working properly.
——————-

root@android:/ # rmdir /system/vendor/modules/
rmdir /system/vendor/modules/

[[ this “removes directory” of all your drivers and files in this directory/folder!!! I HOPE YOU BACKED UP YOUR ROM & FILES! ]]

root@android:/ # exit
exit
root@android:/ # exit
exit

[[ Yes it’s flakey like that and doesn’t always exit the ADB shell on the 1st or 2nd try. ]] [[keep giving the ‘exit’ command until you see the C:> Windows/DOS prompt again. ]]

——————————-
I suggest you Try This Next Step first, if it doesn’t work, then try this order:
0) MAKE SURE YOU HAVE BACKED UP YOUR STUFF!!! I can’t stress it enough.

1) Delete the driver files, again but…

2) If it didn’t work the first try:
The 2nd (or 3rd?) time before you “PUSH” as described below…
REBOOT your Android, BEFORE you proceed to the next step ONLY IF WIFI STILL DOESN’T WORK!
——————————-

[[Now… “push” the directory that you backed up these files in to the Android Device]]

C:>adb push C:backup_driversmodules /system/vendor/modules

push: C:backup_drivers/modules/-586105826.jpg -> /system/vendor/modules/-586105826.jpg
push: C:backup_drivers/modules/wpa_supplicant.conf -> /system/vendor/modules/wpa_supplicant.conf
push: C:backup_drivers/modules/ipconfig.txt -> /system/vendor/modules/ipconfig.txt
push: C:backup_drivers/modules/softap.conf -> /system/vendor/modules/driver123.ko
… … … [[ There should be a bunch of similar files pushed! ]] … … …
push: C:backup_drivers/modules/entropy.bin -> /system/vendor/modules/driver321.ko
push: C:backup_drivers/modules/-1124283187.jpg -> /system/vendor/modules/bcm4330_nvram.txt
20 files pushed. 0 files skipped.
7 KB/s (3911 bytes in 0.387s)

—————————————————–
Once all these steps are complete, you will want to reboot your device

#Directory of Wifi configuration file
/data/misc/wifi/wpa_supplicant.conf
#———————————————–
ctrl_interface=wlan0
update_config=1
device_type=0-00000000-0

#OPEN NETWORK – NO SECURITY – FOR TESTING ONLY!
network={
ssid=”FBI_Surveillance_Hub_33705″
key_mgmt=NONE
#NO PASSWORD!
priority=23
}

#WEP NETWORK
network={
ssid=”DEXTER_MORGAN”
key_mgmt=NONE
auth_alg=OPEN SHARED
wep_key0=”MiamiFlorida”
#PASSWORD: MiamiFlorida
priority=22
}

#WPA NETWORK
network={
ssid=”TMNT_POWER”
psk=9822c7e060047939702db5156f79bc7452dda94b5d7dc0eb7e55a5e57f7972fc
key_mgmt=WPA-PSK
#PASSWORD: GoNinjaGoNinjaGo!
priority=24
}
#—————————————–

 

Obviously this isn’t an end-all to everyone’s problems but at the very least it might get things mostly functional again.

UPDATE: I’ve given up on this cheap little tablet as the overheating issues and slow performance were a SERIOUSLY FRUSTRATING user experience. At the very least though, I learned a great deal about flashing custom Android ROMs and modifying the Android operating system through the ABD interface. Don’t be shy about posting your own user experiences and issues or “magic tricks”. I’m curious what you discovered in your trials.

j-merrill

Justin Merrill, MBA, BS .:|:. Platform Engineer Engineer | Software | DevOps | CICD | Cloud | Security | IAM | SRE | K8s | GitOps | IaC | Data | APIs | Platform

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.