OpenTracks icon indicating copy to clipboard operation
OpenTracks copied to clipboard

Since V4.90 movement detection inactive

Open lsuhrbier opened this issue 1 year ago • 28 comments

Since the update to V4.90 the app can not distinguish anymore between movement time and overall time.

After having started a track and going to a bike tour, both times are always the same. Before, the movement time stopped automatically on stops. I configured an idle time (which is only possible for GPS, but not for bluetooth sensors), but this appears not to have any impact. I am using a bluetooth speed sensor.

Nevertheless, the app appears to track it. When I change to OSM Dashboard to watch my track, I can see a lot of coffee cups there, but no time differences between movement and overall time.

lsuhrbier avatar Nov 05 '23 16:11 lsuhrbier

The idle time should apply to all sensors (it is still in the wrong place in the settings though). Can you check if idle gets detected by enabling the voice announcements for idle?

dennisguse avatar Nov 06 '23 06:11 dennisguse

I checked it today and turned most voice announcements on. But I got no idle announcements, just average speed, heart frequency etc.

But regarding heart frequency, may be I have an idea. I always use the app with bluetooth heart frequency sensor. As you mentioned idle time applies to all sensors, may be idle detection also does in the new release ? And the heart frequency sensor does not stop sending data when movement has stopped... So, may be that's the problem ?

lsuhrbier avatar Nov 06 '23 17:11 lsuhrbier

Actually, that might be the problem. Can you try without the heartrate sensor?

dennisguse avatar Nov 06 '23 20:11 dennisguse

I tried without heartrate sensor today. But no change. I don't get any idle-announcements and both times are identical during the whole track.

lsuhrbier avatar Nov 08 '23 17:11 lsuhrbier

I also noticed this issue. When riding my bike I use Wahoo speed+candence sensors as well as heartrate sensor. Right now sitting at my desk and it still thinks I am moving. Even when removing all the bluetooth sensors in the settings, it still detects as moving. The only sensor I was not able to deactivate is the barometric sensor (Pixel 6a). Maybe that one can trigger this issue?

Edit: I also have the issue of wrong elevation detection (shaking the phone makes it climb up) which in other issues get referred to broken barometric sensor. Maybe this is also relevant for the movement detection. In my test the phone was lying flat.

Mats391 avatar Nov 09 '23 08:11 Mats391

I use a Pixel 5 5G. As far as I know and according to https://www.android-user.de/im-test-google-pixel-5-5g-das-vernuenftige-solide-google-phone/ it has no barometric sensor.

lsuhrbier avatar Nov 09 '23 15:11 lsuhrbier

I think it does. I just called it wrong. That article lists "Barometer" under Sensoren and gsmarena also lists it for Pixel 5 and Pixel 5A 5g https://www.gsmarena.com/google_pixel_5-10386.php https://www.gsmarena.com/google_pixel_5a_5g-11059.php

Mats391 avatar Nov 09 '23 16:11 Mats391

Ok, checked it with the Barometer App from Google Play Store. It appears to have a barometer sensor, as it shows pressure without GPS enabled/allowed.

lsuhrbier avatar Nov 09 '23 17:11 lsuhrbier

You might be right; the relevant code is in TrakRecordingManager.onNewTrackPoint().

There is a timer that is started and if it triggers idle is assumed. Maybe I missed a case for using other sensors.

dennisguse avatar Nov 09 '23 21:11 dennisguse

I did some more testing and in addition to removing all Bluetooth sensors, I used the developer options to disable all internal sensors. Even with no sensors at all, it still does not detect idle.

Mats391 avatar Nov 25 '23 20:11 Mats391

Then my next guess is some kind of powersaving. Can you check what happens if the display is on?

And do you use the idle announcements?

dennisguse avatar Nov 25 '23 20:11 dennisguse

I noticed a flaw in my testing. If you never moved and everything stays at 0, it never switches to idle. I redid the testing by first moving a bit and then sitting down. That way the idle got detected correctly and moving time did no longer climb. With this setting I tested so far:

  • No Bluetooth Sensors + Sensors off: Detection works
  • No Bluetooth Sensors + Sensors on: Detection works. Even shaking phone to trigger barometer bug does not restart moving time
  • Added heart rate sensor: Detection works

All tests were done with screen active and idle announcements off. This makes it look like it might be related to speed or cadence sensor. I will test those later today when I am back on the bike.

Mats391 avatar Nov 28 '23 07:11 Mats391

Did testing on the bike with the different sensors:

  • GPS + Heart rate: Idle works
  • GPS + Heart rate + Cadance: Idle works
  • Speed + Heart rate + Cadance: Idle does not work
  • Speed + Heart rate: Idle does not work
  • Only Speed: Idle does not work
  • Only Speed + Sensors off: Idle does not work

So in my case the problem seems to be coming from the speed sensor.

Mats391 avatar Nov 28 '23 19:11 Mats391

Nice digging! The speed sensor actually provides distance, so we need to check that we handle it correctly if it doesnt report any movement.

dennisguse avatar Nov 28 '23 20:11 dennisguse

I checked the latest version today(i.e. 5563, v4.9.8). It looks like idle recognition works now as expected including idle-announcements.

