bfabiszewski / ulogger-android

μlogger • android application for real-time collection and publishing of geolocation data
GNU General Public License v3.0
307 stars 52 forks source link

cannot collect network position data #94

Closed TjrGithub closed 3 years ago

TjrGithub commented 3 years ago

I would expect ulogger to access network position data. Up to yesterday, I had an old version running that could do so. However, whenever I do a fresh install now, it claims network data is not available, and will not add position points to the database.

Same version information as in #93, except I deleted the app and reinstalled it from fdroid. No workaround known.

bfabiszewski commented 3 years ago

I think the clue is https://github.com/bfabiszewski/ulogger-android/issues/93#issuecomment-753502131.

I don't know how to reproduce your issues on Android 10 where GPS source is bound to general location setting. I don't see an option in OS to disable GPS and leave only network provider.

Setting location provider from within the app works fine. If you choose only network in µlogger settings the application will only listen to updates from network provider.

TjrGithub commented 3 years ago

It turns out, ulogger can very well collect network data. But it refuses to start running network-only, and it gives toast messages to the effect of no-position-source-found. But when I start a track with gps+network and leave it running for a while, I can verify with termux+sqlite3 on the device that network position data does accumulate in the database.

Curiously, there tend to be 2-3 times more gps data points than network data points. (I've set it to collect every 5 seconds, no server sync, everything else as unrestrictive as possible).

bfabiszewski commented 3 years ago

When you start the application it checks if there is at least one enabled provider. If it refuses to start it most probably means that all chosen providers are disabled. The idea is to prevent users start tracking with disabled providers by mistake.

When you start application with providers enabled and later disable all providers the application will stay on waiting for any of the providers to be enabled again.

The frequency of the updates depends on app settings but also on the implementation of data gathering by the particular device and it given scenario. The parameters are minimum requirements, so the updates should not happen more often than the settings but the OS is free to choose longer period or distance criterion. In our case case it is even a bit more complicated because be subscribe independently for updates from different providers. Each of them has separate criteria. So we do some additional checks to have usable positions from all providers while keeping general user criteria. My tests and frequent use of the application allowed my to tweak the algorithm, so that it works best for registering outdoor activities. But your millage may vary. And my algorithm prefers GPS data over network, so it may explain more positions from GPS provider.

TjrGithub commented 3 years ago

Network positioning is available most of the time, as per satstat. However, ulogger never allows me to create network-only tracks.

bfabiszewski commented 3 years ago

Give me steps to reproduce it on Android 10.

It works for me if I choose 'Network' option in µlogger settings and turn on OS 'Location' setting.

TjrGithub commented 3 years ago

What I did:

expected result: track starts recording whenever NLP has a fix

acutal result: slider pops back to off

Of course, a lot of unrelated steps happened in between because this is my daily driver.

bfabiszewski commented 3 years ago

Might be an issue with third party location backends. I plan to install Lineageos on one of my test devices. I may be able to tell more if I do so.

bfabiszewski commented 3 years ago

I did some testing. My setup is not exactly same as yours. My device doesn't have official LineageOS build. I used unofficial build, installed microG with NanoDroid package and had to manually patch signature spoofing as no patcher worked for me. I tested a bunch of location backends for UnifiedNlp. The best results I got from MozillaNlpBackend.

I was testing using µlogger 3.4 from F-Droid and also latest git version.

I can confirm that everything works fine using your setup. Slider stays in on position. Locations are logged from network provider. If I choose to use both providers it also uses GPS position.

It is probably an issue with your particular setup. The problem you describe is very strange. If slider backs to off it means it cannot find any available provider. As you only selected network, it means somehow network provider is not visible to location manager. I don't have any experience with NLP but now I see it can be tricky and it seems something is wrong with your setup.

You may also check it in SatStat. It should show blue marker whenever it finds network based location. Do you ever get blue marker there?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.