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

Germany - only Apple WiFi backend works #33

Closed
herrdeh opened this issue Mar 6, 2015 · 15 comments
Closed

Germany - only Apple WiFi backend works #33

herrdeh opened this issue Mar 6, 2015 · 15 comments

Comments

@herrdeh
Copy link

herrdeh commented Mar 6, 2015

Hi everybody,
great approach - I really appreciate it!

Installed ug UnifiedNlp via f-droid on a Huawei y300, slimkat 4.4.4. No trouble - and with the Apple WiFi backend I get instant location data.

But:
I couldnt make any other backend work. Are there insufficient data for Berlin, Germany? - Or how can I troubleshoot the backends? - No idea where I could find error messages.

On the "Here GPS location" app I get "network not enabled", allthough location services are switched on and are set to "energy saving mode".

Btw:
Wouldnt it a good idea to split GSM and WiFi databases by country / continent - as map providers do? - And combine it with an option to load missing data online? - 400MB is not so little - and it's quite likely I'll not travel to US in the next few years...

Cheers,
Wolf

@n76
Copy link
Contributor

n76 commented Mar 6, 2015

Which other backends did you try?

With respect to the two backends that I wrote:
https://github.com/n76/Local-GSM-Backend has a field for setting the mobile country code (MCC) value(s) to store when downloading a new database. It defaults to the United States (301,311) but if you set it to 262 it should save the towers for Germany. You can specify multiple codes for instance use 262,208 for Germany and France.

For https://github.com/n76/wifi_backend the data is collected by your phone when the GPS is in use by some other app. "Out of the box" it has no data at all and cannot give you an estimated location. I usually run a mapping or navigation application (OSMtracker, OsmAnd, etc.) when I am going somewhere so when I am ready to leave the destination the backend will have learned the WiFi APs in that area and I get a fast location estimate and quick GPS lock.

@herrdeh
Copy link
Author

herrdeh commented Mar 6, 2015

Thanks for the hint on '262' - I'll try that first.

At the moment I'm trying to get the non-gapps version, but can't install
it. F-droid ever states that a prior version has to be removed first. But I
deleted anything I had installed before.

So what can I do?

Gesendet mit AquaMail für Android
http://www.aqua-mail.com

Am 6. März 2015 16:46:17 schrieb n76 notifications@github.com:

Which other backends did you try?

With respect to the two backends that I wrote:
https://github.com/n76/Local-GSM-Backend has a field for setting the mobile
country code (MCC) value(s) to store when downloading a new database. It
defaults to the United States (301,311) but if you set it to 262 it should
save the towers for Germany. You can specify multiple codes for instance
use 262,208 for Germany and France.

For https://github.com/n76/wifi_backend the data is collected by your phone
when the GPS is in use by some other app. "Out of the box" it has no data
at all and cannot give you an estimated location. I usually run a mapping
or navigation application (OSMtracker, OsmAnd, etc.) when I am going
somewhere so when I am ready to leave the destination the backend will have
learned the WiFi APs in that area and I get a fast location estimate and
quick GPS lock.


Reply to this email directly or view it on GitHub:
#33 (comment)

@n76
Copy link
Contributor

n76 commented Mar 6, 2015

Not sure about your issue as I've only ever had the non-gapps version on my phone.

I neglected to give a link to a list of mobile country codes in my previous response. Here is an English version: http://en.wikipedia.org/wiki/Mobile_country_code

@herrdeh
Copy link
Author

herrdeh commented Mar 7, 2015

I found, that I have to remove the /data/data/com.google.android.gms-1.apk directory in order to make it work. But it looks as if the non-gapps UnifiedNlp doesnt cohabitate with frozen (by Titanium Backup) play services and disappears from the app drawer.

So I installed the with-gapps version again - but that doesnt work without running google play services, and my idea of salvaging a-bit-of-google on my phone wont work.

But does it make sense to use ug UnifiedNlp at all, if you have to maintain google play services anyway?

@mar-v-in
Copy link
Member

mar-v-in commented Mar 7, 2015

But does it make sense to use ug UnifiedNlp at all, if you have to maintain google play services anyway?

You might still use a backend that runs offline and are not forced to always send details of your location to Google.

@herrdeh
Copy link
Author

herrdeh commented Mar 7, 2015 via email

@mar-v-in
Copy link
Member

mar-v-in commented Mar 7, 2015