But, there are other problems now.

  • Cadence display shows drop outs (just shows '-' like as it is not connected) in irregular intervals of 1-5 sec.
  • After a couple of idle recognitions, or whenever stopping tracking manually the application crashes.
  • It is possible to continue a track after a crash, but then neither speed nor cadence sensors are reconnecting successfully. Speed is then tracked using GPS, cadence is not tracked, heart frequency continues to be tracked as usual.

lsuhrbier avatar Dec 27 '23 17:12 lsuhrbier

@lsuhrbier Thanks for the report. Please upgrade to v4.9.9 (released today) as it contains some fixes against crashes. The sensor subsystem was created twice and thus not correctly shutdown. This might also result in the issue of reconnecting not working.

The cadence problem is tracked here: #1790 As I have no sensor at hand, I have hard to time to check this easily. I hope I have some time next week (and a sensor).

dennisguse avatar Dec 27 '23 17:12 dennisguse

I can confirm that with 4.9.9-16 nightly the movement detection worked for me.

Mats391 avatar Dec 28 '23 18:12 Mats391

Idle recognition does not work anymore.

Even though, the voice says "becoming idle", boths clocks are showing the same time, the average speed continuously goes down when having stopped and the speed and cadence display are probably show the last measured values (speed or frequency) before movement has been stopped.

lsuhrbier avatar Feb 07 '24 17:02 lsuhrbier

~~@lsuhrbier I can confirm this behavior.~~ ~~It is in TrackRecordingManager:203; it used to store sensor data if these do not provide a location/or distance.~~ ~~This happens every 10s (hardcoded), so idle would not be triggered at all if a sensor like heartrate is connected.~~

~~We have the following options:~~ ~~1. remove functionality to store sensor data if no movement is happening~~ ~~2. restrict this functionality to only store while moving aka not idle (interesting for cadence/power/barometer)~~ ~~3. keep functionality but actually fix moving time (interesting mainly for heartrate to measure recovery behavior)~~

~~@lsuhrbier What do you think?~~

I have found the tests cases. Option 3. is already implemented. I am digging further.

dennisguse avatar Apr 01 '24 17:04 dennisguse

Ok, please keep digging !!! Regarding the options, I just can say that i am using BT-heartrate, cadence and speed sensors when using it to track my bike tours.

Option 1 and 2 appear to me to finally offering the same functionality, i.e. not saving any sensor data when not moving. Both options are not offering the expected behaviour, but would be better than the current situation.

I do not really understand, what's option 3's impact is (fix moving time?).

Hope you can solve the problem somehow.

lsuhrbier avatar Apr 03 '24 14:04 lsuhrbier

Hi. FYI, I have the same issue on Pixel 3a, using latest version (v.4.12.3 updated today....unfortunately :-( ). Not using any Bluetooth device, just the phone. Thank You.

G-i-o avatar May 09 '24 19:05 G-i-o

Same issue here, on a Moto Razr Plus, no bluetooth anything. I hear "Becoming idle" quite often, but the "total movement time" is identical to actual time. April 13 worked; 20th didn't.

Maybe we should make a separate issue?

keraba avatar May 10 '24 17:05 keraba

I did a downgrade to 4.11.3 from 4.12.3. This was the last version with working idle detection (for me).

KN4CK3R avatar May 18 '24 18:05 KN4CK3R

I did some tests on different devices (Xiaomi Redmi A2 and Fairphone 5). On both of them I could get different "moving time" and "global time" with v4.12.1 and prior, but not with v4.12.2 or v4.12.3. I didn't try to get the "Becoming idle" message though.

I'm guessing v4.12.2 probably broke something.

CastelJeremy avatar May 25 '24 14:05 CastelJeremy

I have the same issue and it appeared around May 2. Before that moving time was shorter than total time like it should. Version: v4.12.3 OS: GrapheneOS

Random90 avatar May 25 '24 21:05 Random90

For me the idle detection functionality apparently stopped working in an update between April 19th (last recording with time and speed in motion ok) and April 21.

Checking the recorded tracks I have noticed that idle detection is actually working (only are recorded positions when there is movement), but for some reason, the same values of time and speed are shown, both in movement and total.

The problem seems to be (at least in my case) in the calculation and/or display of statistics in motion.

vlmendz avatar May 26 '24 01:05 vlmendz

In my case Opentracks does not report a zero value from my speed sensor, instead it holds the last speed value from the speed sensor, which tricks the app into thinking that there is movement. Unparing the speed sensor restores movement detection, as mentioned by Mats391 in his post.

OMTDesign avatar Jun 10 '24 06:06 OMTDesign

For me movement detection stopped working between the 28th of December and the 15th of January. Since January there was also no tracking of altitude anymore. Sadly I cannot remember changing any settings that may have led to that behavior. I never used any external sensors though. For the last two runs I changed the Barometer from "none" to "internal sensor" but it didn't help regarding the movement detection.

christfried avatar Jun 13 '24 15:06 christfried

Took quite a while, but this got finally fixed. Released in https://github.com/OpenTracksApp/OpenTracks/releases/tag/v4.12.5

dennisguse avatar Jul 06 '24 11:07 dennisguse

Checked it a couple of times and can say that idle detection is working now ! Congrats !!!

But, some (minor) problems left. When having stopped with idle detection, non-zero values are reported from speed and cadence sensors. It appears, the last measured values are shown and not reset to zero or not read again from the sensor after idle detection detected a stop.

lsuhrbier avatar Jul 31 '24 16:07 lsuhrbier