Open Uatschitchun opened 2 years ago
Cadence is calculated from the stepcounter, averaged with a filter. I would expect that the sensor reports that the sensor is updated but do not actually update the count normally but only in steps. This seems quite weird. However, I will try to make a fix with this assumption.
Anything I can provide to help?
Anything I can provide to help?
No, the filtering etc is internal. I plan to create a beta release in some weeks with some more changes (as usual, Google required changes requires most of the time I have available, so not much new user changes), including this.
I'll check the 2.4.0.0 pre-release once I'm out for a run!
Was able to test and it seems better, but not fixed. If you like to, I could send the tcx by mail to check. It has total step count correct as it seems, but few exorbitant values still appear and it seems to have only recorded the first 2km!?
Was able to test and it seems better, but not fixed. If you like to, I could send the tcx by mail to check.
Filtering is done deeper in the application (the phone should send update at every new step), so the processed and filtered data will not help. Will take a look again.
It has total step count correct as it seems, but few exorbitant values still appear and it seems to have only recorded the first 2km!?
If no data is recorded, then no data is delivered. Huawei is doing something here...
Here's a screenshot
I found an implementation which seems to be working: https://github.com/j4velin/Pedometer/blob/master/src/main/java/de/j4velin/pedometer/SensorListener.java
Have the app installed and it seems to count steps correctly, from first glance.
I even found this video explaining different implementations: https://m.youtube.com/watch?v=8Wku0jvnXEA
Don't know if it is of any help...
I do not think the counted steps is (much) incorrect in general, but the reported time is occasionally incorrect from step to step. The reported value must be smoothed too, otherwise the value is expected to jump quite some.
It could be that the sensor is "sleeping" occasionally and not reporting in time, then the cadence will be strange and affect the filter. The sensor API has a function "accuracyChanged that maybe should be handled, assuming that the time is off after that. Also old values should be ignored as well as unreasonable high values (over 300 rpm or so).
I am sure that someone will look at this code and ask why so weird checks were applied... So another update.
As said, the implementation from j4velin seems to be working well, although it just count steps over a long period. Btw, my wife's recording shows the same behavior (Honor 6x).
If I read correctly, there are 2 possibilities to read counted steps: to read each counted step (on change) or to read a bunch of counted steps.
Sad to say, but even with latest changes, cadence isn't as expected ...
This is Runalyze:
This is Tredict:
In that case the raw trace from the sensor is needed. I will look into something later, for you to test in a private build.
Ideally we would add some debug logging to a file, so it could be tested out in the fields.
I've tried a few sensor test tools and all report proper changes in step counts:
I do not think that counting steps is a problem, if RU counted steps it would be the same answer. The problem is how Android reports changes to RU, if there are "empty updates", delays or bundled reporting the calculated cadence will be incorrect. I tried to ignore incorrect values, but there is obviously something more special.
Thing is, I do not know any android app that records cadence when running. There are pedometer apps, yes, but maybe this is the reason why no app is providing cadence/strides!? Is step counting working for anyone correctly?
Cadence worked fine with my Moto X4 with Android 9 and Sony Xperia Z3 (Android 6), not with my just deceased Sony Xperia 5ii (trapped in a door) or the OnePlus 8T replacement (Android 11) (only 0 reading).
Hi there,
have an issue with using step counter on my Honor 20 pro. A intervall training I did of 7k, results in 810spm! Sadly Runnerup doesn't show cadence somewhere, but runalyze and tredict both come to same numbers!? What to do?![Screenshot_20210908_193245](https://user-images.githubusercontent.com/25088926/132557166-a395eece-467a-44fc-859e-b61e34fd50d9.jpg)