Thursday, August 11, 2011

Connect to adhoc Wireless Networks on your Galaxy S2 (SC-02C)

The usual warnings apply: We are not responsible for any broken or bricked devices. Use this guide at your own risk. However this worked for me on my SC-02C so it should work for you too. This is actually very easy but you need to make sure you have the proper tools first.

On most laptops when you share you LAN connection via wireless create an "adhoc" wireless network unless you are lucky and have a wireless card that does "infrastructure mode". Normally this is not a problem but Android does not support it by default.

In order to enable enable it you need to replace the file in /system/bin/wpa_supplicant with a version that supports it. Also you need to have root. If you do not yet have root follow my guide here.

This guide comes via SilverW1ndy (J).

Download this version of wpa_supplicant

This method uses "Root Explorer" which is a paid app but if you want to use the free way you can use the  Terminal Emulator method mentioned here.
  • use "root explorer" to mount /system/bin/ and make a backup of wpa_supplicant
  • rename the current one to wpa_supplicant.bak and copy the new wpa_supplicant to /system/bin
  • then we need to adjust the permissions on the file to match this picture
  • change /system/bin back to read only
  • disable and re-enable wireless
  • now your adhoc wireless network should be listed with the other wireless networks and you can connect.


39 comments:

  1. So, have you looked for the original XDA thread? I wonder if a similar thing is doable with other handsets. It's not like the radio and vendor specific, right?

    ReplyDelete
  2. I haven't I will have to check. I wouldn't think it I'd phone specific. Why don't you test it on yours? It is pretty easy to roll back the change.

    ReplyDelete
  3. Is there any way to fix this problem without having to root?

    ReplyDelete
  4. No unfortunately since you are replacing system files that are normally read only you need to have root.

    ReplyDelete
  5. Thanks, this guide worked for me. I can now use N-speeds instead of the G speeds of my router. When friends new to Japan ask about cell phone info, I always send them here!

    On a side note, I washed my Galaxy S II less than 3 hours after I confirmed it working. Let's see if it lights up after it dries out :( I did that to my n97 a few years ago, and it worked after replacing the battery. Now to find a spare asc29029 battery to test it.

    ReplyDelete
  6. I heard sticking it in a bowl of dry rice really helps dry phones out when they get wet. Just make sure it is dry before testing it. Good luck!

    ReplyDelete
  7. ya i can view adhoc networks but it stops at obtaining ip adress and says disconnected

    ReplyDelete
  8. Hmm you might need to check the setting on the computer you are trying to connect to. What type of machine are you trying to share your connection from? If that machine isn't configured properly to give out DHCP addresses that could be the problem.

    ReplyDelete
  9. WOW.. Its work for me..
    Many many Thanx bro...after spending many days to resolve this problem..finally got the solution.. :-)

    ReplyDelete
  10. I am very disappointed as it didnt work for me. I changed the wpa_suppliment and I could able to see the ad hoc network. But it is struck in obtaining IP add.. and phone will hang for 10 seconds.. and it disconnects. Any suggestions for this.?

    ReplyDelete
  11. I would check the documentation on whatever OS you are trying to share the connection from. You need to make sure that is properly setup to either relay the DHCP request to your local DHCP server or to assign IP's from the NAT'd interface.

    I have found that with Linux it can be very hard to get working but in Mac and Windows it is much easier to set up.

    ReplyDelete
  12. thanks for the swift reply..
    I am using the Win 7 OS.. and trying to connect with laptops Ad Hoc network..
    I am using rooted SGS2 with Stock ROM...

    ReplyDelete
  13. take a look at this thread. You might try and change the wireless encryption settings.
    http://social.technet.microsoft.com/Forums/en-US/w7itpronetworking/thread/dc00f244-b397-40be-8286-b448249949f0/

    ReplyDelete
  14. But that thread was not having any solutions .. am trying with connectify.. will update the status..

    ReplyDelete
  15. I connected using connectify.. But the internet is dropping randomly. But the wifi is steadily connected. i cant access laptop internet in my Samsung galaxy s2 android phone intermittently. i.e. once in 5 sec. after sometime if you try it will work for ten more sec thats all.
    any ideas?

    ReplyDelete
  16. you might try installing wireshark to look at the packets to see what is what is happening on the network when that is happening. That should give you a good idea of what is going on.

    ReplyDelete
  17. hello,

    this works for me kind off.... if i use no encryption i can connect. but when i set it up as wpa2 my galaxy s2 stops at the autentication step. do you have a hint for me? thanks a lot

    ReplyDelete
  18. you might try wpa2 with psk rather than aes if that is what you are trying.

    ReplyDelete
  19. It works Perfectly with my Galaxy note .. Thanks man

    ReplyDelete
  20. Thanks for this article it helped to acess my laptop internet on my samsung galaxy s2

    ReplyDelete
  21. It's perfect with my SGS2! Great Job! Thanks,

    ReplyDelete
  22. Hi I copy the file and connected my Samsung GS2 to nokia N8 byJoikuSpot Light but no data is pasing ????

    ReplyDelete
  23. maybe a problem with the Nokia.

    ReplyDelete
  24. No works with E72 ?

    ReplyDelete
  25. it asks me for an application to open the wpa supplicant with...am on ics ressurection remix....can't open the file to make the ticks required

    ReplyDelete
  26. I am using "root explorer" to set the permissions. I have not tried this on ICS so let me know if it works for you.

    ReplyDelete
  27. Alexander-barthelMarch 28, 2012 at 4:34 AM

    I tried it here, but as i changed the WPA_supplicant, Wifi cant be activated anymore.
    sometimes the sign in tray is highlighted, but in the options it says its deactivated.
    Galaxy S2 Europe Cyagenmod 9 (Android 4.0.1)

    ReplyDelete
  28. yeah it must be different for ICS then. I would think CM9 would include that functionality.

    ReplyDelete
  29. i hope so.( need it for gremote )

    ReplyDelete
  30. I too am running ICS and can confirm the exact same problem. Wifi wont turn on. Anyone figure out a fix for this issue?

    ReplyDelete
  31. Hi... Thank u for dis wonderful post... dis adhoc is working my Galaxy S2 Rooted, but the issue is Internet is too slow. i'm using Airtel 3g USB Modem with 3.2mbps. pls can u help me

    ReplyDelete
  32. i tried the wpa supplicant on my galaxy s2 gingerbread 2.3.3...it was fun.i later factory reset my phone erasing every data on my phone.afterwards i did the wpa supplicant again and this time it sees my ad-hoc network,connects to it but when i browse on my phone it says no internet connection.i flashed my rom with stock rom 2.3.3 tried it again and it still sees my ad-hoc network,connects to it but no internet connection.i think i just spoilt my phones wifi....anyway i have enabled internet sharing on my laptop..please help

    ReplyDelete
  33. It looks like the latest CM9 includes support for ADHOC networks.

    ReplyDelete
  34. YEAH!!! it really works for me.

    ReplyDelete
  35. :( wifi is not working anymor !

    ReplyDelete
  36. This is for GingerBread only, not ICS.

    ReplyDelete
  37. I need it for Cynagen Mod 9. Worked well in cyanagen mod 7. but not working for 9. Can please help me

    ReplyDelete
  38. Does this work still I've been messing about with networks for about three weeks

    ReplyDelete