Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Identifications of cells #30

Open
gerhardol opened this issue Aug 18, 2014 · 9 comments
Open

Identifications of cells #30

gerhardol opened this issue Aug 18, 2014 · 9 comments
Labels

Comments

@gerhardol
Copy link
Contributor

For me, psc is always -1. I have mostly 3G around I believe, but psc does not seem to be available.
Samsung Galaxy S2 with CM11
psc is for sure always -1 in 2g/GSM
I believe that psc should not be included for identifying with GsmCellLocation. For sure not when -1, as that should trigger the isError()
psc is scrambling code, not sure if that is applicable to identify sectors for instance.

On the other hand, I believe Lac should be included for CellIdentityGsm/Wcdma too, in addition to Mnc/Mcc/Cid.
LTE probably ok with Mnc/Mcc/Ci.

Open as an issue rather than a patch, as you likely have done more research than me, but maybe not see the psc=-1 issue

@gerhardol
Copy link
Contributor Author

Related - a separate issue or pull request:

  • Save latest time a cell appears, not first
  • Sort the history log in reverse order

@lordgreg
Copy link
Owner

I've tested switching cells yesterday in a way that I used Airplane mode, then turned Airplane mode off. When doing that, getCid() always returned -1 at first! However, switching network mode in system settings, WCDMA<>GSM<>WCDMA pref<>LTE pre never gave -1.

-1 always returns "unknown" from calls like getCid, getLac and getPsc

I will do few recordings today when driving home and to work tomorrow with different cell type modes. Will report back on what do I get. 👍

Concerning other issues- will fix those, I'm also bothered when opening "pick cellid" dialog and it shows me current cellid but with old stored date. And sorry about sorting history dialog- its an obvious bug, since picking them up in condition shows them okay.

@gerhardol
Copy link
Contributor Author

It seems like Psc is set in some phones. Maybe it is the HW. But at least my SGS2 w CM11 always have -1.That should be sufficient to not use Psc... For cdma GPS position could be used...
I do not know why I get CellLocation rather than CellInfo too.
There should be a way to get the antenna sectors too, is it hidden in the lac/cid.

@gerhardol
Copy link
Contributor Author

I suggest the following changes:

  • Remove Psc for GsmCellLocation (even if it could be unique for some Wcdma cells in some phones, it does not identify)
  • Switch order of Lac and Cid for GsmCellLocation
  • Handle getCid, getCi() == -1 as an error (reactivate isError())
  • Add Tac() for Lte: http://people.csail.mit.edu/bkph/cellular_repeater_numerology.shtml
  • Mnc/Mcc can be retrieved for CellLocation, skipping for now
  • While it would be nice to get the sector (antenna), the rles differ. Only present for LTE

This will invalidate the saved cell id lists, so it should be done before released on Google Play.
Submitting a pull request too.

gerhardol added a commit to gerhardol/Sfen that referenced this issue Aug 24, 2014
I am not 100% sure the proposal is "optimal" (info is slightly conflicting), but it should be better than it is now.
This will invalidate the saved cell id lists, so it should be done before released on Google Play.

I suggest the following changes:
* Remove Psc for GsmCellLocation (even if it could be unique for some Wcdma cells in some phones, it does not identify)
* Switch order of Lac and Cid for GsmCellLocation
* Handle getCid, getCi() == -1 as an error (reactivate isError())
* Add Tac() for Lte: http://people.csail.mit.edu/bkph/cellular_repeater_numerology.shtml
* Mnc/Mcc can be retrieved for CellLocation, skipping for now
* While it would be nice to get the sector (antenna), the rles differ. Only present for LTE
@gerhardol
Copy link
Contributor Author

Note: The comments about sorting etc is implemented already.

lordgreg added a commit that referenced this issue Aug 24, 2014
@gerhardol
Copy link
Contributor Author

Pull request implemented, I have only used "GsmCellLocation", not "CellInfo", so I will not close it myself...

@lordgreg
Copy link
Owner

Checking it tomorrow over highway (constantly switching 2g, 3g, lte).

Current LTE cell id shows: 293:41.3.212600:31 😸

@gerhardol
Copy link
Contributor Author

Plan to submit a new patch:

  • Identify Cdma including Network/system Id (Incompatible cell list). Mnc/Mcc listed as "unreliable" and not included
  • Include Mcc/Mnc for GsmCellLocation (incompatible)
  • Require all values in the list to be > 0
  • Log cell (including error) in log
  • Save previous cell, so single error can use previous info, so single error cell is not changing area

Incompatible changes (ie cells have to be added again) should be carefully considered first (but at least CDMA should be done).

@mvglasow
Copy link

It seems like Psc is set in some phones. Maybe it is the HW. But at least my SGS2 w CM11 always have -1.

Yes, Samsung phones (at least of that generation) are known not to report the PSC, or any neighboring cells. This is a limitation of the firmware.

A list of the limitations of a few devices can be found at https://docs.cellmapper.net/mw/index.php/Tested_Phones

I believe that psc should not be included for identifying with GsmCellLocation.

+1, the MCC/MNC/LAC/CID tuple are unique (at least within the same network type—not sure if collisions between, say, a 2G cell and a 3G cell are possible). PSC is a local identifier—no two neighboring cells can have the same PSC, and no cell can have two neighbors with the same PSC. Some have suggested that carriers occasionally change the PSCs for a cell (while keeping the CID), but I have no reliable information on that.

I do not know why I get CellLocation rather than CellInfo too.

Again, limitation of the phone firmware. There are three different API calls, and not all phones implement all of them.

There should be a way to get the antenna sectors too, is it hidden in the lac/cid.

Some carriers indeed encode antenna sectors in the CID (the LAC is an area code, thus different antenna sectors of the same tower would normally share the same LAC). However, this is purely by convention and entirely at the whim of the carrier—schemes vary from carrier to carrier, and are subject to change without notice.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants