Posts Tagged ‘wpa_supplicant.conf’

ad-hoc network on my Styleflying GPAD G10

Wednesday, November 24th, 2010

To get this working, you will first have to root your styleflying android tablet.

This tablet is not like other android devices which are easily connected to adhoc by editing the tiwlan.ini and wpa_suplicant.conf. In fact, there is no tiwlan file on the device. We will have to use an alternate method, however, we will still be patching our wpa_supplicant.

The first step is to make an adhoc connection from your phone, laptop or desktop and name the ssid as ‘droidhoc’ and make sure you do not use a WEP key (it causes unnecessary problems). Set your ip address to static and use 192.168.0.1 (or you can use dhcp, but sometimes this causes problems). If you set static, then make sure you use a static IP, like 192.168.0.2, on your device under advanced settings. Set the mask to 255.255.255.0 and dns to 192.168.0.1.

The next step is to connect the gpad with adb and I will assume you know how to do that.

now we will type the following:

su (for superuser mode)
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system (mount partition as writable)
cp /data/misc/wifi/wpa_supplicant.conf /sdcard/ (copy configuration file to sdcard)
exit (to exit out of adb)
adb pull /sdcard/wpa_supplicant.conf / (pull the file off the sdcard to edit it)

Now edit the file with your text editor and enter the following after the line ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=system:

eapol_version=2
update_config=1
ap_scan=2

network={
ssid="droidhoc"
scan_ssid=1
key_mgmt=NONE
group=WEP104
auth_alg=OPEN SHARED
priority=99
mode=1
}

Place the wpa_supp file back and change owner, permissions and reboot:
adb push /wpa_supplicant.conf /sdcard/wpanew.conf
adb shell
su
cp /sdcard/wpanew.conf /data/misc/wifi/wpa_supplicant.conf
cd /data/misc/wifi
chown wifi.wifi wpa_supplicant.conf
chmod 777 wpa_supplicant.conf
reboot

Once your phone is rebooted, we will download the HydTech’s adhoc wifi app from the market and run it.(app costs only $1.99)

Enjoy your new adhoc connection!

Popularity: 52% [?]

How to connect to Ad Hoc networks using Tmobile G1 Android

Monday, September 14th, 2009

Intro

The G1 does not connect to ad hoc networks through the wifi manager but we can hack it to allow scanning and connecting to ad hocs. I’ve been trying to figure this out for the longest time. Before you begin, you need to root your G1 and be comfortable using the command line. We will be editing tiwlan.ini and wpa_supplicant.conf. I will be showing you 2 ways to edit the files. Using vi and adb.


Settings

edit tiwlan.ini to read:

WiFiAdHoc = 1
dot11DesiredSSID = HydtechAdhoc (or whatever name u want)
dot11DesiredBSSType = 0

edit wpa_supplicant.conf to read:

ctrl_interface=tiwlan0
update_config=1
eapol_version=1
ap_scan=2 (tells wpa_supplicant to scan hidden networks)

network={
ssid=”HydtechAdhoc”
scan_ssid=1 (for APs with multiple SSIDS)
mode=1
key_mgmt=NONE
group=WEP104
auth_alg=SHARED
wep_key0=”MyWepKey” (replace MyWepKey with your key)
}

How to edit using vi:

Download terminal from the market and type:

su (for superuser mode)
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system (mount partition as writable)
vi /system/etc/wifi/tiwlan.ini (open tiwlan.ini in vi text editor)

now type A to enter editing mode, finish editing your file and hold trackball+1 to stop editing. To save and exit type :wq

vi /data/misc/wifi/wpa_supplicant.conf (open file for editing)

edit with the settings given above and exit and don’t forget to change the partition back to read only
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system

reboot

How to edit files with adb on Ubuntu:

Connect your g1 to the computer using a usb cable and make sure USB debugging in enabled
Open up terminal and type
cd /home/hydtech/[android sdk folder]/tools (navigate to the directory which has you adb tool)

get the files from the device and place them in the root folder
sudo ./adb pull /system/etc/wifi/tiwlan.ini /
sudo ./adb pull /data/misc/wifi/wpa_supplicant.conf /

edit and save the files with the settings provided above using gedit or kate or what have you

make the partition read writable
adb shell
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
exit

place the files back onto the device
sudo ./adb push /tiwlan.ini /system/etc/wifi/tiwlan.ini
sudo ./adb push /wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf

make partition read only again
adb shell
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
exit

reboot device.

Troubleshooting

shows connected but no internet
1. I was having a problem where the connection would keep disconnecting and when it would connect, it wouldn’t load pages. To fix this I had to disable my WEP key.

SSID not showing
2. If the SSID isn’t showing up in the list, make sure you have ap_scan=2 in your wpa_supplicant

Unsuccessful connection
3. Try enabling static IP if DHCP isn’t working for you. It’s under advanced menu.

Popularity: 100% [?]