Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scanning failed ... #19

Open
Chris56 opened this issue Aug 4, 2023 · 6 comments
Open

Scanning failed ... #19

Chris56 opened this issue Aug 4, 2023 · 6 comments

Comments

@Chris56
Copy link

Chris56 commented Aug 4, 2023

LineageOS 18 (android 11), microg installed

SatStat shows the reception of cells, but
Show nearby emitters -> "Scanning failed, maybe the backend service is disabled"
At the same time My Location app reports:
Local NLP Backend:
Some Latitude, some Longitude
Accuracy: 371m (wich is strange with the cell tower in sight ...)
Of course I imported the Mozialla Database befrorehand and the reported location is next to perfect (within 20m)
For testing puroses I switched off WiFi scanning, to make sure only to use cell towers.

@Helium314
Copy link
Owner

The failing scan message is strange.
When you click show nearby emitters, a scan is started. Once the results are available, a location is reported and you should see the emitters.
Since My Location actually gets a location, the scan must have been successful.

There is a timeout though, and after 3.5 seconds the scan failed message is shown.
Mobile cell scans are usually very fast, and a typical full WiFi scan is ~2.5 s, so there should be enough time.
Since you also tried without WiFi scanning, I don't know what would cause the scan to take so long.
Though I think there is some sort of time limit how often microG can request scans. Maybe 10 or 20 seconds, possibly this also depends on microG version. If that is the case, you should see a scan success if you try a few times.

Accuracy: 371m (wich is strange with the cell tower in sight ...)

What accuracy would you expect?
Accuracy is always between some minimum value (depends on emitter type), and the cell size as in the database (imported from Mozilla in this case).

@Chris56
Copy link
Author

Chris56 commented Aug 4, 2023

Indeed, all very strange. I started the "Show nearby emitter", while no other application requested a position. Therefore, a time constraint should not be a problem. Only once I saw one LTE ransmitter as an answer (of course my phone is registered to the nearby transmitter anyway).
"My location" always shows a position through Local NLP Backend, which is only 20 Meter from the real position (therefore I found the 371 Meter strange, also: the 371 Meter constant!)
What ist the string, that I must query with logcat?

@Chris56
Copy link
Author

Chris56 commented Aug 4, 2023

Does this help (starting "My Location":
08-04 19:14:15.264 17426 17426 I gsmloc_TelephonyHelper: CellInfo: LTE MCC=262 MNC=-1 CID=33387777 LAC=13891 dBm=2147483647
08-04 19:14:15.265 17426 17426 W gsmloc_TelephonyHelper: Fixed MNC=1
08-04 19:14:15.275 17480 17480 D BackendHelper: Failed to parse cell info CellInfoLte:{mRegistered=YES mTimeStamp=27761727643724ns mCellConnectionStatus=2147483647 CellIdentityLte:{ mCi=33387777 mPci=297 mTac=13891 mEarfcn=46 mBands=[] mBandwidth=2147483647 mMcc=262 mMnc=null mAlphaLong= mAlphaShort= mAdditionalPlmns={} mCsgInfo=null} CellSignalStrengthLte: rssi=2147483647 rsrp=2147483647 rsrq=-7 rssnr=0 cqi=0 ta=0 level=0 parametersUseForLevel=0 android.telephony.CellConfigLte :{ isEndcAvailable = false }}
08-04 19:14:15.275 17480 17480 D BackendHelper: java.lang.IllegalArgumentException: Invalid MNC: 2147483647
08-04 19:14:15.275 17480 17480 D BackendHelper: at org.microg.nlp.api.CellBackendHelper$Cell.(CellBackendHelper.java:500)
08-04 19:14:15.275 17480 17480 D BackendHelper: at org.microg.nlp.api.CellBackendHelper.parceCellInfo18(CellBackendHelper.java:163)
08-04 19:14:15.275 17480 17480 D BackendHelper: at org.microg.nlp.api.CellBackendHelper.parseCellInfo(CellBackendHelper.java:140)
08-04 19:14:15.275 17480 17480 D BackendHelper: at org.microg.nlp.api.CellBackendHelper.loadCells(CellBackendHelper.java:329)
08-04 19:14:15.275 17480 17480 D BackendHelper: at org.microg.nlp.api.CellBackendHelper.onCellsChanged(CellBackendHelper.java:181)
08-04 19:14:15.275 17480 17480 D BackendHelper: at org.microg.nlp.api.CellBackendHelper.access$400(CellBackendHelper.java:55)
08-04 19:14:15.275 17480 17480 D BackendHelper: at org.microg.nlp.api.CellBackendHelper$1.onCellInfoChanged(CellBackendHelper.java:385)

@Helium314
Copy link
Owner

Indeed, all very strange. I started the "Show nearby emitter", while no other application requested a position. Therefore, a time constraint should not be a problem. Only once I saw one LTE ransmitter as an answer (of course my phone is registered to the nearby transmitter anyway).

I suspect the scan (often/sometimes) doesn''t start for some reason. Currently starting the scan is done via microG instead of calling the backend service directly, maybe this should be adjusted.

Your log lines are mostly from CellBackendHelper, which is a component of microG / UnifiedNlp, so unfortunately no help.
You can find Local NLP logs by looking for LocalNLP. Best do it case insensitive, then you should also find microG requesting and receiving locations from Local NLP.

"My location" always shows a position through Local NLP Backend, which is only 20 Meter from the real position (therefore I found the 371 Meter strange, also: the 371 Meter constant!)

There is no way Local NLP can determine the distance from the actual emitter. The accuracy for a single emitter is estimated from the range of the emitter according to the database, the emitter type, and the signal strength.
For some phones, the signal strength isn't properly contained in the cell data (e.g. my phone always reports perfect signal for LTE). In that case, bad signal is assumed.

@Chris56
Copy link
Author

Chris56 commented Aug 5, 2023

Well .. I do know the 20 meters is within 371 meters ... 😁 😁 😁
Only, if the 371 meter inaccuracy would be a correct answer, than one would expect the acual location to vary within those 371 meters. But it does not ...
The BackendHelper complain about not being able to parse the cellinfo.
E.g. CellSignalStrengthLte: rssi=2147483647 rsrp=2147483647
is very strange!
Has the interface to call helpers changed?

@Helium314
Copy link
Owner

If you only have one emitter (in that case this one LTE cell), the location is always at the center of this cell as in database. Only if you have more than one emitter the location may move (dependent on signal, but also on which emitters are found, as weak emitters are not found in every scan)

The BackendHelper complain about not being able to parse the cellinfo.
E.g. CellSignalStrengthLte: rssi=2147483647 rsrp=2147483647
is very strange!
Has the interface to call helpers changed?

This is normal, or at least I see the same on my phone. It seems some phones report only a few valid cells, and more invalid ones. Those are usually just ignored. LocalNLP does it too.

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

No branches or pull requests

2 participants