Only way to completely ensure this, is to wipe off all GAPPS from the phone (= wipe /system from recovery, install custom rom, don't install any GAPPS packages, reboot and uninstall any Google Apps still installed).

If you just want less: using UnifiedNlp with Xposed module will cause the system to no longer use google's location provider, disabling all location options in Google settings should stop it from sending out your location afterwards.

@herrdeh
Copy link
Author

herrdeh commented Mar 18, 2015

I ended up with completely erasing google (well - at my phone only...).
That made my cheap Huawei so much more responsive and agile, and so much improved battery duration (once had round 40 hrs at quite frequent usage), that it's a very good trade.

So I tried your suggestion and "calibrated" a trip with GPS active. But I found that GPS will deactivate automatically if not e.g. a navigator app is calling it. After a time I saw at GPS monitor that GPS is again seeking for position data "from scratch". - So - is there a possibility to keep GPS alive?

Anyway: Thanks a lot for providing UnifiedNLP!!

@mar-v-in
Copy link
Member

Using Mozilla Stumbler will keep GPS on and collect data that can be used to submit to the Mozilla Location Service (which can be used as a backend as well)

@mar-v-in mar-v-in closed this as completed May 3, 2015
@KAMiKAZOW
Copy link

If you want to support a non-proprietary service, use http://www.radiocells.org/ and http://www.openwlanmap.org/
Both have NLP back-ends, although the latter's is currently not in F-Droid.

@herrdeh
Copy link
Author

herrdeh commented May 3, 2015

AFAIK, there is quite a number of open/free location services. Do they merge/share their data bases regularly? - And how do I know which one to support for best efficiency?

It doesnt make so much sense to collect data over and over again for various projects.

@KAMiKAZOW
Copy link

Currently not but possibly in the future: https://twitter.com/radiocells/status/588793804456648705
Mozilla's database is 100% proprietary (like Apple's data, just with worse coverage).
I simply leave both Radiobeacon and Open WLAN Map scanning. I'm pragmatic about this, as long as the data is free.

@mar-v-in
Copy link
Member

mar-v-in commented May 3, 2015

To my knowledge, Mozilla Location Services and OpenCellId synchronize their cell databases.

Mozilla's cell database is under CC0 license and OpenCellId is CC-BY-SA licensed. Mozilla's Wi-Fi database is not published for legal reasons: In some countries a combination of location, mac address and timestamp is considered personal data and thus cannot be released.

@IzzySoft
Copy link

If you just want less: using UnifiedNlp with Xposed module will cause the system to no longer use google's location provider, disabling all location options in Google settings should stop it from sending out your location afterwards.

I've tried that: Installed XPosed, installed the module, activated it, rebooted. Then tried to configure it from within Xposed (click image for larger variant):

xposed

So it looks it doesn't work? On that device (LG P880) I still have the stock ROM running (4.1.2), so all the GApps are there. Installed UnifiedNLP with the LocalGSMBackend (both latest versions from F-Droid), and have a CellID database in place (as the configuration page of LocalGSMBackend confirms). I cannot install LegacyNetworkLocation.apk as its package name (com.google.android.location) would collide with an already installed package. Any ideas?

Update: Might that be related to #22 ? I just started UnifiedNLP manually to verify the settings, and now got this on a subsequent test:

unifiednlp xposed2 unifiednlp2

As you can see, test fails again – but this time claiming I had no NLP backend enabled. Which, as the screenshots show, I definitely have. I'm confused. In case it might help, some excerpt from logcat (taken after I had manually opened UnifiedNLP):

