Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    offline So I Hear You Can Mod
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    489
    Thanks
    17
    Thanked 123 Times in 99 Posts
    Downloads
    16
    Uploads
    0

    Fix for 3G/Wireless DNS issues for leaked Moto 2.1 rom

    Updated thread with newer version (v0.3).

    I have made a little "hack/fix" for 2.1 ROMs with the network DNS issues, where you lose network connectivity when you leave from a wifi area even though you have G/3G/E data connection shown ok (web browser times out or gives error page for example). Sometimes the issue is in reverse, i.e. you have good G/E/3G, but not WiFi.

    To test the DNS problem is your issue, type adb shell, and then getprop net.dns1 (you can use terminal emulator or I use gscript now for things I do often from the terminal). If you see a value, this means you are probably ok at the time and your connection issues are something else, if you don't get anything, this means you have the bug.

    You can also test in adb (or terminal emulator/gscript on the phone) by ping 8.8.8.8. If that pings ok, this proves your 3G IP network connection is good, then ping www. google. com (without the spaces..), if you get responses, this proves your DNS is ok, and you likely don't need this patch as you have some other issue, if you get all timeouts to google (but not to 8.8.8.8), you have the DNS issue discussed here and this fix will do the trick for you (once the phone is rebooted after you apply the fix, in the case of patching, this fix is applied when the phone reboots after the patch).

    So the fix is simple enough **. This script simply checks the net.dns1 parameter every 20secs and if blank, sets it to googles one (saves you having to manually do the fix all the time with gscript/terminal. And will also apply the fix regularly, if say, the WiFi goes to standby (when the screen is off it goes to standby), the 3G DNS might not kick in, so could happen often in day to day usage.

    you can download it here:
    Generic google version using their 8.8.8.8 dns:
    PatchDNS.zip
    Optus version uses their 61.88.88.88 dns.
    PatchDNSoptus.zip

    To upload to the phone:
    Ignore all older instructions, I made this very simple to do as a patch now, simply put into your SD card (e.g. adb push PatchDNS.zip /sdcard or transfer however you feel is the easiest), reboot the phone with the camera key held down, then choose volume down to go into the custom recovery, and then choose to update from a zip, and choose the PatchDNS.zip file, job done in a few seconds... reboot (no need to wipe for this!).

    Version info
    1st release: 60dnsfix provided as a script
    r0.2: provided as a patch, added 60sec startup delay
    r0.3: included net.dnschange increment, which current running apps need to detect dns change.

    Done! Next time you reboot the phone, every 20secs it will check to see if your DNS is setup correctly, if not, then it sets it to the google DNS, 8.8.8.8 (and increments net.dnschange).

    This only sets the net.dns1 parameter if it is not set at all, which can happen when the phone gets a bit confused about DNS on bootup (can be that wifi enabled on bootup means you don't get DNS for when you move away from wifi coverage, and with wifi disabled at bootup, sometimes the phone fails to get DNS from wifi when you enable wifi... this seems to be a lesser problem than the first example). I have been buried in logs trying to find the root cause, but so far, have not come up with much, so this is a quick fix that will work in most cases.
    If you edit the file, ensure you don't end up adding windows CR/LF to the ends of the lines (i.e. don't edit in wordpad/notepad, instead use notepad++ or programmers notepad).

    This will only work in ROMs that have added init.d support, e.g. adlxmod2.0 & J_r0dd's CliqMod Beta8, I haven't looked at any others to see whether they have added this support.

    It also needs to call the busybox function "wc" (and v0.3 uses "expr") so the rom should have busybox (with wc & expr compiled in) also, you can test if you don't run those above roms above by typing "wc -?" and "expr --help" from adb shell and see if it gives command not found, or gives the syntax of the command (syntax=good).

    **well, this is a work-around really, rather than a proper fix of the root cause, I spent a very long time looking at radio/bootup logcat logs and saw where the issue manifests, but can't work out how to sort it out, it seems the radio sometimes doesn't get DNS from your service provider on bootup, especially if you have wifi on and connected, and if it doesn't get it on bootup, it doesn't properly setup rmnet0 and so will never get the DNS from your telephone service provider.

    OLD installation info for historic purposes (no need to install this way now it is setup as a patch):
    unzip it somewhere where you can remember it, and run a command prompt, and ensure below you specify the full windows path to 60dnsfix if it isn't in the same directory you opened the command prompt from.
    adb remount
    adb push 60dnsfix /system/etc/init.d
    adb shell chmod 755 /system/etc/init.d/60dnsfix

    Cheers
    Tony
    Last edited by tonymy01; 08-30-2010 at 07:37 AM.

  2. 15 Users Say Thank You to tonymy01 For This Useful Post

    adlx (08-31-2010), Ariunbat (01-14-2011), bloodyshyt (12-04-2010), Citizen86 (08-23-2010), Double0EK (08-23-2010), eduardolmarques (10-31-2010), hzm82 (10-21-2010), jtbrighten (10-22-2010), j_r0dd (08-23-2010), mastermind278 (10-26-2010), njones (09-01-2010), rlameda (10-25-2010), sublime1184 (10-21-2010), tsheeley (09-14-2010), VontaelP (10-21-2010)

  3. #2
    Double0EK's Avatar
    offline Call Me THE Mobile Modder
    Join Date
    Apr 2010
    Location
    Las Vegas, NV
    Posts
    2,069
    Thanks
    339
    Thanked 466 Times in 367 Posts
    Downloads
    22
    Uploads
    0
    going to try this. will let you know if it works. This isnt the same as the GScript workaround is it? And being that it checks it every 20secs will it cause batter loss?

  4. #3
    offline So I Hear You Can Mod
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    489
    Thanks
    17
    Thanked 123 Times in 99 Posts
    Downloads
    16
    Uploads
    0
    Jr0dds gscript addition to his beta6 is a one off change (i.e. you manually run the script when you find the network isn't connecting in other words, but you will find the dns gets erased again the moment you go back into wifi and back out of wifi area, for example even when you hit the power button on the phone to sleep the screen, it turns off wifi and goes to 3G, and so DNS connectivity will be lost for, say, the phone to pull emails/happenings/etc while in sleep mode).

    The battery is fine for me, the 20secs is an operating system sleep only (so no battery use there) and if you look at the phone logcat, it is doing a tonne of things 24x7, so a simple getprop is very little overheads compared to what the phone does generally over a 24hour period. I have looked at the process usage, and this is at the bottom of the huge list of things the phone has running that are sucking down the battery.
    Regards

  5. The Following User Says Thank You to tonymy01 For This Useful Post:

    eduardolmarques (10-31-2010)

  6. #4
    offline Maybe Modder
    Join Date
    Jul 2010
    Posts
    29
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Downloads
    17
    Uploads
    0
    you couldnt do me a fix for 'no bluetooth' on leaked 2.1 could you ? dont realy fancy flashing a new rom again as i had a bit of a nigghtmare !

  7. #5
    offline So I Hear You Can Mod
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    489
    Thanks
    17
    Thanked 123 Times in 99 Posts
    Downloads
    16
    Uploads
    0
    Leaked bluetooth is fine? I was listening to music on the way to work today on it, with the stock music player (instead of the CMP, which I don't like what it does with generic album art), it even stops the music when you turn off the bluetooth (using a Jabra car-kit). And used it to transfer files (one at a time though..) to Windows7. Unless I have a prob with something, I can't fix it ;-).

  8. #6
    offline Itty Bitty Modder
    Join Date
    Jun 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Downloads
    25
    Uploads
    0
    I had a similar issue with the 2.0.25 sbf leak. every time I would turn off the bluetooth it would have all sorts of trouble reconnecting the next time I turned it on. I ended up rooting my phone with jr0dd beta7 last night and it seem to work fine, however running on beta7 seems to not be able to activate WiFi. putting beta 8 on now and hopping for the best.

  9. #7
    Cassiebun's Avatar
    offline Itty Bitty Modder
    Join Date
    Aug 2010
    Location
    Places
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Downloads
    1
    Uploads
    0
    I'm having problems with what I think is a slightly different issue, um... I loaded a custom rom on a few days ago and I am having trouble adding the APN settings so that I can access the 3G connection at all! Would this help with it? If not could someone suggest something that will help? I really need my mobile internets back! <3

    oopsie! Totally only just saw the announcement on the front of the forums! Sorry guys! <3
    Last edited by Cassiebun; 08-26-2010 at 09:04 AM. Reason: I made a boo boo <3

  10. #8
    offline So I Hear You Can Mod
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    489
    Thanks
    17
    Thanked 123 Times in 99 Posts
    Downloads
    16
    Uploads
    0
    Very different. I describe how to fault find with pings to find if you have dns issues, if so, this fix is for you. If not, then it must be something else. (did you press the menu button in the apn screen and choose to add? the mcc/mnc listed in the 'add' are from your sim card).
    edited spelling on a real PC... these forums don't play well with the phone stock browser, I can't see what I am typing as it refuses to put the editor box in the middle of the screen... very frustrating ;-)

    Grr, forum merges posts, I wanted to update with new info that I have made a change and called it v0.2.

    Newer version of DNS fix (in 1st post of thread) to add 60secs of startup delay to script (so 80secs before it checks the first time immediately after boot) as some users (in the J_r0dd version 8 thread for example) were finding their wireless wasn't starting with the first 20sec after bootup alteration to the dns (my wireless is ok here with adlxmod-2.0 but I guess varying routers etc might behave differently). Made it as a patch so very easy to do for anyone now.

    Added v0.3 version, which increments net.dnschange, a parameter many network apps look at in order to essentially be told "when this number changes, load the new dns for resolution".
    Added Optus patch here (instead of old script that required semi-complex transfer instructions for users to set up).
    Last edited by tonymy01; 08-30-2010 at 07:39 AM. Reason: Automerged Doublepost

  11. #9
    offline Itty Bitty Modder
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Downloads
    0
    Uploads
    0
    Hi Tony,

    I am running Adlx's 2.0 rom for the past 2 weeks and I have a question about a Wifi issue that I think you may be able to help me out with.

    Originally after installing his rom, I was able to use my home Wifi connection. I tested my speeds using speedtest.net and I was able to download apps fine.

    Now, I can connect to my network (and any other network) but I show IP address and I lose the ability to go on the internet. Pretty much, my connection to my network and every other one that I've tried leaves me without internet connection, yet it shows that I'm connected via WiFi.

    Is there anything you can think of that might help me resolve this issue and get back to having my Wifi connection restored?

    Thanks for your help!

    - Mat

  12. #10
    offline So I Hear You Can Mod
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    489
    Thanks
    17
    Thanked 123 Times in 99 Posts
    Downloads
    16
    Uploads
    0
    Did you do the fault finding I discussed in the 1st post here, i.e. ping 8.8.8.8 and ping Google If the 8.8.8.8 pings ok, but not google, then you have the DNS issue that this fix will sort out. So apply the patch (google DNS version or Optus DNS version) and this will regularly check to see if your DNS has been set and if not, will set it.
    I don't understand your "show IP address" part of the sentence, so are you saying you have an IP address? The DNS issue means while you have an IP address, the phone won't be able to resolve real hostnames which 99% of the internet is using (not many websites point to IP addresses).

  13. #11
    offline Itty Bitty Modder
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Downloads
    0
    Uploads
    0
    Sorry about my typo, I meant to say...

    "Now, I can connect to my network (and any other network) but I show no IP address and I lose the ability to go on the internet."

    I tried your way of testing for any DNS issues and after restarting my phone and connecting to my wifi network, I now have great connectivity. It doesn't make any sense at all since I have been without connection for past 2 weeks. Do you have any idea why my Wifi is so volatile (it was fine with stock 1.5) and I can only connect after a restart?

    I'm curious to get your take on this. Thanks for replying and trying to help me out, Tony!

    - Mat

  14. #12
    offline So I Hear You Can Mod
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    489
    Thanks
    17
    Thanked 123 Times in 99 Posts
    Downloads
    16
    Uploads
    0
    I don't really know what the issues are with this network stack.
    Google for some of the strange quirks and notice our phone model is not alone in having strange network bugs. it seems android phones aren't really robust in this area (I was having plenty of networking connectivity issues with motoblur1.2.7 so nothing has really changed much for me).

  15. #13
    offline Maybe Modder
    Join Date
    Apr 2010
    Posts
    22
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Downloads
    0
    Uploads
    0
    Awesome patch!

    I'll be rooting my wife's replacement CLIQ tonight and setting her up with adlxmod 2.0.2.

    Is there any reason why I couldn't just flash this after all the setup stuff is done? Why wait for it to have a problem in the first place, right?
    My Phone
    Black T-Mo MT3G Classic/Magic 32B - Biffmod 2.1 (FroYo) w/2708 Kernel

    Wife's Phone
    Black T-Mo Cliq
    Recovery: j_r0dd
    ROM: brwnMOD 3.0 DeBLUR
    Edit Signature

  16. #14
    offline Itty Bitty Modder
    Join Date
    Oct 2010
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Downloads
    0
    Uploads
    0
    now when i try to connect to my wifi network it says unsuccesfull

  17. #15
    offline Of Mice and Modders
    Join Date
    Sep 2010
    Location
    Gosport. United Kingdom
    Posts
    94
    Thanks
    3
    Thanked 17 Times in 14 Posts
    Downloads
    1
    Uploads
    0
    leave your wifi switched on and switch your phone off and on again, works for me



    Sent from my MB200 using Tapatalk
    Phone - HTC Desire
    ROM - GingerVillain 1.6
    Recovery - AmonRa 2.0.0

    Gone but not forgotten ---- Motorola Dext/Cliq

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •