What is the Sailfish plan for replacing canceled Mozilla location service? Some Sailfish devices are useless as daily driver with GPS taking too long to locate.
@coderus, I know I’m asking too much, but can you (or anyone else) make a step-by-step instruction on how to do that?
How much that speeds up the initial location?
And how reliable?
@filip.k: the best is to test yourself. I am not aware of anyone doing such tests so far. If you do, please report back.
I tried it - works perfectly. Here is a step by step guide:
Ahoy!
In fact Mozilla Location Service is not disabled. Mozilla requires a strong reason to request an API key to directly use their services. However, Mozilla Location Services data can still be used in “offline” mode and not by accessing directly the data and here how you can do it:
- Download the full cell data from https://location.services.mozilla.com/downloads
- Extract the CSV
- Use “mlsdbtool” from https://github.com/mer-hybris/geoclue-providers-mlsdb against the csv file.
You can use it as:
geoclue-mlsdb-tool -c <country> <CSV_Filename.csv>
It will create 9 folders containing each of them a mlsdb.data file - Upload the folders to /usr/share/geoclue-provider-mlsdb/
- Now you will have the location calculated based on the triangulation against the cell towers in your area while you have the data link off. You still need GSM connection so that the Cell ID could be acquired.
I haven’t tested yet the Yandex provider and I cannot tell you if Yandex data is more granular than the data Mozilla provides.
P.S. If you want to convert the “world data” for MLS, you could also alter the code of mlsdbtool and use the following limits in the code so that the whole data in the CSV will be converted:
BoundingBox world_bb;
world_bb.latShift = 0.0;
world_bb.lonShift = 0.0;
world_bb.lowerLeft.lat = -85.0;
world_bb.lowerLeft.lon = -180.0;
world_bb.upperRight.lat = 85.0;
world_bb.upperRight.lon = 180.0;
retn.insert(QLatin1String("World"), world_bb);
I hope it helps.
So if I read that, it would be not that much of a task to build up a “Sailfish Location Service” with the Mozilla Source (https://github.com/mozilla/ichnaea) and files (https://location.services.mozilla.com/downloads)?
So this could be done by Jolla or the community, couldn’t it?
Some possible Models:
- Jolla builds it up and it is “paid” by the Sailfish X license. (Probably Jolla has no time for that)
- Community builds it up and runs it by donations.
- Community builds it as a charged service to cover the server costs.
At least we would need a UI-Component to enter the individual API key and URI to use this service then.
It helped. Thank you. I got a fix after about a minute being offline with mlsdb location enabled in settings. I wanted to note that the geoclue-mlsdb-tool is included in the package, geoclue-provider-mlsdb-tool, so no need for the github step.
In case geoclue-mlsdb-tool doesn’t contain your country, look up the MCC code of your country and edit function parseLineAndTest()
in mlsdbtool/main.cpp
like this
if (cellId > 0 && mcc==555) { // CHANGE 1
// build the cell location.
result.uniqueCellId = MlsdbUniqueCellId(cellType, cellId, locationCode, mcc, mnc);
result.loc.lat = QString::fromLatin1(fields[7]).toDouble();
result.loc.lon = QString::fromLatin1(fields[6]).toDouble();
result.withinBBox = true; // CHANGE 2, line added
return result; // CHANGE 3, line added
then run with any country specified.
Thanks for the links! I will try to get this deployed in the next days.
What is the correct command? I copied the .csv file in the directory /home/nemo and I tried as follow without success.
[nemo@Sailfish ~] geoclue-mlsdb-tool -c Italy MLS-full-cell-export-2021-01-09T000000.csv
-bash: geoclue-mlsdb-tool: command not found
[nemo@Sailfish ~] geoclue-mlsdb-tool -c Italy CSV_MLS-full-cell-export-2021-01-09T000000.csv
-bash: geoclue-mlsdb-tool: command not found
You must install geoclue-provider-mlsdb-tool:
devel-su pkcon install geoclue-provider-mlsdb-tool
This step by step works great even from Spain. Thank you very much for sharing!
It also works fine for me in France.
Thanks a lot!
Thank you for this workaround. Today I was in need of the GPS, and even after 40 min I couldn’t get a lock (GPSInfo reported 18 satellites in view). So this is a very needed solution.
To confirm: to either add a new country, or extract for the whole world, we have to change the source code and recompile? Is it possible to compile directly in the phone or is an SDK needed? I couldn’t find instructions in the linked github repo.
Thank you
This is my issue, (United States), but I’m not clear on your directions - I don’t have this file anywhere… is it in the source? So you would have to build it yourself, and not use the mlsdbtool from pkcon?
Yes, the modified and compiled source code from github.
If you want I’ll create the files for you tomorrow. Do you need Guam and Virgin Islands cell data?
I would also appreciate those files. In my case, continental US would suffice. Thank you
No thanks - mainland us would be great. Thanks