Android Ad-hoc support hack/wpa_supplicant

krohn

Member
Oct 4, 2009
6
0
0
just got this working on evo 4g

used a3e00f284ddff04804ba8d59364712b1 wpa_adhoc-signed.zip (v0.5.11)

used ra recovery to flash zip.

clock work 3.0 blocks due to deleted file to get to newer version. doesnt let you edify or script

had to turn on wifi, and set up manualy a static ip and all the rest of that stuff. i mimicked a comcast router setup.

ip 10.0.0.9
gate way 10.0.0.1
net mask 255.255.255.0
dns 1 75.75.75.75
dns 2 75.75.76.76

start ad hoc on computer.

once i hit menu and save. said connected. not obtaining ip address.

then on my pc i bridged my lan connection to my linksys AE1000 wifi reciever dongle thing.

fyi, WEP will connect also , but the other security WPA2 doesn't connect

and bam, i get ad hoc shared internet on my evo 4g. small write up for some one to follow.

thanks much guys. :highfive:
 

HEXcube

Senior Member
Aug 18, 2012
118
48
58
hexcube.github.io
Edit wpa_supplicant.conf instead of wpa_supplicant

I changed data/misc/wifi/wpa_supplicant.conf instead of /system/bin/wpa_supplicant.
Step1:First i scanned my adhoc network using Wifi Manager. It shows adhoc networks. I ignored it's warning and tried to connect. It'll fail.No problem! We now have the adhoc network listed in wpa_supplicant.conf.
Note: you can skip this step if you know how to edit wpa_supplicant.conf manually or if your device already lists adhoc networks on scanning.
Step2: You'll need to root your device if you're doing this through your device itself. If you use adb you may not need to root your device.(I had root access by default through adb. So rooting the device wasn't necessary for me). If you're using pc(windows or linux), i recommend Android Commander. If you're doing this from device itself, use some Root Explorer and Terminal Emulator.
Pull and/or edit data/misc/wifi/wpa_supplicant.conf. Add the following line
ap_scan=2
Find line like
network={
ssid="your adhoc name"
bssid=*some value*
.
.
}
Delete bssid line.
Add/Change the following
scan_ssid=1
priority=1
mode=1

Push back/save the modified file.
chown ownership back to system.wifi. Type the following in adb/Terminal Emulator
#chown system.wifi data/misc/wifi/wpa_supplicant.conf
Ok, done! Now you can turn on wifi and if the specified adhoc network is nearby, your device'll automatically connect to it. Don't scan for new networks. If you do, adhoc support will be lost and you'll have to start over again!
Advantage: Safer than modifying system/etc/wifi/wpa_supplicant binary. Saves you the trouble of compiling modified wpa_supplicant or finding a compiled one for your platform.
Drawback: This is just a temporary solution.You'll have to repeat this process for every new adhoc network as it doesn't enable adhoc forever. It is good for connecting to your home network or other known networks, but if you want to connect to any adhoc network you scan,then this is not your method. Because, wpa_supplicant.conf will be overwritten every time you scan a new network.
For more details refer to
http://forum.xda-developers.com/showthread.php?t=1591207
 

blade_h

Senior Member
Mar 18, 2012
81
5
38
Thanks This work great!!....also can someone give me name or link for some WiFi tethering ...so to be able to share my 3G try Wifi to my friends
I try few from market bt no one work correct
Thanks
 

HEXcube

Senior Member
Aug 18, 2012
118
48
58
hexcube.github.io
To which network did you try to Connect?

Hi babai,
to which Adhoc network did you try to connect? One from Windows XP/Vista, Linux or Nokia Joikuspot?
Maybe, it's due to Android 4.2 Jelly Bean. It has new features like WiFi Direct which is a replacement for Adhoc WiFi. This may have changed something in the wireless framework. I'm not sure though. Can you see the Adhoc network on Wifi Manager?
 

babai93

Senior Member
Feb 5, 2010
193
124
0
38
Sambalpur
Hi babai,
to which Adhoc network did you try to connect? One from Windows XP/Vista, Linux or Nokia Joikuspot?
Maybe, it's due to Android 4.2 Jelly Bean. It has new features like WiFi Direct which is a replacement for Adhoc WiFi. This may have changed something in the wireless framework. I'm not sure though. Can you see the Adhoc network on Wifi Manager?
I am using HCT Touch 3G (Windows 6.5 Phone) to share internet over Wifi over WMWifiRouter.
My Laptop can access but my Android mobile are not accessing the WIFI Access Points.

I need a solution to Share the same for all the device. or a good application for my windows mobile
 

babai93

Senior Member
Feb 5, 2010
193
124
0
38
Sambalpur
its included in the android sdk toolchain.



Can all the people which had problems, check the version of wpa_supplicant their rom is using? connectbot or via adb in cmd.exe/shell (adb shell wpa_supplicant -v) and post the output?.

It seems like some newer roms are using wpa_supplicant v6 with different libs.

You can try to use the precompiled wpa_supplicant from daveba http://forum.xda-developers.com/showpost.php?p=7711198&postcount=6

our flash the attached signed update zip. (its the same file)

Attention: its not my file!!

Hi,, I am running JB 4.2.1 on my SGS, can u please share wpa_supplicant for the same?
 

Robotriper

New member
Jul 18, 2017
1
0
0
Stuck on step 2, help!

@HEXcube Im trying this out on my Samsung galaxy core 2 (sm g355m running android 4.4.2, wpa_supplicant v2.1).

I'm trying to use this phone as a MIDI controller for a DAW using Touch OSC app, but I need to connect to my ad-hoc network from my macbook so I can send MIDI messages from Touch OSC app to my macbook via WIFI, so I don't really need internet at all, I just need the phone to send the MIDI data through the network.
I've managed to open the .conf file and I can clearly see my ad-hoc network listed in there but I just see this lines of text:

network={
ssid="MIDI Link!!"
key_mgmt=NONE
group=WEP104 WEP 40
auth_alg=OPEN SHARED
wep_key0="monas"
priority=4
autojoin=1
usable_internet=0
skip_internet _check=0

{

I dont understand where is it that I need to write the "ap_scan=2" command line, also I dont see the "BSSID" anywhere (not even on my regular wifi networks).

So, do I have to just add/change the following?:

scan_ssid=1
priority=1
mode=1

And where do I write the "ap_scan=2" line?

I hope you can help me out, I just want to use this phone (or any android phone) for this purpose.

Thanks!
 
Last edited:

HEXcube

Senior Member
Aug 18, 2012
118
48
58
hexcube.github.io
Been a long time since I tried this!

Hi @Robotriper :)

It's been a long time since I did this, I don't even remember running an AdHoc hotspot, lol! :laugh: Anyway, I think one of my old posts might help u: Link to "How to connect to an Ad-Hoc (IBSS) network?"

However, it's a very old method, so I'm not sure if it's even working now. My suggestion'd be to try running a proper Access Point mode mobile Hotspot from your fone or notebook. Most relatively new Android fones have a Portable Hotspot/Tethering option in their settings.