#1924 GTS + 0.45.1 = scrambled data?

Open
opened 3 weeks ago by eQuark2 · 13 comments
eQuark2 commented 3 weeks ago
name about
Bug report Create a report to help us improve

Before reporting a bug, please confirm the following:

I got Gadgetbridge from:

If you got it from Google Play, please note that version is unofficial and not supported here; it’s also often quite outdated. Please switch to one of the above versions if you can.

Your issue is:

The data displayed is very innacuarate. The activity display does not correspond to my activity; it reports I have not slept in days; reported steps per day are around 80,000. The gpx track and duration are OK, but my walking speed is meaningless (just a bunch of little spikes around 1 mph.)

Re: attached log file - connected to watch, then enabled logging - fetched activity data - disable logging

Your wearable device is:

Amazfit GTS
Firmware v0.0.9.11

Your android version is:

Android 7.1.2 (LineageOS 14)

Your Gadgetbridge version is:

0.45.1

New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.

--- name: Bug report about: Create a report to help us improve --- #### Before reporting a bug, please confirm the following: - [x] I have read the [wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki), and I didn't find a solution to my problem / an answer to my question. - [x] I have searched the [issues](https://codeberg.org/Freeyourgadget/Gadgetbridge/issues), and I didn't find a solution to my problem / an answer to my question. - [x] If you upload an image or other content, please make sure you have read and understood the [Codeberg Terms of Use](https://codeberg.org/codeberg/org/src/branch/master/TermsOfUse.md) ### I got Gadgetbridge from: * [x] F-Droid * [ ] I built it myself from source code (specify tag / commit) If you got it from Google Play, please note [that version](https://github.com/TaaviE/Gadgetbridge) is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can. #### Your issue is: The data displayed is very innacuarate. The activity display does not correspond to my activity; it reports I have not slept in days; reported steps per day are around 80,000. The gpx track and duration are OK, but my walking speed is meaningless (just a bunch of little spikes around 1 mph.) Re: attached log file - connected to watch, then enabled logging - fetched activity data - disable logging #### Your wearable device is: Amazfit GTS Firmware v0.0.9.11 #### Your android version is: Android 7.1.2 (LineageOS 14) #### Your Gadgetbridge version is: 0.45.1 *New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.*
ashimokawa commented 3 weeks ago
Owner

I do not have the device, you could either downgrade your firmware or build gadgetbridge yourself and help by running test versions.

I do not have the device, you could either downgrade your firmware or build gadgetbridge yourself and help by running test versions.
eQuark2 commented 3 weeks ago
Poster

Don’t know how to (or if I’d want to) downgrade...
Have never built an apk before, but willing to try. Downloaded the SDK (actually Android Studio). Just looking at the repository, there are a lot of branches... where would I start?

Don't know how to (or if I'd want to) downgrade... Have never built an apk before, but willing to try. Downloaded the SDK (actually Android Studio). Just looking at the repository, there are a lot of branches... where would I start?
ashimokawa commented 3 weeks ago
Owner

just build the master branch. You do not even have to run android studio, just do

./gradlew assembleDebug

just build the master branch. You do not even have to run android studio, just do ./gradlew assembleDebug
fabz31 commented 3 weeks ago

I would like to help on this issue (although I can’t be very responsive).

I have successfully build the apk with ./gradlew assembleDebug
I have read that I need to uninstall the f-droid version. That is not a problem.

What test can I do ?

