InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

InfiniTime sends Steps count from the previous day in some cases

Open ITCactus opened this issue 3 years ago • 5 comments

Verification

  • [X] I searched for similar bug reports and found none was relevant.

What happened?

InfiniTime sends Steps count from the previous day in some cases

What should happen instead?

InfiniTime should count from 0 after midnight

Reproduction steps

so far there are 2 cases discovered where InfiniTime sends wrong steps count to Step count characteristic subscriber (e.g. companion app Gadgetbridge):

case 1

  1. make some steps (e.g. 1000 steps) on day 1.
  2. unlock PineTime before midnight to make sure steps are synced.
  3. after the midnight (e.g. in the morning) receive notification to the PineTime (e.g. incoming call, or use "fing lost device" in Gadgetbridge)
  4. InfiniTime sends step count from the previous day (1000 steps in this case) before reset the steps counter. that won't happen if you just unlock the PineTime. it's specifically related to the case with notification.

case 2 (probable the issue #787. see this comment)

  1. make some steps (e.g. 1000 steps) on day 1.
  2. unlock PineTime before midnight to make sure steps are synced.
  3. after the midnight (e.g. in the morning or overnight) make some steps (e.g. 50 steps) without unlocking PineTime.
  4. unlock PineTime, and it will send 2 steps count in less that a second:
    • 1st one - combined values from previous day plus outstanding steps from the new day (1000 + 50 -> 1050steps)
    • 2nd one - zeroed value (literally "0"). also InfiniTime displays "0" steps. that means all steps from the day 2 before the unlock (50 steps) are gone/zeroed.

More details?

there is a discussion about that issues and workaround on Gadgetbridge side (Gadgetbridge#2783).

Version

1.10

Companion app

No response

ITCactus avatar Aug 10 '22 13:08 ITCactus

MotionService uses MotionController, but stepCounterMustBeReset is in SystemTask, not in MotionController. Therefore, the midnight-information does not exist for BLE.

minacode avatar Aug 11 '22 09:08 minacode

@ITCactus it feel like , it sending the trip value since it's the only one that add step between days

lman0 avatar Aug 11 '22 18:08 lman0

I think the reset from the SystemTask just doesn't happen and the counter keeps on running.

minacode avatar Aug 11 '22 20:08 minacode

it feel like , it sending the trip value since it's the only one that add step between days

nope... some time ago i had the same thoughts, but i was not able to find the way to constantly repro the issue. therefore i quit attempts. but now, i can repro it ("case 2" from description). so i just verified the assumption about "Trip" value. on dev pinetime i had step counter "2530" synced before midnight. and "18458" as Trip counter. before midnight, without unlocking pinetime, i "made" about 10 steps. after the midnight i "made" another 20some steps. then unlocked the pinetime to make the steps sync. and in gadgetbridge logs i see values "2568" and "0" in less than a second. on pinetime now i have/see "0" steps and "18496" trip counter. so, it is not the trip counter synced.

ITCactus avatar Aug 12 '22 22:08 ITCactus

Can you check the linked PR? I do not use GadgetBridge, but would like to know if it solves this issue.

minacode avatar Sep 05 '22 14:09 minacode

Can you check the linked PR? I do not use GadgetBridge, but would like to know if it solves this issue.

@minacode not sure if you asked to check me... you do not have to use GadgetBridge to see the issue - any companion app with subscription to steps counter (MotionService) will be good for that. moreover, GadgetBridge has a workaround for that, so you probably will not be able to face the issue (as end user), and see it only in the logs.

i tried to install the InfiniTime DFU fix-step-count-midnight from CI #1854, and so far it works a bit weird: this time it sends the last synced steps count + outstanding steps count (instead of "0") in less than a second. taking as an example from the previous comment:

  • prev: sends 2 values "2568" and "0" in less than a second
  • now: sends 2 values "2530" and "2568" in less than a second

and that breaks the GadgetBridge workaround.

ITCactus avatar Oct 05 '22 11:10 ITCactus

Thank you for the input. I will try to figure this out.

minacode avatar Oct 05 '22 11:10 minacode

Hi @ITCactus and @minacode I also noticed the same issue during developing eventlog feature which captures different data then send it via BLE later by request. So I found that stored step counter is keeping the same after midnight unless I wake up the screen of watches. Usually I wake up screen at 6-8am to see when I woke up. But today I forget to do it and did it first time at 8pm after a little hike, so I expected to see ~10k steps, but it was reset to 0 immediately I pressed the button. There is some data from my eventlog for a few last days which shows time when step counter was reset:

14/12/2022 06:29:59 Steps: 13660
14/12/2022 06:59:59 Steps: 13660
14/12/2022 07:29:59 Steps: 13660
14/12/2022 07:59:59 Steps: 13660
14/12/2022 08:29:59 Steps: 13660
14/12/2022 08:59:59 Steps: 13660
14/12/2022 09:29:59 Steps: 0
14/12/2022 09:59:59 Steps: 0
14/12/2022 10:29:59 Steps: 0
14/12/2022 10:59:59 Steps: 0
14/12/2022 11:29:59 Steps: 0
14/12/2022 11:59:59 Steps: 0
14/12/2022 12:29:59 Steps: 0
14/12/2022 12:59:59 Steps: 0
14/12/2022 13:29:59 Steps: 0
14/12/2022 13:59:59 Steps: 0
14/12/2022 14:30:00 Steps: 0
14/12/2022 15:00:00 Steps: 0
14/12/2022 15:30:00 Steps: 0
14/12/2022 16:00:00 Steps: 1150
14/12/2022 16:30:00 Steps: 1150
14/12/2022 17:00:00 Steps: 1150
14/12/2022 17:30:00 Steps: 1150
14/12/2022 18:00:00 Steps: 2714
14/12/2022 18:30:00 Steps: 2714
14/12/2022 19:00:00 Steps: 2714
14/12/2022 19:30:00 Steps: 2714
14/12/2022 20:00:00 Steps: 2714
14/12/2022 20:30:00 Steps: 2714
14/12/2022 21:00:00 Steps: 2714
14/12/2022 21:30:00 Steps: 2714
14/12/2022 22:00:00 Steps: 2714
14/12/2022 22:30:00 Steps: 2714
14/12/2022 23:00:00 Steps: 2714
14/12/2022 23:30:00 Steps: 2714
15/12/2022 00:00:00 Steps: 2714
15/12/2022 00:30:00 Steps: 2714
15/12/2022 01:00:00 Steps: 2714
15/12/2022 01:30:00 Steps: 2714
15/12/2022 02:00:00 Steps: 2714
15/12/2022 02:30:00 Steps: 2714
15/12/2022 02:59:59 Steps: 2714
15/12/2022 03:29:59 Steps: 2714
15/12/2022 03:59:59 Steps: 2714
15/12/2022 04:29:59 Steps: 2714
15/12/2022 04:59:59 Steps: 2714
15/12/2022 05:29:59 Steps: 2714
15/12/2022 05:59:59 Steps: 2714
15/12/2022 06:29:59 Steps: 2714
15/12/2022 06:59:59 Steps: 2714
15/12/2022 07:29:59 Steps: 2714
15/12/2022 07:59:59 Steps: 0
15/12/2022 08:29:59 Steps: 0
15/12/2022 08:59:59 Steps: 0
15/12/2022 09:29:59 Steps: 654
15/12/2022 09:59:59 Steps: 654
15/12/2022 10:29:59 Steps: 654
15/12/2022 10:59:59 Steps: 654
15/12/2022 11:29:59 Steps: 654
15/12/2022 11:59:59 Steps: 812
15/12/2022 12:29:59 Steps: 812
15/12/2022 12:59:59 Steps: 812
15/12/2022 13:29:59 Steps: 1024
15/12/2022 13:59:59 Steps: 4268
15/12/2022 14:29:59 Steps: 4268
15/12/2022 14:59:59 Steps: 4268
15/12/2022 15:29:59 Steps: 4328
15/12/2022 15:59:59 Steps: 4328
15/12/2022 16:29:59 Steps: 4328
15/12/2022 17:00:00 Steps: 4564
15/12/2022 17:30:00 Steps: 4564
15/12/2022 17:59:59 Steps: 4846
15/12/2022 18:29:59 Steps: 4846
15/12/2022 18:59:59 Steps: 4846
15/12/2022 19:29:59 Steps: 4846
15/12/2022 19:59:59 Steps: 4846
15/12/2022 20:29:59 Steps: 4846
15/12/2022 20:59:59 Steps: 4846
15/12/2022 21:29:59 Steps: 4846
15/12/2022 21:59:59 Steps: 4846
15/12/2022 22:29:59 Steps: 4846
15/12/2022 22:59:59 Steps: 4846
15/12/2022 23:29:59 Steps: 4846
15/12/2022 23:59:59 Steps: 4846
16/12/2022 00:29:59 Steps: 4846
16/12/2022 00:59:59 Steps: 4846
16/12/2022 01:29:59 Steps: 4846
16/12/2022 01:59:59 Steps: 4846
16/12/2022 02:29:59 Steps: 4846
16/12/2022 02:59:59 Steps: 4846
16/12/2022 03:29:59 Steps: 4846
16/12/2022 03:59:59 Steps: 4846
16/12/2022 04:29:59 Steps: 4846
16/12/2022 04:59:59 Steps: 4846
16/12/2022 05:29:59 Steps: 4846
16/12/2022 05:59:59 Steps: 4846
16/12/2022 06:29:59 Steps: 4846
16/12/2022 06:59:59 Steps: 0
16/12/2022 07:29:59 Steps: 346
16/12/2022 07:59:59 Steps: 346
16/12/2022 08:29:59 Steps: 1008
16/12/2022 08:59:59 Steps: 1790
16/12/2022 09:29:59 Steps: 2270
16/12/2022 09:59:59 Steps: 2430
16/12/2022 10:29:59 Steps: 2430
16/12/2022 10:59:59 Steps: 2430
16/12/2022 11:29:59 Steps: 2430
16/12/2022 11:59:59 Steps: 2430
16/12/2022 12:29:59 Steps: 4166
16/12/2022 12:59:59 Steps: 4166
16/12/2022 13:29:59 Steps: 4166
16/12/2022 13:59:59 Steps: 5074
16/12/2022 14:29:59 Steps: 5074
16/12/2022 14:59:59 Steps: 5074
16/12/2022 15:29:59 Steps: 5074
16/12/2022 15:59:59 Steps: 5074
16/12/2022 16:29:59 Steps: 5074
16/12/2022 16:59:59 Steps: 5074
16/12/2022 17:29:59 Steps: 5074
16/12/2022 17:59:59 Steps: 6142
16/12/2022 18:29:59 Steps: 6142
16/12/2022 18:59:59 Steps: 6142
16/12/2022 19:29:59 Steps: 6618
16/12/2022 19:59:59 Steps: 6618
16/12/2022 20:29:59 Steps: 7032
16/12/2022 20:59:59 Steps: 7374
16/12/2022 21:29:59 Steps: 7628
16/12/2022 21:59:59 Steps: 7628
16/12/2022 22:29:59 Steps: 7628
16/12/2022 22:59:59 Steps: 7628
16/12/2022 23:29:59 Steps: 7628
16/12/2022 23:59:59 Steps: 7628
17/12/2022 00:29:59 Steps: 7628
17/12/2022 00:59:59 Steps: 7628
17/12/2022 01:29:59 Steps: 7628
17/12/2022 01:59:59 Steps: 7628
17/12/2022 02:29:59 Steps: 7628
17/12/2022 02:59:59 Steps: 7628
17/12/2022 03:29:59 Steps: 7628
17/12/2022 03:59:59 Steps: 7628
17/12/2022 04:29:59 Steps: 7628
17/12/2022 04:59:59 Steps: 7628
17/12/2022 05:30:00 Steps: 7628
17/12/2022 06:00:00 Steps: 7628
17/12/2022 06:30:00 Steps: 7628
17/12/2022 07:00:00 Steps: 7628
17/12/2022 07:30:00 Steps: 7628
17/12/2022 08:00:00 Steps: 7628
17/12/2022 08:30:00 Steps: 7628
17/12/2022 09:00:00 Steps: 0
17/12/2022 09:30:00 Steps: 0
17/12/2022 10:00:00 Steps: 0
17/12/2022 10:30:00 Steps: 0
17/12/2022 11:00:00 Steps: 0
17/12/2022 11:30:00 Steps: 0
17/12/2022 12:00:00 Steps: 0
17/12/2022 12:30:00 Steps: 0
17/12/2022 13:00:00 Steps: 0
17/12/2022 13:30:00 Steps: 4222
17/12/2022 14:00:00 Steps: 4800
17/12/2022 14:30:00 Steps: 4800
17/12/2022 15:00:00 Steps: 4800
17/12/2022 15:30:00 Steps: 4800
17/12/2022 16:00:00 Steps: 4800
17/12/2022 16:30:00 Steps: 4800
17/12/2022 17:00:00 Steps: 4800
17/12/2022 17:30:00 Steps: 4800
17/12/2022 17:59:59 Steps: 4800
17/12/2022 18:29:59 Steps: 4800
17/12/2022 18:59:59 Steps: 4800
17/12/2022 19:29:59 Steps: 4800
17/12/2022 19:59:59 Steps: 4800
17/12/2022 20:29:59 Steps: 4800
17/12/2022 20:59:59 Steps: 4800
17/12/2022 21:29:59 Steps: 4800
17/12/2022 21:59:59 Steps: 4800
17/12/2022 22:29:59 Steps: 4800
17/12/2022 22:59:59 Steps: 4800
17/12/2022 23:29:59 Steps: 4800
17/12/2022 23:49:59 Steps: 4800
18/12/2022 00:19:59 Steps: 4800
18/12/2022 00:49:59 Steps: 4800
18/12/2022 01:19:59 Steps: 4800
18/12/2022 01:49:59 Steps: 4800
18/12/2022 02:19:59 Steps: 4800
18/12/2022 02:49:59 Steps: 4800
18/12/2022 03:19:59 Steps: 4800
18/12/2022 03:49:59 Steps: 4800
18/12/2022 04:19:59 Steps: 4800
18/12/2022 04:49:59 Steps: 4800
18/12/2022 05:19:59 Steps: 4800
18/12/2022 05:49:59 Steps: 4800
18/12/2022 06:19:59 Steps: 4800
18/12/2022 06:49:59 Steps: 4800
18/12/2022 07:19:59 Steps: 4800
18/12/2022 07:49:59 Steps: 4800
18/12/2022 08:19:59 Steps: 4800
18/12/2022 08:49:59 Steps: 4800
18/12/2022 09:19:59 Steps: 4800
18/12/2022 09:49:59 Steps: 4800
18/12/2022 10:19:59 Steps: 4800
18/12/2022 10:49:59 Steps: 4800
18/12/2022 11:19:59 Steps: 4800
18/12/2022 11:49:59 Steps: 4800
18/12/2022 12:19:59 Steps: 4800
18/12/2022 12:49:59 Steps: 4800
18/12/2022 13:19:59 Steps: 4800
18/12/2022 13:49:59 Steps: 4800
18/12/2022 14:19:59 Steps: 4800
18/12/2022 14:49:59 Steps: 4800
18/12/2022 15:19:59 Steps: 4800
18/12/2022 15:49:59 Steps: 4800
18/12/2022 16:19:59 Steps: 4800
18/12/2022 16:49:59 Steps: 4800
18/12/2022 17:19:59 Steps: 4800
18/12/2022 17:49:59 Steps: 4800
18/12/2022 18:19:59 Steps: 4800
18/12/2022 18:49:59 Steps: 4800
18/12/2022 19:19:59 Steps: 4800
18/12/2022 19:49:59 Steps: 4800
18/12/2022 20:19:59 Steps: 390

AlexXZero avatar Dec 18 '22 07:12 AlexXZero

Thank you for the data! The reset of the step counter hardware happens on wake-up. I would still like to know why that is necessary. But given that your data are "correct". What should be improved in your case is that the software ignores the hardware values and returns zero once midnight was reached, right? Our we reset the hardware on midnight. I don't know about that.

minacode avatar Dec 18 '22 09:12 minacode