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

How do I know it's running #20

Closed
yepyepyep4711 opened this issue Jan 8, 2015 · 28 comments
Closed

How do I know it's running #20

yepyepyep4711 opened this issue Jan 8, 2015 · 28 comments

Comments

@yepyepyep4711
Copy link

Hello,

I'm sorry, this is probably a noob question, but I would like to make sure unified nlp is doing something. How do I do this? I'm using GSMNetworkLocationProvider as backend on a Fairphone running Android 4.2.2. I have successfully installed the LegacyNetworkLocation.apk and have access to the shell. I can't find a frontend, however, that tells me: "this is the position we acquired using the Network Location Provider" and OsmAnd~ definitely isn't getting a fix any faster. I live in Brussels, so there is a fair amount of well known towers around. I'm still running the inviu opencellid to add some more.

Help would be greatly appreciated.

Best,

yep

@mar-v-in
Copy link
Member

mar-v-in commented Jan 8, 2015

Here GPS Location allows to see the current location provided by the network location provider.

Information if the integration of UnifiedNlp into the system is working is planned to be provided in-app in a future release.

In case you run Fairphone OS: It contains several changes to the location features and I don't know if and how UnifiedNlp will work with these. Unfortunately I can't find the sources of Fairphone OS system modifications (I only found some non-relevant UI code like Homescreen) and I don't have a Fairphone to test on these systems.

On AOSP-based systems you need to enable "Wi-Fi & mobile network location" in the location settings.

@yepyepyep4711
Copy link
Author

wow. ok that brings us a step further. When I press read with network chosen, I get "Network not enabled!"
"Wi-Fi & mobile network location" in the location settings is enabled, though.

Is there anything I could further test to get to the bottom of this?

Re the source code, does this https://fairphone.zendesk.com/hc/en-us/articles/201576803-Fairphone-Source-Code-Packages
or this https://github.com/Kwamecorp/Fairphone
help?

@trumberto
Copy link

I have the same problem as yepyepyep4711. "Here GPS Location" shows "Network not enabled!". Are there any steps can I do to debug it more?

@n76
Copy link
Contributor

n76 commented Jan 13, 2015

For myself, I set my CyanogenMod 11 phone's location settings to "Battery saving" to keep from having the GPS starting then open OsmAnd and look at the map. The location and blue circle displayed on the map show the position and reported accuracy it is getting from its requests for location. If debugging my backend(s), I also watch logcat to see exactly what is going on.

@yepyepyep4711
Copy link
Author

I'm using ug unified nlp 1.1.3 as delivered by F-droid https://f-droid.org/repository/browse/?fdfilter=unified&fdid=com.google.android.gms
Is that relevant?

@n76
Copy link
Contributor

n76 commented Jan 13, 2015

I actually have the 1.1.3 version of UnifiedNLP from F-Droid but was unable to install it with F-Droid on my phone. I installed it via ADB using root privileges as it needs to go in /system/priv-app/ which F-Droid can't do on CyanogenMod 11.

When installed in Fairphone, where does F-Droid put it?

@mar-v-in
Copy link
Member

The latest version, including the f-droid release, should work on cm11 without being pushed to /system/priv-app as long as there is no older version installed.

The f-droid release is not the legacy version and thus only works in Android 4.4 and 5.0. For Android 4.2 download the legacy version from github release and install it to /system/app.

@n76
Copy link
Contributor

n76 commented Jan 13, 2015

Hmmm. Just deleted my copy of UnifiedNLP and then installed from F-Droid. You are right, that works.

After install I checked and things worked. Then did a restart/reboot and my location backends were not bound until I specifically went in to the UnifiedNlp settings. So it looks like I can duplicate the issue reported by @FoxyBee at #22

@LuccoJ
Copy link

LuccoJ commented Jan 14, 2015

Sorry this is just going to be a "me too", but I'm not clear on what happened - initially, after installing UnifiedNLP from F-Droid, I had no network location, and that continued after a few attempts at reflashing (OmniROM) and moving UnifiedNLP back and forth.
Now eventually it's working, but I'm not sure what did the trick.

@FoxyBee
Copy link

FoxyBee commented Jan 14, 2015

I think if you clear your cache and reboot, then your device will not get a network location until you launch UnifiedNlp . After that point it seems to work and something is retained in the cache so on next reboot it works (most of the time, but not always).

