Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,165 Members 43,818 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Cell signal not being reported correctly

Tip us?
 
MrBiggzz
Old
#1  
Member - OP
Thanks Meter 7
Posts: 47
Join Date: Jul 2013
Location: Indianapolis

 
DONATE TO ME
Default [Q] Cell signal not being reported correctly

Hi!

When my phone is on LTE I notice that the NCSIGN is a positive number when it should be negative. When I turn off LTE and 3G comes on it goes to its correct negative number. NCSIG will report 99 when on LTE.

I can do this in tasker but what good are the functions in Zooper if you have to go outside to get information for something it already provides?

Is there a work around for this? Without getting into a fairly lengthy if .. then statement. Cause then I'd have to be checking whether or not the phone is in LTE or not. /sigh

Side question: Is there a function that will translate what NCCONN or NCCONNS is to its respective 2G,3G,3G-HSPA,4G-WiMax,4G or 4G-LTE laymen terms? Like EVDOrA or Ev as the short version of it goes is one of the 3G's. This might have to be a lengthy if .. then statement but it would be useful!

Any help is good help and I thank you much for it!
 
kwerdenker
Old
#2  
kwerdenker's Avatar
Recognized Themer
Thanks Meter 1996
Posts: 1,337
Join Date: Apr 2010
Location: Probably the Zooper Forums

 
DONATE TO ME
Quote:
Originally Posted by MrBiggzz View Post
Hi!

When my phone is on LTE I notice that the NCSIGN is a positive number when it should be negative. When I turn off LTE and 3G comes on it goes to its correct negative number. NCSIG will report 99 when on LTE.

I can do this in tasker but what good are the functions in Zooper if you have to go outside to get information for something it already provides?

Is there a work around for this? Without getting into a fairly lengthy if .. then statement. Cause then I'd have to be checking whether or not the phone is in LTE or not. /sigh

Side question: Is there a function that will translate what NCCONN or NCCONNS is to its respective 2G,3G,3G-HSPA,4G-WiMax,4G or 4G-LTE laymen terms? Like EVDOrA or Ev as the short version of it goes is one of the 3G's. This might have to be a lengthy if .. then statement but it would be useful!

Any help is good help and I thank you much for it!
Please use the search function to see if there is already a thread about your problem before posting a new one.

Here is a thread about your problem with explanations and some ideas about workarounds: http://forum.xda-developers.com/show....php?t=2600763

Send from my secret moonbase via space carrier pigeons

Please use the forums for your Zooper related questions. I won't respond to PMs with questions that can/should be asked there. Thank you.
 
MrBiggzz
Old
#3  
Member - OP
Thanks Meter 7
Posts: 47
Join Date: Jul 2013
Location: Indianapolis

 
DONATE TO ME
Sorry.

I saw that thread before and since I've really dove into it Zooper this week the if statement makes sense now.

I do search. Sometimes I just don't know what I'm searching for!

Thanks for the point out!

Sent from my Nexus 5 using Tapatalk
 
Scotty1
Old
(Last edited by Scotty1; 22nd April 2014 at 10:18 PM.)
#4  
Member
Thanks Meter 2
Posts: 72
Join Date: Jun 2008
Quote:
Originally Posted by MrBiggzz View Post
Hi!

When my phone is on LTE I notice that the NCSIGN is a positive number when it should be negative. When I turn off LTE and 3G comes on it goes to its correct negative number. NCSIG will report 99 when on LTE.

I can do this in tasker but what good are the functions in Zooper if you have to go outside to get information for something it already provides?

Is there a work around for this? Without getting into a fairly lengthy if .. then statement. Cause then I'd have to be checking whether or not the phone is in LTE or not. /sigh

Side question: Is there a function that will translate what NCCONN or NCCONNS is to its respective 2G,3G,3G-HSPA,4G-WiMax,4G or 4G-LTE laymen terms? Like EVDOrA or Ev as the short version of it goes is one of the 3G's. This might have to be a lengthy if .. then statement but it would be useful!

Any help is good help and I thank you much for it!
Several others have posted concerning a similar problem. I posted about it a week ago in this thread, where I proposed that the problem is that Zooper pulls incorrect info when the phone is on LTE (it pulls the RSSI value, instead of the RSRP value). You can try the workarounds suggested above (YMMV) but it'd be nice to have LTE working in a straightforward manner (3G works fine)
 
MrBiggzz
Old
#5  
Member - OP
Thanks Meter 7
Posts: 47
Join Date: Jul 2013
Location: Indianapolis

 
DONATE TO ME
Tasker incorrectly report LTE cell signal as well ( %CELLSIG ).

Sent from my Nexus 5 using Tapatalk
 
brizey
Old
#6  
Senior Member
Thanks Meter 364
Posts: 1,676
Join Date: Aug 2011
So I have this partially figured out.

NOTE: This exact command will liklely not work on your phone. I have a Verizon S4 running Carbon, so CM internals.)

Have tasker run this shell command as root:

Code:
dumpsys telephony.registry | grep 'SignalStrength:' | cut -d " " -f 12
and store the results in a variable, then load the variable upon being set to a Zooper variable.

You will have to run the command without piping to cut to see all the output to figure out which field is your dBm.

For my phone, the 12th field in the signal strength line in the dump is the signal strength in dBm as reported by the ROM. (By the way, you can see where Zooper gets it's erroneous 99 value in the the output of the grep before the cut command.) So I can get Zooper to report dBm correctly on LTE, and ASU (its just dBm +140 for LTE).

BUT...

You have to run the dumpsys to get the variable in tasker to change. You can set it to run every two minutes at the most in tasker. Or make it on demand for Zooper, but I have not come up with a way to make it real time. And I am sure this will crush the battery if it runs every 2 minutes all day. But one step closer to getting Zooper to correctly report dBm. My guess is you need a custom API to do it right unless Google standardizes things.
The Following User Says Thank You to brizey For This Useful Post: [ Click to Expand ]
 
brizey
Old
(Last edited by brizey; 3rd July 2014 at 01:25 AM.)
#7  
Senior Member
Thanks Meter 364
Posts: 1,676
Join Date: Aug 2011
OK.

So I have this almost completely figured out.

Here is the git for how Android does signal bars for LTE:

Code:
/**
     * Get LTE as level 0..4
     *
     * @hide
     */
    public int getLteLevel() {
        /*
         * TS 36.214 Physical Layer Section 5.1.3 TS 36.331 RRC RSSI = received
         * signal + noise RSRP = reference signal dBm RSRQ = quality of signal
         * dB= Number of Resource blocksxRSRP/RSSI SNR = gain=signal/noise ratio
         * = -10log P1/P2 dB
         */
        int rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN, rsrpIconLevel = -1, snrIconLevel = -1;

        if (mLteRsrp > -44) rsrpIconLevel = -1;
        else if (mLteRsrp >= -85) rsrpIconLevel = SIGNAL_STRENGTH_GREAT;
        else if (mLteRsrp >= -95) rsrpIconLevel = SIGNAL_STRENGTH_GOOD;
        else if (mLteRsrp >= -105) rsrpIconLevel = SIGNAL_STRENGTH_MODERATE;
        else if (mLteRsrp >= -115) rsrpIconLevel = SIGNAL_STRENGTH_POOR;
        else if (mLteRsrp >= -140) rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;

        /*
         * Values are -200 dB to +300 (SNR*10dB) RS_SNR >= 13.0 dB =>4 bars 4.5
         * dB <= RS_SNR < 13.0 dB => 3 bars 1.0 dB <= RS_SNR < 4.5 dB => 2 bars
         * -3.0 dB <= RS_SNR < 1.0 dB 1 bar RS_SNR < -3.0 dB/No Service Antenna
         * Icon Only
         */
        if (mLteRssnr > 300) snrIconLevel = -1;
        else if (mLteRssnr >= 130) snrIconLevel = SIGNAL_STRENGTH_GREAT;
        else if (mLteRssnr >= 45) snrIconLevel = SIGNAL_STRENGTH_GOOD;
        else if (mLteRssnr >= 10) snrIconLevel = SIGNAL_STRENGTH_MODERATE;
        else if (mLteRssnr >= -30) snrIconLevel = SIGNAL_STRENGTH_POOR;
        else if (mLteRssnr >= -200)
            snrIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;

        if (DBG) log("getLTELevel - rsrp:" + mLteRsrp + " snr:" + mLteRssnr + " rsrpIconLevel:"
                + rsrpIconLevel + " snrIconLevel:" + snrIconLevel);

        /* Choose a measurement type to use for notification */
        if (snrIconLevel != -1 && rsrpIconLevel != -1) {
            /*
             * The number of bars displayed shall be the smaller of the bars
             * associated with LTE RSRP and the bars associated with the LTE
             * RS_SNR
             */
            return (rsrpIconLevel < snrIconLevel ? rsrpIconLevel : snrIconLevel);
        }

        if (snrIconLevel != -1) return snrIconLevel;

        if (rsrpIconLevel != -1) return rsrpIconLevel;

        /* Valid values are (0-63, 99) as defined in TS 36.331 */
        if (mLteSignalStrength > 63) rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
        else if (mLteSignalStrength >= 12) rssiIconLevel = SIGNAL_STRENGTH_GREAT;
        else if (mLteSignalStrength >= 8) rssiIconLevel = SIGNAL_STRENGTH_GOOD;
        else if (mLteSignalStrength >= 5) rssiIconLevel = SIGNAL_STRENGTH_MODERATE;
        else if (mLteSignalStrength >= 0) rssiIconLevel = SIGNAL_STRENGTH_POOR;
        if (DBG) log("getLTELevel - rssi:" + mLteSignalStrength + " rssiIconLevel:"
                + rssiIconLevel);
        return rssiIconLevel;

    }
And here are where these values are in the variable mSignalStrength that falls out of my script above:

Code:
public String toString() {
        return ("SignalStrength:"
                + " " + mGsmSignalStrength
                + " " + mGsmBitErrorRate
                + " " + mCdmaDbm
                + " " + mCdmaEcio
                + " " + mEvdoDbm
                + " " + mEvdoEcio
                + " " + mEvdoSnr
                + " " + mLteSignalStrength
                + " " + mLteRsrp
                + " " + mLteRsrq
                + " " + mLteRssnr
                + " " + mLteCqi
                + " " + (isGsm ? "gsm|lte" : "cdma"));
    }
Because of the way it gets parsed out of the dumpsys, mLteRsrp is field 12, mLteRssnr is field 14, and if you are not on LTE, you can use mCdmaDbm, which is field 6. (You have to add three to the field because the dumpsys output leads with a few spaces.) The 17th field tells you if you are on LTE or not. So basically, you can calculate the bars by RSRP and then by SNR, then take the lowest of the two.


By the way, if you want to do bars for 3G on cdma:

Code:
**
     * Get Evdo as level 0..4
     *
     * @hide
     */
    public int getEvdoLevel() {
        int evdoDbm = getEvdoDbm();
        int evdoSnr = getEvdoSnr();
        int levelEvdoDbm;
        int levelEvdoSnr;

        if (evdoDbm >= -65) levelEvdoDbm = SIGNAL_STRENGTH_GREAT;
        else if (evdoDbm >= -75) levelEvdoDbm = SIGNAL_STRENGTH_GOOD;
        else if (evdoDbm >= -90) levelEvdoDbm = SIGNAL_STRENGTH_MODERATE;
        else if (evdoDbm >= -105) levelEvdoDbm = SIGNAL_STRENGTH_POOR;
        else levelEvdoDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;

        if (evdoSnr >= 7) levelEvdoSnr = SIGNAL_STRENGTH_GREAT;
        else if (evdoSnr >= 5) levelEvdoSnr = SIGNAL_STRENGTH_GOOD;
        else if (evdoSnr >= 3) levelEvdoSnr = SIGNAL_STRENGTH_MODERATE;
        else if (evdoSnr >= 1) levelEvdoSnr = SIGNAL_STRENGTH_POOR;
        else levelEvdoSnr = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;

        int level = (levelEvdoDbm < levelEvdoSnr) ? levelEvdoDbm : levelEvdoSnr;
        if (DBG) log("getEvdoLevel=" + level);
        return level;
    }
So similar to LTE, you pick the lowest number of bars for EvdoDbm or EvdoSnr. The signal strengths correspond to #bars: 4, 3, 2, 1, 0


This is from the master branch.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Automate Your Device with Sfen

Changing the profile of yourdevice manually is now long forgotten. Since the advent of Android automation … more

Galaxy Photo Screen Lock Displays a Photo Slideshow on Your Lock Screen

Being the most often looked at part of our devices UI, the lock … more

Boost the LG G3 Speaker and Headphone Volume

It seems like OEMs are stepping up their game, with regards to thequality of their devices sound … more

Forums Added for the HTC Desire 610 and LG G3 US Carrier Variants

We recently added two new sets of forums here on XDA. The first … more