[FIX] For wifi connection dropping too easily/often

Search This thread

gtg465x

Inactive Recognized Developer
Jun 16, 2008
4,748
3,277
I don't even have this phone, but I'm tired of hearing you guys complain about your wifi dropping :p. HTC programmed the Desire S to drop wifi connections if the signal falls below -88db. I'm not sure why they did that because -88db is a perfectly usable signal. With this fix, your wifi connection won't drop until the signal falls below -108db.

You need to be running a custom deodexed ROM to apply this fix.

Flash through Clockwork Recovery.

Let me know if it works for you!


If you appreciate my work, donations of any amount are very much appreciated.
 

Attachments

  • saga_wifi_fix_1.28.401.1_v3.zip
    4 MB · Views: 1,747
  • saga_wifi_fix_1.35.1113.2_v3.zip
    4 MB · Views: 6,595
Last edited:

gtg465x

Inactive Recognized Developer
Jun 16, 2008
4,748
3,277
Small update... noticed that I didn't set the permissions right on one of the files. May want to grab v2.

On another note, where is everyone? Dev community for this phone needs to wake up!
 
  • Like
Reactions: ChristianFerrer

loveboatcaptain

Senior Member
Mar 9, 2010
525
616
Berlin
www.twitter.com
Small update... noticed that I didn't set the permissions right on one of the files. May want to grab v2.

On another note, where is everyone? Dev community for this phone needs to wake up!


i´m here ;-)

just downloading v2 and give it a go and a test...
i will report back as soon as i feel there is something happening after flashing ;-)

thanks for this.... if this works, i can enjoy my wifi in the kitchen while drinking coffee ;-)

regards and thanks
 
  • Like
Reactions: ChristianFerrer

crubbish

Senior Member
Mar 15, 2006
326
61
Moscow
For those who can't apply the above fix due to "S on" (pretty much everyone?) you can try the easier way which I've posted in another thread. Some people said it doesn't help but there's no harm in trying :)

there's a stock setting that can enable Desire S to hold Wi Fi connection a lot better. Go to Settings -> Wireless & networks -> Wi-Fi settings. Click menu button and choose Advanced. Second section from the top is "Best Wi-Fi performance" - tick it. That's it. It really made the difference for me. Dropped Wi Fi signal was a frequent thing with my Desire S but ever since I've ticked this option (~1 week ago) I haven't had such problem at all.
 

gtg465x

Inactive Recognized Developer
Jun 16, 2008
4,748
3,277
For those who can't apply the above fix due to "S on" (pretty much everyone?) you can try the easier way which I've posted in another thread. Some people said it doesn't help but there's no harm in trying :)

there's a stock setting that can enable Desire S to hold Wi Fi connection a lot better. Go to Settings -> Wireless & networks -> Wi-Fi settings. Click menu button and choose Advanced. Second section from the top is "Best Wi-Fi performance" - tick it. That's it. It really made the difference for me. Dropped Wi Fi signal was a frequent thing with my Desire S but ever since I've ticked this option (~1 week ago) I haven't had such problem at all.

Just so people know, doing this does NOT have the same effect as applying my fix. That might help you a little in the mean time until you get S-OFF, but my fix should completely fix the issue.
 

gtg465x

Inactive Recognized Developer
Jun 16, 2008
4,748
3,277
Also, why does loveboatcaptain appear to have S-OFF and the rest of you can't? :confused:
 

abo.saud

Senior Member
Sep 4, 2010
85
8
Riyadh
^^^^^^^^^
He might used xtc clip to turn it from s-on to s-off
this is the only way to do this until a dev figur some
software way to do this
 

Lacuna666

Senior Member
Aug 20, 2010
133
7
Leende
^^^^^^^^^
He might used xtc clip to turn it from s-on to s-off
this is the only way to do this until a dev figur some
software way to do this

Yes, true, and the xtc-clip is pretty expensive too, so most of us have to wait for a software method to get s-off, and then we can root and install clockworkmod i believe.
 

titus1

Senior Member
Feb 14, 2010
504
38
Unless you knew someone or somewhere who can make it to S-OFF, cause the xtc clip is expensive.
 

dont know

Senior Member
Feb 12, 2009
499
52
Why there are two files to dowload? What's the difference?

Anyway: thanks for the fix

Now there would be a reason to flash the deodexed ROM from loveboat ;)

As there are few devices sold and there is only one cook but no "hardcore-devs" (no offense to loveboatc.) for kerneltweaks or S-off there is not much life here..

Mine is S-off since SIMunlock - but done by a company for money (EUR 20,-)

But the stock-htc-2.3.3 is really great (very good battery, very stable,...) - so better than CM7 on my NexuS :/ I only needed root for deleting the htc-ads.app (navigation, amazon,...) and for adblocker,..
 

gtg465x

Inactive Recognized Developer
Jun 16, 2008
4,748
3,277
Why there are two files to dowload? What's the difference?

Anyway: thanks for the fix

Now there would be a reason to flash the deodexed ROM from loveboat ;)

As there are few devices sold and there is only one cook but no "hardcore-devs" (no offense to loveboatc.) for kerneltweaks or S-off there is not much life here..

Mine is S-off since SIMunlock - but done by a company for money (EUR 20,-)

But the stock-htc-2.3.3 is really great (very good battery, very stable,...) - so better than CM7 on my NexuS :/ I only needed root for deleting the htc-ads.app (navigation, amazon,...) and for adblocker,..

The two different versions are for two different ROM bases. Look in your software information to see which firmware you're running.
 

loveboatcaptain

Senior Member
Mar 9, 2010
525
616
Berlin
www.twitter.com
Also, why does loveboatcaptain appear to have S-OFF and the rest of you can't? :confused:

yes i used the xtc clip to get s-off, but didn´t buy one. i found someone who has this clip in a german android forum. meet him, give him some bugs (15€) and a coffee and while drinking that coffee he unlocked my wildfire and my desire s.

so you needn´t to buy it, cause you only will use it once. the s-off with the xtc clip is irreversible. nothing what you can flash can change that at the moment.

there is a second possibility with the clip as i read. there is a new version for sale which works "prepaid" and costs something like 25€/20£ which is a quite cheep way to get s-off i think.

phone repair shops in berlin for example have that clip too. will take some time to find one, but it´s really simple when you live in a bigger city.


Now there would be a reason to flash the deodexed ROM from loveboat ;)

As there are few devices sold and there is only one cook but no "hardcore-devs" (no offense to loveboatc.) for kerneltweaks or S-off there is not much life here..

Mine is S-off since SIMunlock - but done by a company for money (EUR 20,-)

But the stock-htc-2.3.3 is really great (very good battery, very stable,...) - so better than CM7 on my NexuS :/ I only needed root for deleting the htc-ads.app (navigation, amazon,...) and for adblocker,..

grrrrr ;-) i know that i´m not a hardcore dev :-( sadfully for myself too.
i would like to have someone who can do the job better than me. i made that only for myself, but wanted to share that with the community, cause there was nothing really usefull to find. and without HCDR.Jacob we would still have nothing, cause i would have failed on that what we now have.

give me some more time. i´m a hardcore family father, with a 10 month old little boy and a wunderfull wife, who like what i´m doing in my freetime, cause she´s addicted to android too *chear* and of course i have a fulltime job too.

but i´m working hard in my freetime to build something that will be a good basement for evrything that comes further.

on my next 2 or 3 free days i will be have a look at the kernel. perhaps HCDR.Jacob will give me a hand on that again, so we could do a little OC and UV for better battery life and some smartass-gov tweaks.

i also set up my mac (yes shame on me i use an apple macbook to build android ;-) ) to build from source for android.

you know what that mean right? AOSP ROM ;-) or to be clear CM7 !!!
but this will take a lot of time i think. for me ;-) but let´s see what i can do for all of use until there are hardcore devs around. which would be super cool to have someone to work with...

regards
 

bongo1

Senior Member
Apr 26, 2011
113
3
im a new android user, i booted into the clockwork thing and selected your update file from sd card to update with. It appears to install correctly.

