Xiaomi band 6 and EspruinoHub

Posted on
  • I have asked this before but still no solution.

    I have a Xiaomi Band 6 and running a EspruinoHub on a raspberry Pi, I can see the MI6 band and it's advertising my steps. But I want to see the heart rate from the MI6 band. I had a few suggestions for the settings on the band and I have all set them but still no data from the heart rate counter. When I start the NRF app on my phone I see there are some UUiD 's what send some heart rate data.
    Is there anyone has a solution to read the heart rate of this MI6 band on the EspruinoHub?

  • I see there are some UUiD 's what send some heart rate data.

    Is this when you connect? Or just in normal advertising data in the Scanning tab?

    Because if you have to connect first, it's not really what EspruinoHub was meant for. If it's in advertising data it should be a pretty easy tweak to https://github.com/espruino/EspruinoHub/­blob/master/lib/attributes.js that is required

  • It is not in the advertising data, so i hope someone on this forum knows how to set the MI6 to advertise the heart rate data like it does with the step counter

  • I looked at the attributes.js and see Xiaomi settings for the Xiaomi Flower care. I have a Flower care and it worked fine. Can you give me some tips how to add my Xiaomi MI6 band?
    In the uploaded file you can see a screenshot how the setting for Heart rate looks in the nrf Connect app


    1 Attachment

    • Screenshot_20220929_115743_no.nordicsemi.android.mcp.jpg
  • In the uploaded file you can see a screenshot how the setting for Heart rate looks in the nrf Connect app

    You're connected to the band when you see that. It's not something that is being advertised...

    Flower care works because it advertises the data.

    You can set up EspruinoHub to get the data via https://github.com/espruino/EspruinoHub#­connections but it will be connected to the watch band constantly and so won't be able to scan for other advertisements.

    When you look in the Scanning tab of nRF Connect do you see any data that could be heart rate? If so maybe screenshot that, and I can show you how to add it.

  • This is what we see.


    1 Attachment

    • Screenshot_20220930_124923_no.nordicsemi.android.mcp.jpg
  • Do I have to edit this in attributes.js

    "fee0": function (d) {

    let r = {steps: (0xff & d[0] | (0xff & d[1]) << 8)};
    if (d.length === 5)
      r.heartRate = d[4];
    return r;
    
  • Ok, well that code implies that there would be a heart rate if you had 5 bytes of data advertised.

    ... but you only have 4, so your heart rate is not being advertised by the band - I guess it must need configuring somehow to advertise it?

    Bytes 0+1 are your step count I guess. But bytes 2+3 are both zero so those are unlikely to be heart rate :)

  • As you can see both switches for advertising heart rate are on. I start also a workout because someone said it only advertise when starting a workout but no go.


    1 Attachment

    • Screenshot_20221003_142151_com.xiaomi.hm.health.jpg
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Xiaomi band 6 and EspruinoHub

Posted by Avatar for user133055 @user133055

Actions