How to connect to Ad Hoc networks using Tmobile G1 Android


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.


edit tiwlan.ini to read:

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

edit wpa_supplicant.conf to read:

ap_scan=2 (tells wpa_supplicant to scan hidden networks)

scan_ssid=1 (for APs with multiple SSIDS)
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


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

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

reboot device.


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.

Sponsored by

31 thoughts on “How to connect to Ad Hoc networks using Tmobile G1 Android”

  1. If you found this from my tutorial then you should have mentioned me in this post so people know who found this solution first.
    Good thing you mentioned how to edit files using ADB and another good thing is this ap_scan=2 thing which i totally forget to mention in my post.

  2. Great tutorial. I have the following problem on a G1 with modded Rogers rom . I connect to the created network but I don’t have an actual internet connection. I tried all the troubleshooting steps and disabled firewalls on PC but browser and other apps say they don’t have internet connection. WiFi is connected full bars and so on. Can’t really see what’s the problem…

  3. Could you please upload the modded files so we could just use them? Not sure where to enter the commands and doing a search doesnt find “dot11DesiredSSID = HydtechAdhoc (or whatever name u want)”. Thanks

  4. hey I’m so glad to find a website here.
    My problem is, can I make share my VPN connection as an adhoc connection? if so, how can I do this?

  5. Hi,
    I did the exactly steps you stated on my G2 magic, but it doesn’t work.
    the SSID was showed but my G2 can not search out my IBM T60’s signal.

    Pls give some help. thanks in advance.

  6. Hi
    At start – sory for my english , i speak not good.
    Me and my friend have the same problem.
    I have HTC Hero and laptop (he have G1 and laptop)
    At first day this method (editing these two files) works perfectly.
    Next day when i turn on wi-fi in my HTC Hero… big problem.
    On phone I see my ad-hoc network on list but it still OUT OF RANGE.
    I try STATIC IP and nothing work.
    Other my phones (Nokia – Symbian) dont have any problem to connect to laptop.
    Any solutions ?
    Thanks 😉

    This is my wpa_supplicant.conf file:



    And this is tiwlan0.ini (not full of course):
    WiFiAdhoc = 1
    dot11DesiredSSID = SIEC
    dot11DesiredBSSType = 0

  7. you have to reedit the file to include ap_scan=2 sometimes the wpa_supplicant gets reset. I am currently trying to figure out how to fix this.

  8. thanks to the members from xda-developers who discovered the adhoc tether and especially to chax for his efforts.

  9. Hi,
    Is it possible to have an infrastructure mode instead of ad-hoc mode? How hard can it be to develop something like that?

  10. I continually rea blogs in similar issue, but I never visited your blog. bookmarked and i’ll be your constant reader. Thanks

  11. […] is another must see source of tips. Yeah Imagine getting paid for giving your opinion ! […]

  12. Pingback: Anonymous
  13. Fantastic site you have here but I was wanting to know if you knew of any forums that cover the same topics talked about in this article? I’d really like to be a part of community where I can get feedback from other knowledgeable individuals that share the same interest. If you have any suggestions, please let me know. Thanks a lot!

  14. Obviously, what a wonderful web site and informative posts, I’ll add backlink – bookmark this internet site? Regards,

  15. Bertrand Russell~ Man needs for his happiness not only the satisfaction of this or that but hope and enterprise and alter.

  16. Hey .I am using Galaxy S. Tried to follow the process fully, 3 4 times… but everytime the phone becomes unbootable and stucks in the samsung logo. then i had to reflash the firmware. Has anyone ever faced such a problem?

  17. It has been working the very first time on Galaxy S – i9003…. I was surprised and happy.
    But after disable the wifi and enable it again, I cannot connect because out-of-range, remembered.
    I have doubled checked and the configuration files are well, without modifications.
    Some Ideas (please respond to e-mail aswell, because I do not have enought time to review the website)

  18. Hi.
    I need help.
    I have Herotab C8 and I want connect it via Nokia N82 using JokuSpot Premium
    What i do wrong:
    1. I copy (using root_explorer) the wpa_supplicant.conf from system/etc/wifi – (I haven’t it in /data/misc/wifi/ like you) on sd card
    2. edit it:

    ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi


    network={ ssid=”JoikuSpot_00226674F6B2″ – I tried droidhoc here too. 🙁
    aut_alg=OPEN SHARED
    priority =99
    mode=1 }

    3. copy it back
    4. restart tablet
    5. install Hydtech’s adhoc wifi and turn it on …..
    6. turn on wifi … and …. nothing.

    What’s wrong?
    (I’m apologize for my English)

  19. Using SkySafari pro on Sprint EVO 4g Lte android (no 4g here in Sedona AZ) and the google nexus 7 android tablet.
    Will these same configurations work on a rooted google nexus 7 android tablet?
    Also, your website mentions “you can join both SkyFi and your Android device to an infrastructure WiFi network, such as provided by a typical home router – but then you’ll need to carry that router with you, and find a way to power it, when you go to your remote observing site.”
    Is there a recommended travel router that has been tested and known to connect android devices to SkyFi?

Comments are closed.