Is there a way i can check if this patch has been installed properly or not?

Thanks
 

gtg465x

Inactive Recognized Developer
Jun 16, 2008
4,748
3,277
im a new android user, i booted into the clockwork thing and selected your update file from sd card to update with. It appears to install correctly.

Is there a way i can check if this patch has been installed properly or not?

Thanks

Open /system/etc/calibration as text and see if rssi_offset at the bottom of the file is equal to -20.

Sent from my Inspire 4G using XDA App
 

bongo1

Senior Member
Apr 26, 2011
113
3
Thanks for that, my offset is 0 so didn't work, does the patch work on the stock eu firmware with root, or do I need to use loveboats custom firmware?

Thx

Sent from my HTC Desire S using XDA App
 

bongo1

Senior Member
Apr 26, 2011
113
3
Installed loveboats custom firmware,

maybe i missed something but i did following.
- install LBC MOD SAGA alpha v0.01
- boot into clockwork recovery
- select install zip from sd card and select saga_wifi_fix_1.28.401.1_v2.zip
- install sucessfull
- reboot phone
- rssi_offset=0 so did not work

did i make any mistake?

thanks
 

loveboatcaptain

Senior Member
Mar 9, 2010
525
616
Berlin
www.twitter.com
Installed loveboats custom firmware,

maybe i missed something but i did following.
- install LBC MOD SAGA alpha v0.01
- boot into clockwork recovery
- select install zip from sd card and select saga_wifi_fix_1.28.401.1_v2.zip
- install sucessfull
- reboot phone
- rssi_offset=0 so did not work

did i make any mistake?

thanks

so i found time to test your fix a little bit...
sadfully i have to say that your update.zip didn´t work with my ROM (see below).

the files are working, really gread... now i can drink coffee in my kitchen without loosing my wifi connection. thank you very much for fixing that.

to fix your update.zip i compared your updater-script with mine.
you used the following mount command:

Code:
mount("ext3", "EMMC", "/dev/block/mmcblk0p26", "/data");
mount("ext3", "EMMC", "/dev/block/mmcblk0p25", "/system");

i used this:

Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p25", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p26", "/data");

the desire s and the incredible s are using ext4 which you can find out by typing following in your terminal:

Code:
adb shell
mount

this is the output from my terminal:

Code:
...
/dev/block/mmcblk0p25 /system ext4 ro,relatime,barrier=1,data=ordered 0 0
/dev/block/mmcblk0p26 /data ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered 0 0
/dev/block/mmcblk0p27 /cache ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered 0 0
/dev/block/mmcblk0p28 /devlog ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered 0 0
...

i´ve had the same problem with my ROM and while compiling and building the clockworkmod recovery... after changing everything to ext4 clockworkmod and the script installed my ROM successfully.

i tried the lines and modified your script and after that the files where changed correctly.

hope that will help the other ones having problems to flash it.

regards

p.s. can i use your fix in the next update for my ROM (credits included ;-) !! ) and is it possible to increase the values a little more (just for personal interest)
 
Last edited:
  • Like
Reactions: adridu59

gtg465x

