Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SET_NUTRITION packet #33

Open
hertzg opened this issue Oct 29, 2020 · 3 comments
Open

Implement SET_NUTRITION packet #33

hertzg opened this issue Oct 29, 2020 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@hertzg
Copy link
Owner

hertzg commented Oct 29, 2020

I do not have enough samples to understands this packet.

Having enough samples showing:

  • Diffenret fields populated with different values in app
  • Bytes sent to and from the BLE service

would (probably) help understand:

  • How float values are coded
  • Which fields are transfered vs computed
  • How are they coded in the packet.

It would be great if someone can provide that information using an Android phone (I no longer have one).

This can be done using adb and wireshark if anyone is willing to provide samples I can write up a guide how to do it.

@hertzg hertzg added the help wanted Extra attention is needed label Oct 29, 2020
@wilsonsilva
Copy link

I'm willing to help. I would like to see this protocol completely reverse engineered. Today I'll start an open-source clone of the mobile app, to own the data and fix the sync with Fitbit that has plagued the app for years.

@hertzg
Copy link
Owner Author

hertzg commented Sep 26, 2021

Thats great, if you can provide wireshark pcaps of set nutrition packets while you take note of what values you wrote into the fields might help understand the packet. 👍

@hertzg
Copy link
Owner Author

hertzg commented Feb 17, 2022

Apparently the nutrition payload is super simple 🤦‍♂️

feefc0a2c2240f423e0f423e [01869e 01869e 01869e 01869e 01869e 01869e 01869e 01869e 01869e 01869e] 76

Payload

bytes (incl.) field unit values
[0, 2] calories Kcal (5) 0x0 - 0xf423f
0.0 - 99999.9
[3, 5] caloriesFromFat Kcal (5) 0x0 - 0xf423f
0.0 - 99999.9
[6, 8] totalFat g (4) 0x0 - 0x1869e
0.0 - 9999.9
[9, 11] stauratedFat g (4) 0x0 - 0x1869e
0.0 - 9999.9
[12, 14] transFat g (4) 0x0 - 0x1869e
0.0 - 9999.9
[15, 17] cholesterol mg (4) 0x0 - 0x1869e
0.0 - 9999.9
[18, 20] sodium mg (4) 0x0 - 0x1869e
0.0 - 9999.9
[21, 23] potassium mg (4) 0x0 - 0x1869e
0.0 - 9999.9
[24, 26] totalCarbs g (4) 0x0 - 0x1869e
0.0 - 9999.9
[27, 29] dietaryFiber g (4) 0x0 - 0x1869e
0.0 - 9999.9
[30, 33] sugars g (4) 0x0 - 0x1869e
0.0 - 9999.9
[34, 36] protein g (4) 0x0 - 0x1869e
0.0 - 9999.9

This also tends to auto reset to 0 ONLY when the measurement hits 0.

image

@hertzg hertzg changed the title need more samples for SET_NUTRITION packet Implement SET_NUTRITION packet Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants