Helium314 / Local-NLP-Backend

Yet another network location backend for the UnifiedNLP/microG project
GNU General Public License v3.0
63 stars 4 forks source link

Opencellid database successfully imported but not working #21

Open Jakarrrg opened 6 months ago

Jakarrrg commented 6 months ago

Hello, I am using a rooted curtana (Xiaomi Redmi Note 9s) device with Android 14 CrDroid rom, microg v0.2.27.223616 and my only backend is LocalNlp v1.2.11.

The problem is that the opencellid data do not seem to work.

More specifically, I have imported a CSV file database from opencellid for my country (Greece) successfully, but I did not get location fix without satellites for a long time moving around in the capital of Greece, so today I did some tests at home. I deleted all data from localnlp and imported only the CSV file freshly downloaded from opencellid, disabled the active mode and went for the "show nearby emitters" option. There was one emitter found, marked as unknown, so I searched for it on the opencellid site and I found it.

Then I enabled active mode, and made sure I get a satellite location fix. After that the unknown emitter was registered with a specific location and I could get a location while being in my house without satellites fix.

So, may there be some problem on the way the app is reading the data from opencellid csv file?

Helium314 commented 6 months ago

Is anything added to your internal database at all? You can check using the export function. Some emitters are skipped because they can't be read (then you should get a toast message at the bottom of the screen). Some emitters are skipped because of emitter type or country filter. For LTE, there are some emitters skipped if the data in the file is incomplete.

Jakarrrg commented 5 months ago

I tested it properly. I cleaned localnlp storage, imported opencellid csv file, rebooted phone, exported data from localnlp menu, opened the file on my computer, enabled location, opened localnlp and pressed the "show nearby emitters" option. I searched the found emitter (marked as "not in the database"), in the exported file on my computer and found it there. I'll try to post here photos from the message on localnlp "show nearby emitters", and the line in the exported file, where the same emitter is registered. (Some digits are erased and replaced with "x" to protect my privacy) ResizedImage_2024-01-11_19-26-52_6481 ResizedImage_2024-01-11_19-20-18_1483

Helium314 commented 5 months ago

That emitter has an invalid PCI (Physical Cell ID). It's -1 in the export (and probably also in the OpenCelliD file), but 490 in the screenshot. Actually it could be discarded in the import...

Jakarrrg commented 5 months ago

OK, I checked it in the OpenCelliD file, it is indeed -1 there also, as are the most of the registered LTE, but to tell you the truth, I don't really comprehent what does that mean. Is there something I could do, or the opencellid mapping in Greece is just not that complete?

Helium314 commented 5 months ago

I don't think there is anything you can do... According to [documentation](https://developer.android.com/reference/android/telephony/CellIdentityLte#getPci()), Android cannot even return -1 for PCI.

As far as I understand from https://www.telecomtrainer.com/lte-physical-cell-id/, we can't simply ignore PCI as "It plays a crucial role in cell identification"