Android Tablets Forum banner

Adhoc Solution(ish) (need some help)

9K views 38 replies 15 participants last post by  dctab 
#1 ·
I managed to get my PDN to connect to my adhoc wifi network from my iPhone. However, if I connect to a different network access point (my home network), the adhoc no longer works once the PDN network settings "remember" the second network. Here is how I did it:1) Pull the wpa_supplicant.conf from "/data/misc/wifi/wpa_supplicant.conf"2) Edit wpa_supplicant.conf in WordPad to look like this:ctrl_interface=data/system/wpa_supplicantupdate_config=1eapol_version=2ap_scan=2fast_reauth=1WiFiAdHoc=1network={ ssid="Network Name" key_mgmt=NONE mode=1}3) push the wpa_supplicant.conf back to "/data/misc/wifi/wpa_supplicant.conf"I have tried using chmod to prevent android from editing the file to remember new networks, but that prevents wifi from turning on.Pretty much, I can get the adhoc network to work, but I cannot connect to any other network after that for fear of losing the adhoc and having to repeat the steps above.Can anyone figure ourt how to make this permanent.
 
Discussion starter · #5 ·
I was thinking the same thing. Basically, all it needs is a simple program that, when you want to connect to adhoc, you execute and it will copy the fixed file over the standard file. You would have to run it everytime you want an adhoc after using a standard AP, but it is a decent fix. Unfortunately, I have no idea how to write a program like that. Any help would be appreciated.
 
Discussion starter · #13 ·
Okay, I think I might have a solution.I will put the fixed wpa_supplicant.conf file in the /data/misc/wifi folder and name it wpa_supplicant.conf.fixed alongside the standard wpa_supplicant.conf file.Then, using GScript Lite, I created a script that when executed will delete the standard conf and copy the fixed conf in place of the removed standard. This way, after connecting to a standard AP and losing the ability to use adhoc, I only need to run the script and the PDN is ready for adhoc. The script will look like this:cd /data/misc/wifirm wpa_supplicant.confcat wpa_supplicant.conf.fix &gt wpasupplicant.confI will try this once I am home from work and let you know how it goes.
 
Discussion starter · #15 ·
The wpa_supplicant.conf is in /data/misc/wifi. I think the one in the /system tree is purely a template as I have tried messing with it to no avail. Switching back to standrad APs is not an sisue. I can be hooked to the adhoc and the connect to an AP, but not the other way around. But I think that having the ability to switch back and forth would be great as well, just in case there is a problem. If you can make an apk that will do that on the fly that would be great. Also, I think you might have to turn off wifi when switching to the adhoc config then turn it back on in order for it to work. Not really sure about that yet.
 
Discussion starter · #34 ·
It may be hardcoded into the .conf.adhoc, but all you need to do is edit (notepad) that file and change the ssid to whatever your network is named before loading it to your PDN.
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top