Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

[RFC] Mi Band 2: Add rudimentary raw sensor data support #894

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atx
Copy link

@atx atx commented Nov 22, 2017

I have been playing with a third party application whose name seems better not to mention. After replaying some of the writes it does when cooperating with Sleep as Android I got something which looks very much like raw sensor data.

A logcat dump is available on https://p.atx.name/uhuhozuvoy . The bytes look easy to convert at first glance (maybe even the same as the Mi Band 1?), but I have ran out of time for today.

This is not really useful at the moment, but eventually it would be nice to add integration with Sleep as Android (or an OSS alternative, if there is any) (thus bypassing the need for having Mi Fit + the aforementioned third party app installed).

I am mostly putting this PR here as a request for comments/patches, so if anyone has more empty timeslots than me...

Note that this is extremely hacky (and does not really work all that great)
and some more investigation into the mechanism/flags is needed.
@thePanz
Copy link

thePanz commented Apr 22, 2018

@atx any news about this feature? you mention that "the bytes look easy t convert", do you have more details about it?

update: Got the answer by myself, I guess you're referencing the private static void handleSensorData() method from the Miband1 :)

thePanz added a commit to thePanz/Gadgetbridge that referenced this pull request Apr 24, 2018
@arielroque

This comment has been minimized.

@fredyshox
Copy link

fredyshox commented Jul 27, 2018

I’ve parsed data using mentioned method from Mi Band 1 and have tested measurements of Z axis for band laying on a table. As far for positive measurements, values as expected differ by +/- 10% from value of G. But strange thing happens for negative measurements, because error rate increases to 20-30%. As I observed this happen to negative values for every axis.

Scale factor used: 250
Example values for Z axis:
recto: 10.88 m.s^-2 (~10% from G)
verso: -6.6 m.s^-2 (~30% from G)

Has anyone met this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants