mendhak / gpslogger

:satellite: Lightweight GPS Logging Application For Android.
https://gpslogger.app
Other
1.98k stars 607 forks source link

Passive log - no altidute #748

Closed chlupm closed 4 years ago

chlupm commented 5 years ago

When active passive log, Altitude no logged (no altitude in "%ALT" when use Log to custom URL).

mendhak commented 5 years ago

What does your custom URL look like, can you copy paste it here? And are you recording simultaneously to another format such as GPX/CSV to verify that no altitude is appearing in there as well?

chlupm commented 5 years ago

My URL: https://HIDDEN/gpssend.fcgi?latitude=%LAT&longitude=%LON&altitude=%ALT&time=%TIME&speed=%SPD&accuracy=%ACC&heading=%DIR&provider=%PROV&battlevel=%BATT&serial=%SER

I am recording simultaneously with CSV. In CSV altitude empty too.

When start only GPS Logger every works OK (altitude exists - log period 300 s). After Start OsmAnd and start navigation in GPS Logger activated passive log and altitude is emty (log period automatic changed and is very short ~1 s).

mendhak commented 5 years ago

OK I have now tested on multiple phones with the same URL as you (different domain of course) as passive, with OsmAnd... and altitude is always appearing. What kind of device is this? Do other applications show an altitude?

chlupm commented 5 years ago

Device with problem (without altitude in passive log in GPS Logger): Samsung Galaxy A40 (A405F) Samsung Galaxy A3 2016 (A310F)

In other application altitude ok. In GPS Logger altitude ok too when no activate passive loging.

mendhak commented 5 years ago

So just the passive locations aren't including an altitude, but normal locations are including it.

I've tried on several phones now with that scenario but not able to recreate it. But I don't have any Samsung phones, only Nexus, Pixel, OnePlus devices, all of them record altitudes with passive locations.

I wouldn't be surprised if somehow this is specific to Samsung devices (or just yours?) but that does sound weird.

I don't have any answer, sorry can't offer much more help here.

chlupm commented 5 years ago

I think I found the problem. When disable MSL passive log altitude OK. When enable MSL passive log without altitude.

mendhak commented 5 years ago

Wow that was a good find, thanks for troubleshooting it and being so patient. I had totally forgotten about MSL.

See this code:

https://github.com/mendhak/gpslogger/blob/bd99af6d9009f081434a2d2b20a68653e88a29d2/gpslogger/src/main/java/com/mendhak/gpslogger/common/Locations.java#L28-L40

Basically the MSL requires geoidheight. Geoidheight comes from NMEA. NMEA requires GPS locations.

However a passive location coming in comes from another app, and the GPSLogger app, at that moment that a passive location comes in, is not listening to GPS for the NMEA sentences. So no geoidheight exists at all.

So the logic is, if no geoidheight is present, then remove the altitude rather than give an incorrect result.

Even if the location is a passive one, the lack of geoidheight cannot be ignored. Because if it were ignored only for passive locations then some of the altitudes will be wrong.

Well that is the explanation.

What is the next step, does the description need clarifying, or should this be an item in the main FAQ on https://gpslogger.app ?

mendhak commented 4 years ago

--- Closing as part of issues cleanup, market release, inactivity or inevitability. Issue can be reopened if needed, or a new issue created.