Help me get Heart Rate data [OpenFit: Open source Gear Fit application]

Search This thread

thijsnl

Member
Oct 15, 2006
18
2
awesome work!

I also got some hopefully promising data. I ran the running mode yesterday for about 1 minute, but I don't get things like GPS etc so alot of info is blank, with exception of heart rate.

Great job too! I will try to decipher as well. The CPU used is a Cortex M4 ARM, so 32 bit, little endian, but with hardware single precision floating point.
so far i only found fixed point numbers, integers but we should be aware of doubles/floats. Most of the numbers are also 4byte/32bit aligned.

Regards,

Mathijs
 
Last edited:

thijsnl

Member
Oct 15, 2006
18
2
I got some progress on the pedometer file (pedo_result) as well.
Code:
[wxxxxxxxxxx@xxxx gf]$ ./pedo
Index 1: 2015-08-08 22:56:58  34505  10000   9843 xxxxxxxxxxxxxxxx
Index 2: 2015-08-09 17:12:50  25315  10000    760 xxxxxxxxxxxxxxxxxxxxxx
Index 3: 2015-08-10 00:14:45 117028  10000   1979 xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Index 4: 2015-08-12 08:46:15  55481  10000   2293 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Index 5: 2015-08-13 00:10:56  86984  10000   1882 xxxxxxxxxxxxxxxxxxxxxx
Index 6: 2015-08-14 00:20:40  86445  10000    952 xxxxxxxxxxxxxxxxxxxxxx
Index 7: 2015-08-15 00:21:25  96170  10000   6144 xxxxxxxxxxxxxxxxxxxxxxxx
Index 0: 1970-01-01 01:00:00      0      0      0 0 0 0 0 0 0 0
First is the index, then the timestamp, ?? unknown, steps goal (10000), steps completed.

I checked the history in my GF, and it matches!
I also found my lat/long coords in the lines, so i put some xxxxxxxxxxxxxxxx in those bytes.

---------- Post added at 08:11 PM ---------- Previous post was at 07:38 PM ----------

inspected the pedo_info.dat file as well (20 bytes packets)

Code:
Index 172: 2015-08-14 08:50:00     53 1110106440 1075042058
Index 173: 2015-08-14 09:10:00    122 1120037766 1084898671
Index 174: 2015-08-14 09:30:00     66 1112817009 1077600583
Index 175: 2015-08-14 09:40:00     41 1107081298 1071728558
Index 176: 2015-08-14 09:50:00     39 1107196642 1071393014
Index 177: 2015-08-14 10:10:00     14 1093675254 1058642330
Index 178: 2015-08-14 10:50:00     74 1113786942 1078733046
Index 179: 2015-08-14 12:20:00     76 1114835518 1079320249
Index 180: 2015-08-14 12:30:00     38 1104811131 1070554153
Index 181: 2015-08-14 12:40:00     16 1094115656 1059816735
Index 182: 2015-08-14 12:50:00     31 1103416524 1068121457
Index 183: 2015-08-14 13:10:00     27 1104098099 1067534254
Index 184: 2015-08-14 14:10:00      7 1088883261 1051595899
Index 185: 2015-08-14 15:00:00     90 1116792422 1081752943
Index 186: 2015-08-14 15:20:00     40 1107123241 1071476900
Index 187: 2015-08-14 15:30:00      8 1088988119 1052602532
Index 188: 2015-08-14 17:20:00      6 1083535524 1048576000
Index 189: 2015-08-14 17:30:00     23 1099667866 1065017671
Index 190: 2015-08-14 17:40:00     52 1107962103 1077139204
Index 191: 2015-08-14 17:50:00     95 1117767598 1082717634
Index 192: 2015-08-14 18:40:00     34 1105073275 1069547520
				-------
			          952 steps! (lazyday)

952 steps matches the pedo_result.dat file for 14/08!!!

UPDATE: oh yes.. found out the whole structure:
Code:
Index 135: 2015-08-12 16:40:00     74 65.10 3.95
Index 136: 2015-08-12 16:50:00     10 7.12 0.41
Index 137: 2015-08-12 17:00:00    129 98.26 5.65
Index 138: 2015-08-12 17:10:00     25 22.87 1.15
Index 139: 2015-08-12 17:20:00    115 90.94 5.12
Index 140: 2015-08-12 17:30:00     31 28.19 1.43
Index 141: 2015-08-12 17:50:00     65 49.87 2.76
Index 142: 2015-08-12 18:00:00     16 13.54 0.71
Index 143: 2015-08-12 18:10:00     74 59.44 3.25
Index 144: 2015-08-12 18:40:00     45 35.64 2.02
Index 145: 2015-08-12 19:10:00     26 18.50 1.18
Index 146: 2015-08-12 19:50:00     29 19.87 1.29
Index 147: 2015-08-12 20:00:00      9 6.06 0.36
Total meter: 1821.48  total kcal: 101.71

pedo_info.dat
offset: 38

0: index
4: linux timestamp since epoch
8: steps in that period
12: meters in that period (in single precision float)
16: kcal in that period (in single precision float)
@jareddlc: you might have some floats in the data you posted too
 