Inactive Recognized Developer
Jun 16, 2008
4,748
3,277
Thanks loveboatcaptain. I just assumed the mounts would be the same as the Desire HD. Updated the fixes in the first post to mount ext4.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    I don't even have this phone, but I'm tired of hearing you guys complain about your wifi dropping :p. HTC programmed the Desire S to drop wifi connections if the signal falls below -88db. I'm not sure why they did that because -88db is a perfectly usable signal. With this fix, your wifi connection won't drop until the signal falls below -108db.

    You need to be running a custom deodexed ROM to apply this fix.

    Flash through Clockwork Recovery.

    Let me know if it works for you!


    If you appreciate my work, donations of any amount are very much appreciated.
    2
    [PATCH] framework.jar for altering WiFi RSSI values in ICS

    /*
    * I am not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because the alarm app failed. Please
    * do some research if you have any concerns before flashing it!
    * YOU are choosing to make these modifications, and if
    * you point the finger at me for messing up your device, I will laugh at you.
    */


    A big thanks to gtg465x, kylon and others in the forum for explaining things in posts. It's their work mostly and not mine.

    I'm writing this here just in case someone needs the info..

    Since I had a problem with the reception of WiFi signal in a Desire S and I've been searching the forum for many days to find a solution to this that I got no responce I decided to search for the framework.jar file patch that has to be done with the /etc/calibration file change to the value of rssi_offset so that Desire S won't drop the connection so easily. Tried also to contact gtg465x but I guess he's busy.

    This was done to ICE_DS 6.5 ROM

    The patch goes as this:
    (1. I am not a developer (used to code, not in android though)
    2. I modified the values only by -10 dBm just for test you can change to -20 if you like
    3. feel free to correct my wrongs)



    gtg465x describes very nicely here what needs to be done http://forum.xda-developers.com/showthread.php?p=25174730 but this is for GB ROM
    Read carefully to edit your /etc/calibration file. In that post it's changed to -20, in my test to -10

    but ICE_DS 6.5 is a ICS ROM

    and the code in WiFiManager.smali is as follows
    (the sections that need to be edited)
    Code:
    .field private static final MAX_RSSI:I = [COLOR="Red"]-0x37[/COLOR] [COLOR="Blue"]#changed to -0x41[/COLOR]
    
    .field private static final MIN_RSSI:I = [COLOR="red"]-0x64[/COLOR] [COLOR="Blue"]#changed to -0x6e[/COLOR]

    Code:
    .method public static calculateSignalLevel(II)I
        .registers 9
        .parameter "rssi"
        .parameter "numLevels"
    
        .prologue
        const/4 v6, 0x5
    
        const/16 v5,[COLOR="Red"] -0x46[/COLOR] [COLOR="Blue"]#changed to -0x50[/COLOR]
    
        const/16 v4, [COLOR="red"]-0x50[/COLOR] [COLOR="Blue"]#changed to -0x5a[/COLOR]
    
        .line 963
        const/4 v1, 0x0
    
        .line 964
        .local v1, level:I
        const/4 v3, 0x4
    
        if-eq p1, v3, :cond_b
    
        if-ne p1, v6, :cond_23
    
        .line 965
        :cond_b
        if-lt p0, v5, :cond_13
    
        .line 966
        const/4 v1, 0x3
    
        .line 974
        :goto_e
        if-ne p1, v6, :cond_12
    
        add-int/lit8 v1, v1, 0x1
    
        .line 986
        :cond_12
        :goto_12
        return v1
    
        .line 967
        :cond_13
        if-ge p0, v5, :cond_19
    
        if-lt p0, v4, :cond_19
    
        .line 968
        const/4 v1, 0x2
    
        goto :goto_e
    
        .line 969
        :cond_19
        if-ge p0, v4, :cond_21
    
        const/16 v3, [COLOR="red"]-0x55[/COLOR] [COLOR="Blue"]#changed to -0x5f[/COLOR]
    
        if-lt p0, v3, :cond_21
    
        .line 970
        const/4 v1, 0x1
    
        goto :goto_e
    
        .line 972
        :cond_21
        const/4 v1, 0x0
    
        goto :goto_e
    
        .line 976
        :cond_23
        const/16 v3, [COLOR="red"]-0x64[/COLOR] [COLOR="Blue"]#changed to -0x6e[/COLOR]
    
        if-gt p0, v3, :cond_29
    
        .line 977
        const/4 v1, 0x0
    
        goto :goto_12
    
        .line 978
        :cond_29
        const/16 v3, [COLOR="red"]-0x37[/COLOR] [COLOR="Blue"]#changed to -0x41[/COLOR]
    
        if-lt p0, v3, :cond_30
    
        .line 979
        add-int/lit8 v1, p1, -0x1
    
        goto :goto_12
    
        .line 981
        :cond_30
        const/high16 v0, 0x4234
    
        .line 982
        .local v0, inputRange:F
        add-int/lit8 v3, p1, -0x1
    
        int-to-float v2, v3
    
        .line 983
        .local v2, outputRange:F
        add-int/lit8 v3, p0, 0x64
    
        int-to-float v3, v3
    
        mul-float/2addr v3, v2
    
        div-float/2addr v3, v0
    
        float-to-int v1, v3
    
        goto :goto_12
    .end method


    this translates to java as (the original values)
    Code:
     public static int calculateSignalLevel(int paramInt1, int paramInt2)
      {
        if ((paramInt2 == 4) || (paramInt2 == 5))
        {
          int i;
          if (paramInt1 >= -70)
            i = 3;
          for (;;)
          {
            if (paramInt2 == 5)
              i++;
            return i;
            if ((paramInt1 < -70) && (paramInt1 >= -80))
              i = 2; else if ((paramInt1 < -80) && (paramInt1 >= -85))
              i = 1; else
              i = 0;
          }
        }
        if (paramInt1 <= -100)
          return 0;
        if (paramInt1 >= -55)
          return paramInt2 - 1;
        return (int)((paramInt2 - 1) * (paramInt1 + 100) / 45.0F);
      }


    There is also another section in WiFiManager.smali called calculateSignalLevel(III)I
    Code:
    .method public static calculateSignalLevel(III)I
        .registers 7
        .parameter "rssi"
        .parameter "numLevels"
        .parameter "frequency"
    
        .prologue
        const/16 v3, -0x41
    
        const/16 v2, -0x46
    
        .line 2027
        const/16 v1, 0x1324
    
        if-le p2, v1, :cond_22
    
        .line 2028
        const/4 v0, 0x0
    
        .line 2029
        .local v0, level:I
        if-lt p0, v3, :cond_12
    
        .line 2030
        const/4 v0, 0x3
    
        .line 2038
        :goto_c
        const/4 v1, 0x5
    
        if-ne p1, v1, :cond_11
    
        add-int/lit8 v0, v0, 0x1
    
        .line 2041
        .end local v0           #level:I
        :cond_11
        :goto_11
        return v0
    
        .line 2031
        .restart local v0       #level:I
        :cond_12
        if-ge p0, v3, :cond_18
    
        if-lt p0, v2, :cond_18
    
        .line 2032
        const/4 v0, 0x2
    
        goto :goto_c
    
        .line 2033
        :cond_18
        if-ge p0, v2, :cond_20
    
        const/16 v1, -0x4b
    
        if-lt p0, v1, :cond_20
    
        .line 2034
        const/4 v0, 0x1
    
        goto :goto_c
    
        .line 2036
        :cond_20
        const/4 v0, 0x0
    
        goto :goto_c
    
        .line 2041
        .end local v0           #level:I
        :cond_22
        invoke-static {p0, p1}, Landroid/net/wifi/WifiManager;->calculateSignalLevel(II)I
    
        move-result v0
    
        goto :goto_11
    .end method

    which reads as:

    Code:
      public static int calculateSignalLevel(int paramInt1, int paramInt2, int paramInt3)
      {
        if (paramInt3 > 4900)
        {
          int i;
          if (paramInt1 >= -65)
            i = 3;
          for (;;)
          {
            if (paramInt2 == 5)
              i++;
            return i;
            if ((paramInt1 < -65) && (paramInt1 >= -70))
              i = 2; else if ((paramInt1 < -70) && (paramInt1 >= -75))
              i = 1; else
              i = 0;
          }
        }
        return calculateSignalLevel(paramInt1, paramInt2);
      }

    but I have the believe (which I may well be wrong) that has to do something about WiMax (if (paramInt3 > 4900)) so I didn't touch that.
    2
    Ok, checked the file and it's possible but a bit hard using init.rc.
    Another way, download the attached file, extract it, open the extracted file and replace the PATHTOCALIBRATIONFILE with the correct path inclusive filename, afterwards copy it to your /etc/init.d folder and set the correct permissions (r-xr-xr-x or 555 or everyone execute and read), this will write at startup the fitting values to the calibration file.
    2
    Grab Root Browser its free

    Sent from my Desire S using XDA
    1
    Small update... noticed that I didn't set the permissions right on one of the files. May want to grab v2.

    On another note, where is everyone? Dev community for this phone needs to wake up!