gpslogger icon indicating copy to clipboard operation
gpslogger copied to clipboard

Interval based on movement

Open eng3 opened this issue 9 months ago • 19 comments

Suggest adding a feature to auto modify interval based on movement.

If you gps locations are changing alot, increase interval.

If not changing at all or very little, decrease interval or just pause. I don't need more points if I haven't moved.

Or maybe use accelerometer to see if phone isn't moving and pause recording

eng3 avatar Mar 26 '25 02:03 eng3

Hi regarding the accelerometer, see my comment here: https://github.com/mendhak/gpslogger/issues/1199 Basically it might be possible, but I don't know where to source a model from that's not going to be a maintenance overhead, or possibly find a library that can do all this for me.

mendhak avatar Mar 31 '25 18:03 mendhak

I comment on the other ticket. Regarding GPS perhaps you just base it on speed? (disntance over time). If I'm moving slow, start increasing the interval up to some maximum. If I start moving faster, start decreasing the interval to some minimum.
Allow the user to change these settings.

Similar to my comment in the other ticket. Something simple, give the user some knobs to turn.

Then if it becomes really useful and there is alot of interest start building to something fancier or using "AI" I'd rather an app have more simple adjustable features than a couple really complicated fixed features (since the later usually doesn't work perfectly or for everyone). Better than nothing.

eng3 avatar Apr 03 '25 01:04 eng3

If testing is possible (and totally fine if not possible) I've put an APK here: https://github.com/mendhak/gpslogger/releases/tag/v134-rc1

The setting is available under Performance.

The significant motion sensor is determined by the OS. I also think its performance differs device to device.

mendhak avatar Apr 14 '25 21:04 mendhak

Thanks, I'll try it out. I guess I should look for gaps in the log to see if it is working?

eng3 avatar Apr 14 '25 21:04 eng3

Yes that would make sense... and oh I forgot to mention, just for this APK I've put the debug messages related to the sensor as warnings so they appear in orange in the log view.

mendhak avatar Apr 14 '25 21:04 mendhak

ok I'll try it for a few days and report back

eng3 avatar Apr 14 '25 21:04 eng3

Can you clarify how this works? I see several different log entries. If I have my interval set to 60 seconds, does it still check every 60 seconds?

First:

  • Setting up significant motion sensor
  • GPS coordinate, altitude, accuracy
  • Filename Repeated like 50 times Does this mean motion was detected therefore it recorded? 50 times?

Second:

  • Intent received - Get Next Point
  • No movement detected in the past interval, will not log Does it then see there was no movement during the 60 seconds then decide not to save to log?

Third:

  • Setting up significant motion sensor
  • Triggered How is this different than the above?

Maybe the goal of this request was not clear. I'm not try to keep the size of the log smaller, I'm trying to reduce battery usage. That is why I had hoped the interval could be variable and gradually increase when there is no motion (or if speed is zero). Maybe there is still battery savings. When it says it will not log, I assume it is not enabling GPS to try to get a fix which I assume saves battery. I dont know if checking every (interval) keeps the phone from going into deep sleep. Keeping log size down is probably a secondary goal. I don't need to log if I haven't moved.

eng3 avatar Apr 15 '25 14:04 eng3

Yeah it's still meant to be a battery saving, and also keeping the log size down. The way significant motion sensor works: once it's enabled, it waits for significant motion, then it raises an event in the code (where it says "triggered!"), then it shuts itself off.

So what I've done is, after a point is logged, the significant motion sensor is started. If there is any significant motion event within the next 60 seconds, when that 'triggered' happens, it'll record the time. When it comes time to start gps fixing for the next point, if there was any significant motion in the last 60 seconds, it'll start gps fixing. Else it'll say the "will not log", so it doesn't even start fixing.

If there was significant motion, and it started gps fixing, and it acquired a point, then after that point is acquired, starts the significant motion sensor again. So actually it's better to think of it as a significant motion listener.

mendhak avatar Apr 15 '25 18:04 mendhak

Then I am confused about the difference between these messages:

First:

  • Setting up significant motion sensor
  • GPS coordinate, altitude, accuracy
  • Filename Repeated like 50 times in a minute Shouldn't it say "triggered" since it recorded.