@FoxyBee
Copy link

FoxyBee commented Jan 14, 2015

Actually, I was just playing with it again and if you swipe away the UnifiedNlp app from the recents screen, then network location stops working altogether. There is definitely something wrong.

@LuccoJ
Copy link

LuccoJ commented Jan 14, 2015

I can confirm that. Tested with https://f-droid.org/repository/browse/?fdid=com.futonredemption.mylocation
(which, incidentally, fails to give a street address even with the MapQuest geocoder enabled... but I guess that's for another bug)

@yepyepyep4711
Copy link
Author

ah, see, @mar-v-in, that may be a documentation problem. The repository entry of F-droid says "WARNING: Depending on your hardware/software configuration additional steps might be necessary, please read the README carefully.". See, it says additional, not don't use this package. So what I understood was: I need ug unifiednlp from f-droid (maybe it's the gui, who knows) plus I need to do some extra install steps as per the read me. So now I probably have both on my phone.
All-right, I'll try first de-installing ug unifiednlp in F-droid, see if that helps. If not, I'll reinstall the legacy version as per the readme. I'll let you know how it goes.

@yepyepyep4711
Copy link
Author

so. Deleting the F-droid-installed ug unified Nlp didn't change anything, but I have found something else. The README is wrong, at least in my case, about the destination folder. It says the .apk should go to '/system/priv-app/NetworkLocation.apk'. After I installed 'LegacyNetworkLocation.apk' as instructed and couldn't find an application in the list, I checked my filesystem. The apps are not in '/system/priv-app/', but in '/system/app/. I moved NetworkLocation.apk to that location, rebooted. and voilà, I have ug UnifiedNlp on my list and can edit the preferences.
Still, no cigar, as Here GPS Location still gives me a "Network not enabled!". ug UnifiedNlp is also not listed amoung the running apps, only amoung the cached processes. I cleared the data and rebooted again, but that didn't change anything.
What else should I check?

@FoxyBee
Copy link

FoxyBee commented Jan 18, 2015

Your problem may be related to this issue:
#22

@yepyepyep4711
Copy link
Author

I don't know, but #22 has been fixed in the latest release, and that's the one I'm running

@Srdgh
Copy link

Srdgh commented Jan 28, 2015

FWIW, I arrived at this thread because I seemed to be having the same problem as yepyepyep. (running latest FDroid version etc., in my case on Paranoid Android). I had OsmAnd~ open and didn't seem to be able to find any location. It turned out that it simply was taking a /long/ time. Having rebooted and (perhaps this is significant) opened the micro-g UnifiedNlp app from my app drawer to make sure the backend was selected, I then turned to OsmAnd~ again after a while and the location had been found.

Not saying this is what's going on with you, yepyepyep, but thought it was worth letting people reading this thread know that sometimes it can take a long time.

@n76
Copy link
Contributor

n76 commented Jan 28, 2015

With a backend installed that has a database of mobile/cell towers that include those in your area or with a WiFi backend with knowledge of APS in your area, you should get a location on OsmAnd within a second or so. On my phone the little blue dot on the upper right of the map display on OsmAnd that indicates it has a position is on immediately after opening the map. No delay at all. It does take a little time for a GPS lock though.

The microG https://github.com/microg/OpenWlanMapNlpBackend needs a network connection to access the database at OpenWlanMap. Likewise the https://github.com/microg/AppleWifiNlpBackend needs a network connection too.

The https://github.com/rtreffer/LocalGSMLocationProvider has a built-in database but at least in my area the database is old and does not contain the mobile/cell towers in my area so it does not work for me.

I usually run with mobile data disabled, so those were issues for me. Thus the two backends I have put together:

  1. https://github.com/n76/wifi_backend builds a on-phone database from WiFi APs that it sees when the GPS has locked and has reasonable accuracy. If there are WiFi APs in your area then your time to first fix on the GPS will be slow the first time but after it has acquired your phone will start building a database and the next time you run an app that needs data in that area it will quickly get a position
  2. https://github.com/n76/Local-GSM-Backend works very much like the LocalGSMLocationProvider except that it can build the on-phone database by downloading information from OpenCellID and/or Moxilla. My Samsung Galaxy Nexus only reports one tower, not adjacent ones, so on my phone LocalGSMBackend only gives you positional accuracy to a single tower. In my suburban area that is typically about 500 meters. Again, the position report is within a second or so of the time of first request.

I find that having a reasonable network based location will allow the GPS on my phone to acquire much more rapidly than if there is no network based location available.

@yepyepyep4711
Copy link
Author

I've further watched the app's behaviour. It's very erratic. Sometimes I get a fix, most times I don't, or it's minutes old and many hundred meters off track.
But thanks @n76. That may explain the problem. I didn't understand the database in LocalGSMLocationProvider is static (and old). Too bad you can't update the db by pushing a button. If there is no way to update the db I'd love to try Local-GSM-Backend. Alas, for reasons unknown to me, in F-Droid, the application is listed but greyed out, and the install button is not there, only the share button. I have root on the phone and "Do no grey out apps requiring root privileges" is active, so that's not it. Any ideas how I can switch backends? You should only run one at a time, right?

@n76
Copy link
Contributor

n76 commented Jan 29, 2015

Hmmm.I have installed the Apple WiFi backend and others through F-Droid so it is not as if there is a generic problem with installing backends via F-Droid.

My backend was originally based on the LocalGSMLocationProvider with a copy of all the code. Looking at my installed version it looks like I did not change the name that F-Droid displays, so maybe if you delete LocalGSMLocationProvider it will un-greyout my backend. Is my LocalWiFiNlpBackend greyed out too?

Also, what OS version are you running. My GSM backend requires 4.3 or higher. The WiFi one requires 4.2 or higher.

(I normally install both through adb from my build directory so I haven't checked how they install through F-Droid.)

You can install and run multiple backends. For a while I had the AppleWifiNlpBackend and OpenWlanMapNlpBackend installed along with my LocalWiFiNlpBackend and simply enabled/disabled them via the unifiedNLP settings. That allowed me to compare and contrast how well my backend worked compared to the others. I generally run two backends, one for WiFi and one for GSM based locations. It appears that unifiedNLP takes the report that indicates the most accurate position if it has more than one backend enabled.

mar-v-in added a commit that referenced this issue Jan 30, 2015
This might help with instabilities reported in #20
@LuccoJ
Copy link

LuccoJ commented Feb 8, 2015

As a follow-up to my mention of the Nominatim backend 1.0.0 failing to give an address (tested with My Location Widget from F-Droid), version 1.1.0 now works as expected.

@yepyepyep4711
Copy link
Author

damn. @n76 that's probably the reason for the greying out. I'm using a fairphone, so it's 4.2. Any chance you could do a legacy version?

@n76
Copy link
Contributor

n76 commented Feb 12, 2015

@yepyepyep4711 I'll have to double check all the APIs that it uses to see what OS they are compatible with. I'm pretty sure there is at least one I'd have to do a work around on.

@yepyepyep4711
Copy link
Author

hi @n76, how is it looking? Any chance of making it work?

@n76
Copy link
Contributor

n76 commented Mar 22, 2015

@yepyepyep4711 At present my local GMS backend is set for API level 16 (Android 4.1) so it should be able to be loaded on your phone.

@yepyepyep4711
Copy link
Author

good news! It seems to work! For some reason, it didn't want to download at first (in F-Droid). It went straight to "can not install". But after a few tries, it finally did download and install. I then built the DB from the the phone. There's something you might want to change there: it seems to be unable to work in the background. If I switch to another app while it's building the db, then come back to the backend, it's reverted to the settings screen, and pressing "Generate database" seems to start from scratch. Other than that, Here GPS Location doesn't seem to be able to call the backend, but OSMAnd~ does, and that location can then be read in Here GPS Location. Should it be like that?

@n76
Copy link
Contributor

n76 commented Mar 22, 2015

@yepyepyep4711 For issues with my GSM backend, please visit https://github.com/n76/Local-GSM-Backend

You will find there is already an issued filed about the database generation not working in background. I hope to fix that soon but cannot give an estimated time for when it will be done.

@yepyepyep4711
Copy link
Author

@n76 Hi, I went to some not-so-thorough testing, but it definitely seems to work, so I'll close this issue. Thanks for your help and all your answers! Great work!

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

7 participants