I would like to help on this issue (although I can't be very responsive). I have successfully build the apk with ./gradlew assembleDebug I have read that I need to uninstall the f-droid version. That is not a problem. What test can I do ?
ashimokawa commented 3 weeks ago
Owner

@fabz31

Before installing you own build, you could also dump your scrambled database maybe that gives some hints (if you are root)

adb root
adb shell
cd /data/data/nodomain.freeyourgadget.gadgetbridge/databases/
sqlite Gadgetbridge
sqlite> select * from MI_BAND_ACTIVITY_SAMPLE order by timestamp desc limit 60;

That gives you the last hour of scrampled data (assuming you only have that device in the database or if you have multiple, the GTS is the last synced one)

You could paste it here maybe we see a pattern (like one value inserted which we can ignore for now)

@fabz31 Before installing you own build, you could also dump your scrambled database maybe that gives some hints (if you are root) ``` adb root adb shell cd /data/data/nodomain.freeyourgadget.gadgetbridge/databases/ sqlite Gadgetbridge sqlite> select * from MI_BAND_ACTIVITY_SAMPLE order by timestamp desc limit 60; ``` That gives you the last hour of scrampled data (assuming you only have that device in the database or if you have multiple, the GTS is the last synced one) You could paste it here maybe we see a pattern (like one value inserted which we can ignore for now)
eQuark2 commented 3 weeks ago
Poster

Here’s what I get with the above command:

sqlite> select * from MI_BAND_ACTIVITY_SAMPLE order by timestamp desc limit 60;
1595046120|2|1|0|128|6|0
1595046060|2|1|38|0|80|83
1595046000|2|1|0|128|6|0
1595045940|2|1|22|0|80|90
1595045880|2|1|0|128|6|0
1595045820|2|1|38|0|80|81
1595045760|2|1|0|128|6|0
1595045700|2|1|45|0|80|81
1595045640|2|1|0|128|6|0
1595045580|2|1|26|0|80|255
1595045520|2|1|0|128|6|0
1595045460|2|1|72|0|80|79
1595045400|2|1|0|128|6|0
1595045340|2|1|40|10|80|75
1595045280|2|1|0|128|6|0
1595045220|2|1|53|0|80|74
1595045160|2|1|0|128|4|0
1595045100|2|1|45|0|80|71
1595045040|2|1|0|128|4|0
1595044980|2|1|4|0|80|94
1595044920|2|1|0|128|4|0
1595044860|2|1|0|0|90|94
1595044800|2|1|0|128|4|0
1595044740|2|1|5|0|80|93
1595044680|2|1|0|128|4|0
1595044620|2|1|9|0|80|90
1595044560|2|1|0|128|6|0
1595044500|2|1|28|0|96|79
1595044440|2|1|0|128|6|0
1595044380|2|1|50|0|96|89
1595044320|2|1|0|128|6|0
1595044260|2|1|69|0|96|78
1595044200|2|1|0|128|6|0
1595044140|2|1|47|0|96|71
1595044080|2|1|0|128|6|0
1595044020|2|1|64|0|80|71
1595043960|2|1|0|128|6|0
1595043900|2|1|55|0|80|72
1595043840|2|1|0|128|6|0
1595043780|2|1|52|0|80|93
1595043720|2|1|0|128|6|0
1595043660|2|1|50|0|80|90
1595043600|2|1|0|128|4|0
1595043540|2|1|40|0|80|77
1595043480|2|1|0|128|4|0
1595043420|2|1|22|0|80|83
1595043360|2|1|0|128|6|0
1595043300|2|1|18|0|80|55
1595043240|2|1|0|128|6|0
1595043180|2|1|38|0|80|76
1595043120|2|1|0|128|6|0
1595043060|2|1|30|0|80|79
1595043000|2|1|0|128|6|0
1595042940|2|1|58|0|80|80
1595042880|2|1|0|128|6|0
1595042820|2|1|90|0|80|81
1595042760|2|1|0|128|6|0
1595042700|2|1|67|0|80|80
1595042640|2|1|0|128|6|0
1595042580|2|1|46|0|80|79
sqlite>

Hope it’s useful....

Here's what I get with the above command: sqlite> select * from MI_BAND_ACTIVITY_SAMPLE order by timestamp desc limit 60; 1595046120|2|1|0|128|6|0 1595046060|2|1|38|0|80|83 1595046000|2|1|0|128|6|0 1595045940|2|1|22|0|80|90 1595045880|2|1|0|128|6|0 1595045820|2|1|38|0|80|81 1595045760|2|1|0|128|6|0 1595045700|2|1|45|0|80|81 1595045640|2|1|0|128|6|0 1595045580|2|1|26|0|80|255 1595045520|2|1|0|128|6|0 1595045460|2|1|72|0|80|79 1595045400|2|1|0|128|6|0 1595045340|2|1|40|10|80|75 1595045280|2|1|0|128|6|0 1595045220|2|1|53|0|80|74 1595045160|2|1|0|128|4|0 1595045100|2|1|45|0|80|71 1595045040|2|1|0|128|4|0 1595044980|2|1|4|0|80|94 1595044920|2|1|0|128|4|0 1595044860|2|1|0|0|90|94 1595044800|2|1|0|128|4|0 1595044740|2|1|5|0|80|93 1595044680|2|1|0|128|4|0 1595044620|2|1|9|0|80|90 1595044560|2|1|0|128|6|0 1595044500|2|1|28|0|96|79 1595044440|2|1|0|128|6|0 1595044380|2|1|50|0|96|89 1595044320|2|1|0|128|6|0 1595044260|2|1|69|0|96|78 1595044200|2|1|0|128|6|0 1595044140|2|1|47|0|96|71 1595044080|2|1|0|128|6|0 1595044020|2|1|64|0|80|71 1595043960|2|1|0|128|6|0 1595043900|2|1|55|0|80|72 1595043840|2|1|0|128|6|0 1595043780|2|1|52|0|80|93 1595043720|2|1|0|128|6|0 1595043660|2|1|50|0|80|90 1595043600|2|1|0|128|4|0 1595043540|2|1|40|0|80|77 1595043480|2|1|0|128|4|0 1595043420|2|1|22|0|80|83 1595043360|2|1|0|128|6|0 1595043300|2|1|18|0|80|55 1595043240|2|1|0|128|6|0 1595043180|2|1|38|0|80|76 1595043120|2|1|0|128|6|0 1595043060|2|1|30|0|80|79 1595043000|2|1|0|128|6|0 1595042940|2|1|58|0|80|80 1595042880|2|1|0|128|6|0 1595042820|2|1|90|0|80|81 1595042760|2|1|0|128|6|0 1595042700|2|1|67|0|80|80 1595042640|2|1|0|128|6|0 1595042580|2|1|46|0|80|79 sqlite> Hope it's useful....
ashimokawa commented 3 weeks ago
Owner

Hi, looks like there is some extra data. I blindly tried to skip it (dont know yet what it means)

If you could try the gts-new-firmware branch, that would be great.

But beware:

  • If you compile and install, save your auth key! You will loose all data
  • The branch breaks code for all other huami devices and GTR/GTS with older firmware. It is purely for testing.
Hi, looks like there is some extra data. I blindly tried to skip it (dont know yet what it means) If you could try the gts-new-firmware branch, that would be great. But beware: - If you compile and install, save your auth key! You will loose all data - The branch breaks code for all other huami devices and GTR/GTS with older firmware. It is purely for testing.
eQuark2 commented 3 weeks ago
Poster

OK... built the gts-new-firmware with ./gradlew assembleDebug and installed it on a different device: Samsung Galaxy S5; Android 6.0.1. I had previously tried 0.45.1 on this device with the same scrambled data.

The activity/sleep/steps displays now appear to be correct, so looks like that worked. However, the speed in a gpx track from walking is still weird. (Altitude and distance seem OK).

I’ve attached an exported gpx file in case that helps. For reference, my usual walking speed is around 3.4 miles per hour.

OK... built the gts-new-firmware with ./gradlew assembleDebug and installed it on a different device: Samsung Galaxy S5; Android 6.0.1. I had previously tried 0.45.1 on this device with the same scrambled data. The activity/sleep/steps displays now appear to be correct, so looks like that worked. However, the speed in a gpx track from walking is still weird. (Altitude and distance seem OK). I've attached an exported gpx file in case that helps. For reference, my usual walking speed is around 3.4 miles per hour.
watto commented 3 weeks ago

I can confirm the (debug) version from this branch displays steps + sleep from a (force-updated on initial setup) GTS correctly.
I had to delete the database, though. Before that diagrams where empty. Did that by de-installing the 0.45.1 (master-debug) version.

I can confirm the (debug) version from this branch displays steps + sleep from a (force-updated on initial setup) GTS correctly. I had to delete the database, though. Before that diagrams where empty. Did that by de-installing the 0.45.1 (master-debug) version.
ashimokawa closed this issue 3 weeks ago
ashimokawa commented 3 weeks ago
Owner

@eQuark2

I’ve attached an exported gpx file in case that helps. For reference, my usual walking speed is around 3.4 miles per hour.

I do not see an attachment

@watto

Can you test the master branch now?

There is no need to delete your database if you switch branches which are both self-compiled

@eQuark2 > I’ve attached an exported gpx file in case that helps. For reference, my usual walking speed is around 3.4 miles per hour. I do not see an attachment @watto Can you test the master branch now? There is no need to delete your database if you switch branches which are both self-compiled
watto commented 3 weeks ago

Debug build of master seems to also work. Synchronized the last few hours and the result looks plausbile.
Thanks a lot for fixing it!

There is no need to delete your database if you switch branches which are both self-compiled

That helped ;-)

