Connecting Android Phone Through Adhoc Wifi Network
An Android phone works perfectly when you have a wireless connection, either through wifi wireless AP or mobile network GPRS. However, when it comes to places where only wired connectivity is available, for instance an Ethernet connection or a dial-up connection, or when you're roaming and using mobile network's data roaming might cost you a fortune, some workaround must be done.
My HTC Magic works fine back at home. I got both unlimited wifi and GPRS connectivities. But when I roam elsewhere, which I do a lot, the data roaming cost would be too high and most hotels I stay have no wifi but only wired Ethernet in-room.
One thing which I know will work is to carry with you a wireless AP, plug the LAN cable in, and you're all set. But I don't want to add any more weight to my bags. So I think about turning the laptop into an access point instead.
So I did some searches and found a very useful information at modmygphone.com's forum. The thread mentioned configuring your G1 Android phone to connect to a laptop's ad-hoc wireless network. That's exactly what I need!
I didn't modify the files directly on the phone, but instead I used adb pull the 2 files onto my laptop, then edited the files, then adb push them back. So the steps were:
> adb pull /system/etc/wifi/tiwlan.ini tiwlan.iniYou will see your ad-hoc wifi network name in networks list (Settings -> Wireless controls -> Wi-Fi settings). Phone modification part is complete.
> adb pull /data/misc/wifi/wpa_supplicant.conf wpa_supplicant.conf
[.edit tiwlan.ini and wpa_supplicant.conf according to the guide]
> adb shell
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# exit
> adb push tiwlan.ini /system/etc/wifi/tiwlan.ini
> adb push wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf
> adb shell
# mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
# exit
>
Now back to the laptop. An ad-hoc wireless connection has to be created and Internet Connection Sharing enabled. There are many guides available on the Internet. (for example here.) When it's created, in "Choose a wireless network" window, select your ad-hoc network and click "Connect." Your phone and laptop should try to connect to each other and you're all done!

In case you're unlucky and your hotel network assigns IP address in 192.168.0.0 net, ICS will not work. Try create a network bridge between the wireless connection and LAN connection instead.
Have fun with your Android! ;-)




10 comments:
it's working only on rooted phones
Thank you man, you made my day, it worked like a charm, once again, thank you
Perfect, it's working on HTC Hero, too. I faced only two problems.
First I needed to run chmod 666 tiwlan.ini before I was able to pull it on computer.
Second problem was with wpa_supplicant.conf file. I chmoded it too, but still not able to pull it. So I run adb shell and then su. I copied file on sdcard and then adb-pulled from sdcard to computer. After I updated file and pushed it back to sdcard, it had to be copied back to proper location.
Don't forget to chmod it back to original values. You can see original access rights if you run ls -l command, before you chmod it for the first time.
Hi, I have tried the method and the ad hoc network worked perfectly. Thanks lots for that! But my problem now is that even when the ad hoc network is connected and Internet Sharing is enabled in Vista, the browser in my android is still refusing to connect to internet. Any suggestion as to what could have gone wrong? I have an HTC Magic and a laptop running Windows Vista
北落师门: I'm not sure how Vista net sharing works. But it should be similar to that of XP. Can you try a traceroute from your Android to see whether the connection really works?
@北落师门: if I were you, I would check firewall settings, it helped me with other connection problem.
Can't get it to work because:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mount: Operation not permitted
Probably this instructions valid for rooted phones
Hi there,
I'm trying to use ADB to edit these files in order to get an ad-hoc connection, but I'm stuck because I can not install the drivers for my phone.
I have a HTC MyTouch 3G rooted phone (Cyanogen 4.2.6) and I've already downloaded the drivers from the SDK official page, but I just can't work it out. Did you have a trouble like this? I'm thinking maybe I don't need to install drivers at all, or maybe it's not possible to install those driver in my case, any clue?
Thanks in advance
Racheado,
You can follow the instructions at http://modmygphone.com/forums/showthread.php?t=22681
Между прочим, лучший способ обезопасить кого-нибудь от назойливых телефонных звонков - включить Подавители связи
Post a Comment