05-31 13:01:49.883 I/dalvikvm( 9375): Could not find method android.location.Location.getElapsedRealtimeNanos, referenced from method org.microg.nlp.location.BackendHelper.updateElapsedRealtimeNanos
05-31 13:01:49.883 W/dalvikvm( 9375): VFY: unable to resolve virtual method 596: Landroid/location/Location;.getElapsedRealtimeNanos ()J
05-31 13:01:49.883 D/dalvikvm( 9375): VFY: replacing opcode 0x6e at 0x0000
05-31 13:01:49.893 D/NlpLocationBackendHelper( 9375): Binding to: Intent { act=org.microg.nlp.LOCATION_BACKEND pkg=org.fitchfamily.android.gsmlocation cmp=org.fitchfamily.android.gsmlocation/.GSMService }
05-31 13:01:49.903 D/NlpLocationBackendHelper( 9375): Bound to: ComponentInfo{org.fitchfamily.android.gsmlocation/org.fitchfamily.android.gsmlocation.GSMService}
05-31 13:01:49.943 E/dalvikvm( 9395): Could not find class 'android.telephony.CellInfoGsm', referenced from method org.fitchfamily.android.gsmlocation.telephonyHelper.getAllCellInfoWrapper
05-31 13:01:49.943 W/dalvikvm( 9395): VFY: unable to resolve instanceof 42 (Landroid/telephony/CellInfoGsm;) in Lorg/fitchfamily/android/gsmlocation/telephonyHelper;
05-31 13:01:49.943 D/dalvikvm( 9395): VFY: replacing opcode 0x20 at 0x0053
05-31 13:01:49.983 E/ActivityThread( 9375): Service org.microg.nlp.location.LocationServiceV1 has leaked ServiceConnection org.microg.nlp.location.BackendHelper@41e18c58 that was originally bound here
05-31 13:01:49.983 E/ActivityThread( 9375): android.app.ServiceConnectionLeaked: Service org.microg.nlp.location.LocationServiceV1 has leaked ServiceConnection org.microg.nlp.location.BackendHelper@41e18c58 that was originally bound here
05-31 13:01:49.983 E/ActivityThread( 9375):     at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:971)
05-31 13:01:49.983 E/ActivityThread( 9375):     at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:865)
05-31 13:01:49.983 E/ActivityThread( 9375):     at android.app.ContextImpl.bindService(ContextImpl.java:1191)
05-31 13:01:49.983 E/ActivityThread( 9375):     at android.app.ContextImpl.bindService(ContextImpl.java:1183)
05-31 13:01:49.983 E/ActivityThread( 9375):     at android.content.ContextWrapper.bindService(ContextWrapper.java:394)
05-31 13:01:49.983 E/ActivityThread( 9375):     at org.microg.nlp.AbstractBackendHelper.bind(AbstractBackendHelper.java:78)
05-31 13:01:49.983 E/ActivityThread( 9375):     at org.microg.nlp.location.BackendFuser.bind(BackendFuser.java:76)
05-31 13:01:49.983 E/ActivityThread( 9375):     at org.microg.nlp.location.ThreadHelper.enable(ThreadHelper.java:70)
05-31 13:01:49.983 E/ActivityThread( 9375):     at org.microg.nlp.location.ThreadHelper.reload(ThreadHelper.java:43)
05-31 13:01:49.983 E/ActivityThread( 9375):     at org.microg.nlp.location.LocationProviderV1.reload(LocationProviderV1.java:54)
05-31 13:01:49.983 E/ActivityThread( 9375):     at org.microg.nlp.location.AbstractLocationService.onHandleIntent(AbstractLocationService.java:68)
05-31 13:01:49.983 E/ActivityThread( 9375):     at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
05-31 13:01:49.983 E/ActivityThread( 9375):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-31 13:01:49.983 E/ActivityThread( 9375):     at android.os.Looper.loop(Looper.java:137)
05-31 13:01:49.983 E/ActivityThread( 9375):     at android.os.HandlerThread.run(HandlerThread.java:60)

If needed, I can send you more (or attach a zipped version here).

To my knowledge, Mozilla Location Services and OpenCellId synchronize their cell databases.

I don't think so. I'm using lacells-creator to create the database. It has a script to merge from both sources. The downloaded CSVs differ in size by ~20% (btw: that very same database works fine on my other, Google-free device – so I can rule it out for above issue).

@IzzySoft
Copy link

@mar-v-in Any idea on my previous comment? I still cannot get it to work. That "make sure you added at least one backend" message I saw only once; usually it's rather the first screenshot I get to see. I've checked all other issues here to make sure I didn't miss anything:

I'm out of ideas. Will be abroad for a few days next, with "no data" while on the road (i.e. no mobile data, though WiFi is available at the hotel). As that means Google network location itself will have no chance to work, but the local database should, I will surely cross-check there. Could well be the Google stuff is just overriding things here – though according to the docs, the Xposed Module should take care for that itself. But as even initialization checks fail there, I don't get any preference screen I could cross-check with.

If you want me to create a new issue for this, please let me know. As said, I'm abroad for the next 10 days (was hoping to have this fixed before), so I could do so on my return.

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

5 participants