Last edited:
  • Like
Reactions: Kpyto

jareddlc

Senior Member
Sep 26, 2010
334
328
www.
Looks like i made some progress with the pedometer stats:

Im still figuring out the last part of the message but here sample of some stats:

My watch showed this information:

pedometer: 3404 steps, 2.59km, 119cal
Monday Aug 17 8:34 pm, running, 01:02 time, 0.00 km,0 cal, avg speed, 0.0kmh, max speed, 0.0kmh, avg pace - --km, max pace, - --, avg heart 88bpm, max 93 bpm

and here is the data I gathered so far:

Code:
Pedometer total: 28
//this is just 1 of 28
timestamp: Mon Aug 17 2015 09:10:00 GMT-0700 (Pacific Daylight Time)
steps taken: 168
distance: 143.02999877929688
calorie: 6.550000190734863

//2 of 28
timestamp: Mon Aug 17 2015 10:00:00 GMT-0700 (Pacific Daylight Time)
steps taken: 204
distance: 151.83999633789062
calorie: 7.069999694824219

//etc
...

adding the numbers i got back shows up as:


steps: 3404
distance: 2593.5100078582764
calorie: 119.72000052034855


looks I successfully got pedometer stats, and I'm almost certain hear rate "summary of exercise as well" not sure if I will have access to a finer detail heart rate.
 

jareddlc

Senior Member
Sep 26, 2010
334
328
www.
@thijsnl
Hey do you know if the data has a data type for:
  • sleep
  • heartbeat
  • pedometer
  • stopwatch
  • excercise
Im seeing different data, initially i had data for pedometer, which seems to be of type 4, and i got a different message of type 6, not sure what it is. any ideas?
 

etatus

Member
Jul 21, 2009
11
1
I was playing with Gear Fit Manager apk, and I could decompile some interesting classes related to shealth service, including sensors data structures.

I've attached this clases, but you can decompile easily the apk using Smali2Java app.

Hope this helps.
 

Attachments

  • GearFitManager_shealth_src.zip
    63.9 KB · Views: 65

dape16

Senior Member
Jun 20, 2006
510
119
Sorry for resurrecting a thread this old, but did you have any success with retrieving HRM data? That could be synced with Google Fit?
Does the Gear Fit 1 even sync HRM on Samsung phones with the newest Gear Fit Manager?

Thanks!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Looks like i made some progress with the pedometer stats:

    Im still figuring out the last part of the message but here sample of some stats:

    My watch showed this information:

    pedometer: 3404 steps, 2.59km, 119cal
    Monday Aug 17 8:34 pm, running, 01:02 time, 0.00 km,0 cal, avg speed, 0.0kmh, max speed, 0.0kmh, avg pace - --km, max pace, - --, avg heart 88bpm, max 93 bpm

    and here is the data I gathered so far:

    Code:
    Pedometer total: 28
    //this is just 1 of 28
    timestamp: Mon Aug 17 2015 09:10:00 GMT-0700 (Pacific Daylight Time)
    steps taken: 168
    distance: 143.02999877929688
    calorie: 6.550000190734863
    
    //2 of 28
    timestamp: Mon Aug 17 2015 10:00:00 GMT-0700 (Pacific Daylight Time)
    steps taken: 204
    distance: 151.83999633789062
    calorie: 7.069999694824219
    
    //etc
    ...

    adding the numbers i got back shows up as:


    steps: 3404
    distance: 2593.5100078582764
    calorie: 119.72000052034855


    looks I successfully got pedometer stats, and I'm almost certain hear rate "summary of exercise as well" not sure if I will have access to a finer detail heart rate.
    2
    awesome work!

    I also got some hopefully promising data. I ran the running mode yesterday for about 1 minute, but I don't get things like GPS etc so alot of info is blank, with exception of heart rate.

    Here are my findings:

    My watch reported back with: should be: Monday Aug 17 8:34 pm, running, 01:02 time, 0.00 km,0 cal, avg speed, 0.0kmh, max speed, 0.0kmh, avg pace - --km, max pace, - --, avg heart 88bpm, max 93 bpm so i found most time stamps, and now im looking for 88 (58 in HEX) and 93 (5D in HEX) seems i found the "summary" report.

    Code:
    5807D255 = Monday, August 17, 2015 9:10:00 AM
    A8000000AE070F439A99D140
    1013D255 = Monday, August 17, 2015 10:00:00 AM : 1439830800
    CC0000000AD71743703DE240
    D025D255 = Monday, August 17, 2015 11:20:00 AM : 1439835600
    0901000046E14743F7281441
    E033D255 = Monday, August 17, 2015 12:20:00 PM : 1439839200
    //...
    10A9D255 = Monday, August 17, 2015 8:40:00 PM : 1439869200
    39000000CCCC3042D7A300400901000000D89FDF3E4F01000000000000000000000000000000000000040000000C01000000
    D7A7D255 = Monday, August 17, 2015 8:34:47 PM : 1439868887
    3E00000000000000 5800000000000000 0153460000000000 0000000000000000 00000000 00 5D00000000000000 000000000001000000 = 88bpm : 58 HEX 93bpm : 5D HEX
    45B5C855 = Your time zone: Monday, August 10, 2015 7:29:25 AM : 1439216965
    2300000000002A430000824235E60200CD7FCF12F1490200D1FB01001198020022BF02000101000000
    A5AAD255 = Monday, August 17, 2015 8:46:45 PM : 1439869605
    1027000000000000
    1
    I got some progress on the pedometer file (pedo_result) as well.
    Code:
    [wxxxxxxxxxx@xxxx gf]$ ./pedo
    Index 1: 2015-08-08 22:56:58  34505  10000   9843 xxxxxxxxxxxxxxxx
    Index 2: 2015-08-09 17:12:50  25315  10000    760 xxxxxxxxxxxxxxxxxxxxxx
    Index 3: 2015-08-10 00:14:45 117028  10000   1979 xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Index 4: 2015-08-12 08:46:15  55481  10000   2293 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Index 5: 2015-08-13 00:10:56  86984  10000   1882 xxxxxxxxxxxxxxxxxxxxxx
    Index 6: 2015-08-14 00:20:40  86445  10000    952 xxxxxxxxxxxxxxxxxxxxxx
    Index 7: 2015-08-15 00:21:25  96170  10000   6144 xxxxxxxxxxxxxxxxxxxxxxxx
    Index 0: 1970-01-01 01:00:00      0      0      0 0 0 0 0 0 0 0
    First is the index, then the timestamp, ?? unknown, steps goal (10000), steps completed.

    I checked the history in my GF, and it matches!
    I also found my lat/long coords in the lines, so i put some xxxxxxxxxxxxxxxx in those bytes.

    ---------- Post added at 08:11 PM ---------- Previous post was at 07:38 PM ----------

    inspected the pedo_info.dat file as well (20 bytes packets)

    Code:
    Index 172: 2015-08-14 08:50:00     53 1110106440 1075042058
    Index 173: 2015-08-14 09:10:00    122 1120037766 1084898671
    Index 174: 2015-08-14 09:30:00     66 1112817009 1077600583
    Index 175: 2015-08-14 09:40:00     41 1107081298 1071728558
    Index 176: 2015-08-14 09:50:00     39 1107196642 1071393014
    Index 177: 2015-08-14 10:10:00     14 1093675254 1058642330
    Index 178: 2015-08-14 10:50:00     74 1113786942 1078733046
    Index 179: 2015-08-14 12:20:00     76 1114835518 1079320249
    Index 180: 2015-08-14 12:30:00     38 1104811131 1070554153
    Index 181: 2015-08-14 12:40:00     16 1094115656 1059816735
    Index 182: 2015-08-14 12:50:00     31 1103416524 1068121457
    Index 183: 2015-08-14 13:10:00     27 1104098099 1067534254
    Index 184: 2015-08-14 14:10:00      7 1088883261 1051595899
    Index 185: 2015-08-14 15:00:00     90 1116792422 1081752943
    Index 186: 2015-08-14 15:20:00     40 1107123241 1071476900
    Index 187: 2015-08-14 15:30:00      8 1088988119 1052602532
    Index 188: 2015-08-14 17:20:00      6 1083535524 1048576000
    Index 189: 2015-08-14 17:30:00     23 1099667866 1065017671
    Index 190: 2015-08-14 17:40:00     52 1107962103 1077139204
    Index 191: 2015-08-14 17:50:00     95 1117767598 1082717634
    Index 192: 2015-08-14 18:40:00     34 1105073275 1069547520
    				-------
    			          952 steps! (lazyday)

    952 steps matches the pedo_result.dat file for 14/08!!!

    UPDATE: oh yes.. found out the whole structure:
    Code:
    Index 135: 2015-08-12 16:40:00     74 65.10 3.95
    Index 136: 2015-08-12 16:50:00     10 7.12 0.41
    Index 137: 2015-08-12 17:00:00    129 98.26 5.65
    Index 138: 2015-08-12 17:10:00     25 22.87 1.15
    Index 139: 2015-08-12 17:20:00    115 90.94 5.12
    Index 140: 2015-08-12 17:30:00     31 28.19 1.43
    Index 141: 2015-08-12 17:50:00     65 49.87 2.76
    Index 142: 2015-08-12 18:00:00     16 13.54 0.71
    Index 143: 2015-08-12 18:10:00     74 59.44 3.25
    Index 144: 2015-08-12 18:40:00     45 35.64 2.02
    Index 145: 2015-08-12 19:10:00     26 18.50 1.18
    Index 146: 2015-08-12 19:50:00     29 19.87 1.29
    Index 147: 2015-08-12 20:00:00      9 6.06 0.36
    Total meter: 1821.48  total kcal: 101.71

    pedo_info.dat
    offset: 38

    0: index
    4: linux timestamp since epoch
    8: steps in that period
    12: meters in that period (in single precision float)
    16: kcal in that period (in single precision float)
    @jareddlc: you might have some floats in the data you posted too