Second:I only saw this once

  • Setting up significant motion sensor
  • Triggered But it didn't record anything, afterwards it said:
  • Intent received - Get Next Point
  • No movement detected in the past interval, will not log If it triggered, shouldn't it have recorded something?

eng3 avatar Apr 15 '25 19:04 eng3

The very first point will just be recorded as normal, as there's no previous 'trigger' to compare against.

But when you say "Repeated like 50 times in a minute" was the filename repeated a lot?

The triggered would only appear when motion was detected. So in your second case it should have recorded something, yes.

So now I'm also confused.

mendhak avatar Apr 15 '25 19:04 mendhak

Do you have passive logging enabled?

mendhak avatar Apr 15 '25 19:04 mendhak

"passive logging"?

eng3 avatar Apr 16 '25 08:04 eng3

Another thing I've noticed. There is a "distance filter" but something like a "time filter" based on speed would probably be more useful. The other day I had a very large file because I was in an airplane most of the day.

As a hobby, I actually use an app to create gps tracks of all my flights over the years. I use an app called Locus. There is a Distance interval and a time interval I can set. I can then say recording condition based on one OR the other or both (AND). Other options it has "Record only when moving"

If I'm standing still, I don't want to log any points. If I'm walking, I may want to log points at a closer distance. If I'm in a car, the distance between points can probably greater. If I'm in an airplane, the distance between points can be far greater. Thus it would be useful of the distance filter to be based on speed. For me, I might want to record a point every few minutes no matter what speed I am going. So that distance could be very short if moving slow or very large if moving fast.

Something to consider

eng3 avatar Apr 16 '25 09:04 eng3

Oh if you're not familiar with passive logging it probably isn't that. I was trying to figure out why you saw the file name repeated 50 times, that's quite unusual.

mendhak avatar Apr 16 '25 18:04 mendhak

Another thing I've noticed. There is a "distance filter" but something like a "time filter" based on speed would probably be more useful. The other day I had a very large file because I was in an airplane most of the day.

As a hobby, I actually use an app to create gps tracks of all my flights over the years. I use an app called Locus. There is a Distance interval and a time interval I can set. I can then say recording condition based on one OR the other or both (AND). Other options it has "Record only when moving"

If I'm standing still, I don't want to log any points. If I'm walking, I may want to log points at a closer distance. If I'm in a car, the distance between points can probably greater. If I'm in an airplane, the distance between points can be far greater. Thus it would be useful of the distance filter to be based on speed. For me, I might want to record a point every few minutes no matter what speed I am going. So that distance could be very short if moving slow or very large if moving fast.

Something to consider

I do understand this, but it's just not possible in this app, it's very 'rigid' in all the assumptions made. Complexity aside, the speed often captured isn't reliable enough to be making judgment calls to increase or decrease the interval.

Thanks for clarifying though, yes it doesn't appear this feature is entirely for you. The closest I can think of would be profiles, where different time intervals are set for different profiles, and you'd have to switch between profiles manually or via another app.

mendhak avatar Apr 16 '25 18:04 mendhak

Hmm profiles do look promising. Being able to trigger switch of profiles by location range speed range, etc would be nice.

Message ID: @.***>

eng3 avatar Apr 16 '25 19:04 eng3

You mention switching profiles "via another app". How can this be done?

On Wed, Apr 16, 2025, 20:47 mendhak @.***> wrote:

Another thing I've noticed. There is a "distance filter" but something like a "time filter" based on speed would probably be more useful. The other day I had a very large file because I was in an airplane most of the day.

As a hobby, I actually use an app to create gps tracks of all my flights over the years. I use an app called Locus. There is a Distance interval and a time interval I can set. I can then say recording condition based on one OR the other or both (AND). Other options it has "Record only when moving"

If I'm standing still, I don't want to log any points. If I'm walking, I may want to log points at a closer distance. If I'm in a car, the distance between points can probably greater. If I'm in an airplane, the distance between points can be far greater. Thus it would be useful of the distance filter to be based on speed. For me, I might want to record a point every few minutes no matter what speed I am going. So that distance could be very short if moving slow or very large if moving fast.

Something to consider

I do understand this, but it's just not possible in this app, it's very 'rigid' in all the assumptions made. Complexity aside, the speed often captured isn't reliable enough to be making judgment calls to increase or decrease the interval.

Thanks for clarifying though, yes it doesn't appear this feature is entirely for you. The closest I can think of would be profiles https://gpslogger.app/#whatareprofiles, where different time intervals are set for different profiles, and you'd have to switch between profiles manually or via another app.

— Reply to this email directly, view it on GitHub https://github.com/mendhak/gpslogger/issues/1208#issuecomment-2810429922, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFC27RD7XTQUQGQPPJHCV7T2Z2QS5AVCNFSM6AAAAABZZEM622VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMJQGQZDSOJSGI . You are receiving this because you authored the thread.Message ID: @.***> mendhak left a comment (mendhak/gpslogger#1208) https://github.com/mendhak/gpslogger/issues/1208#issuecomment-2810429922

Another thing I've noticed. There is a "distance filter" but something like a "time filter" based on speed would probably be more useful. The other day I had a very large file because I was in an airplane most of the day.

As a hobby, I actually use an app to create gps tracks of all my flights over the years. I use an app called Locus. There is a Distance interval and a time interval I can set. I can then say recording condition based on one OR the other or both (AND). Other options it has "Record only when moving"

If I'm standing still, I don't want to log any points. If I'm walking, I may want to log points at a closer distance. If I'm in a car, the distance between points can probably greater. If I'm in an airplane, the distance between points can be far greater. Thus it would be useful of the distance filter to be based on speed. For me, I might want to record a point every few minutes no matter what speed I am going. So that distance could be very short if moving slow or very large if moving fast.

Something to consider

I do understand this, but it's just not possible in this app, it's very 'rigid' in all the assumptions made. Complexity aside, the speed often captured isn't reliable enough to be making judgment calls to increase or decrease the interval.

Thanks for clarifying though, yes it doesn't appear this feature is entirely for you. The closest I can think of would be profiles https://gpslogger.app/#whatareprofiles, where different time intervals are set for different profiles, and you'd have to switch between profiles manually or via another app.

— Reply to this email directly, view it on GitHub https://github.com/mendhak/gpslogger/issues/1208#issuecomment-2810429922, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFC27RD7XTQUQGQPPJHCV7T2Z2QS5AVCNFSM6AAAAABZZEM622VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMJQGQZDSOJSGI . You are receiving this because you authored the thread.Message ID: @.***>

eng3 avatar Apr 23 '25 05:04 eng3

It can be done through other apps like llama or tasker. Have a look at https://gpslogger.app/#howdoesthisintegratewithtaskerllamaorotherautomationframeworks

mendhak avatar Apr 23 '25 06:04 mendhak

Thanks, I'm able send intents to get it to change the profile and also increase the distance filter to greater than 9999. Can we get more information broadcasted? (ie. speed, lat, lon, time of last fix, etc)

If I sendintent (getstatus), should I get a broadcast event? that doesnt seem to be working for me.

eng3 avatar Apr 26 '25 13:04 eng3

I tested this significant_motion feature (V134) on 3 different phones and it does not work very precise. I have a 20sec polling frequency. In general I see a lot of "No movement detected in the past interval, will not log" in my logs, even when moving (car) or wallking. Sometimes it works and logs for a few minutes when moving and then after a short stop it shows again "no movement detected" although walking again for minutes.

Suspect this Android significant_motion trigger is not sensitive enough (or some of these trigger events are not always captured by gpslogger?).

zimmerik avatar Jun 30 '25 12:06 zimmerik

An experimental setting has been added that makes use of significant motion sensor. The crap news is that it behaves wildly differently on different phones, the 'significant' bit is determined by something, but I can't tell what, it's not well documented.

@zimmerik thanks for testing it. I noticed similar. In some cases it would detect a few times and then give up, in some cases it has been very reliable. I tried on a Nexus 5, 6, 8. 5 was intermittent, 6 was OK sometimes, and 8 has been quite reliable. I just wish there were some documentation around it or at least clarification that the significant bit is up to the manufacturers' discretion, anything like that.

v134 is now in the releases and Fdroid

mendhak avatar Jul 05 '25 08:07 mendhak