mendhak / gpslogger

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

Feature Request: Only Send Latest Location to Custom URL #986

Closed RealDudePerson closed 2 years ago

RealDudePerson commented 2 years ago

I plan on using gpslogger to share my current location with family members and potentially friends. Right now I have it in a working state with the custom URL feature, thank you! What I have noticed is that it sends all recorded locations to the custom server when sending logs. One feature change I would like is an option under 'Log to custom URL' to only send one http request at each auto send interval.

When the intent is to share current location, only the most recent recorded location is relevant. Ideally there would be a way to query the local gpslogs and find the most recent data point and send that one. This would save on time updating the custom url, data, and battery life.

I made a crude mock up of how the UI could be updated with the new toggle. index

RealDudePerson commented 2 years ago

I don't know if this is poor form or not, but I will put a ~100k sat bounty on this feature (minus a few hundred sats miner fee, or lightning tx fee).

RealDudePerson commented 2 years ago

To add to my bounty, if it turns out that this feature is already possible and I don't have it set up correctly, I will instead donate 200k sats to @mendhak.

mendhak commented 2 years ago

Hi what you're describing is essentially the Custom URL logging feature; it will send the latest recorded location at the logging interval. The difference is that there aren't any points being recorded in between.

The auto send is only meant to be for bulk locations, so I'm not keen on making it any more complex as that would increase maintenance overhead for me.

Based on what you're describing, you're trying to show your latest location when users visit your application (I assume webpage?). So showing the l atest location would be an application logic concern, that is, in your own application you'd simply do something like a SELECT * FROM xxx ORDER BY the_date_time LIMIT 1; to get just the latest row and display that on the map.

The /recordlocation endpoint, when receiving points, will simply need to discard any points that already exist (or overwrite them), and insert new rows for new points.

RealDudePerson commented 2 years ago

I guess it was a misunderstanding on my part. It sounds like I was duplicating the sends by enabling 'log to custom url' and enabling 'auto sending'

'Auto sending' is a bulk log send feature, and 'logging to custom url' will only send the current location at the set interval.

My application is set to only receive lat/lon/acc and I made the logic set the time to the servers recieve time. Probably not the best, but I'm not a software engineer. This was causing problems when I had 'auto sending' enabled as it would treat historical points as current points.

I will test with disabled 'auto send' and close the issue.

Thanks!

theraser commented 2 years ago

Thanks for the explanation, I just hit the same "issue" and wondered why my mobile data usage exploded after enabling both modes :-)

Is there any way to record a track using an (local) interval of i.e. 5 seconds and send only the last location i.e. every 10 minutes using the "logging to custom url" option? Did I miss something or is this not possible without an external app? OsmAnd got this feature but it is a battery killer for me, GPS Logger is way more efficient...

mendhak commented 2 years ago

So if you've hit this issue too, that means there's a communication issue. I'll probably need to add a label against the options to clarify what they are doing.

It's not possible to have separate time intervals for custom URL vs local logging. It's done for efficiency as making it independent would be harder to maintain but also a bigger battery drain too.

mendhak commented 2 years ago

How's this summary

image

theraser commented 2 years ago

Thanks, the first one is easy to understand for me.

For "Allow auto sending" I would suggest to add something like "bulk sending". This way everybody should know that this is a collection of data points and "log to custom URL" will send only single points.

mendhak commented 2 years ago

Yes good one, bulk is a good word to use. I'll go with that.

image

mendhak commented 2 years ago

v124 is now on F-Droid and in the releases. To be clear, only the extra labels are in F-Droid to clarify the difference.