Debug build of master seems to also work. Synchronized the last few hours and the result looks plausbile. Thanks a lot for fixing it! > There is no need to delete your database if you switch branches which are both self-compiled That helped ;-)
eQuark2 commented 3 weeks ago
Poster

I can confirm that the debug build of master displays
activity
sleep
sleep per month (including “last night’s” sleep)
steps per month (including today’s steps)
correctly. I have not checked speed zones or live activity.

BUT the gpx track speed data is NOT correct. The altitude and slope do appear to be correct. As do the time and distance.

Next post has more detail.

I can confirm that the debug build of master displays activity sleep sleep per month (including "last night's" sleep) steps per month (including today's steps) correctly. I have not checked speed zones or live activity. BUT the gpx track speed data is NOT correct. The altitude and slope do appear to be correct. As do the time and distance. Next post has more detail.
eQuark2 reopened this issue 3 weeks ago
eQuark2 commented 3 weeks ago
Poster

Digging further into the gpx files I see that actually the record structure is the same except for the first few records.

BUT in the tracks from 0.45.1 with OS 0.0.9.11 the time is NOT incremented one second per record (as it was in the older version). It seems that the same time (e.g. 2020-07-20T19:14:32Z) doesn’t change for 7 records and then jumps 7 seconds forward (in this example to 2020-07-20T19:14:39Z) where it remains for the next 7 records and then jumps again. Obviously I didn’t check every record, but it seems pretty consistant for the records I looked at, although I did find one place where it jumped 8 secconds and the following “jump” was 6 seconds.

The latitude and longitude are updated every record and I think the heart rate is also updated.

And I figured out how to upload a file, so gpx file attached.

Digging further into the gpx files I see that actually the record structure is the same except for the first few records. BUT in the tracks from 0.45.1 with OS 0.0.9.11 the time is NOT incremented one second per record (as it was in the older version). It seems that the same time (e.g. 2020-07-20T19:14:32Z) doesn't change for 7 records and then jumps 7 seconds forward (in this example to 2020-07-20T19:14:39Z) where it remains for the next 7 records and then jumps again. Obviously I didn't check every record, but it seems pretty consistant for the records I looked at, although I did find one place where it jumped 8 secconds and the following "jump" was 6 seconds. The latitude and longitude are updated every record and I *think* the heart rate is also updated. And I figured out how to upload a file, so gpx file attached.
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.