NightscoutFoundation / xDrip

Nightscout version of xDrip+
https://jamorham.github.io/#xdrip-plus
GNU General Public License v3.0
1.4k stars 1.15k forks source link

Displaying blood glucose on Xiaomi MiBand 4 #1189

Closed davidnatalia2000 closed 4 years ago

davidnatalia2000 commented 4 years ago

Hello, It's posible to integreated this versión in our xdrip?

https://bigdigital.home.blog/2019/11/21/xdrip-miband/#xdrip_miband

steve8x8 commented 4 years ago

I'd like to see this too, but I'm afraid it takes a MR - and the author, last time I asked him, didn't feel ready for that.

davidnatalia2000 commented 4 years ago

A shame…… Have you tried the application? It works great, but I dare not put it on my daughter xdrip because she is the xdrip master and I don´t want to install this verison because is not the "official" xdrip. Only her mother has it installed as a follower. But as I said, It Works great!!!!!

steve8x8 commented 4 years ago

A quick'n'dirty idea: Since there are "variants" of the official xDrip app (which, I suppose, get updated with every nightly) it should be possible to run an official variant as master, and the bigdigital one as follower, on the same smartphone. If this is possible at all - has anyone ever tried it?

bigdigital commented 4 years ago

Today i've released a new version https://bigdigital.home.blog/2020/01/23/future-of-the-xdrip-miband-project/ which should work better for mibandv4 . The v2 and v3 would work as before . If this version would be stable, i’ll create a pull request for the Xdrip master record. So i would be grateful if someone can help to test it on different miband versions and let me know if there some issues.

steve8x8 commented 4 years ago

Downloaded 0.2.0, installed it on my follower phone. With a MiBand2 connected, on "Update BG manually", I only see a "waving" notification bubble - but no text. BTW, the "authentication" thingy is bit fragile, as the only hint at a missing auth is in the System Status, far far away. So let's try the MiBand4 instead? First I mistyped the auth key, causing xDrip to FC with "invalid hex char 'r'". Please add some sanity check... After app data reset: Yes, the 4 shows the notifications as it did yesterday. For the watchface, it's almost empty, no curve, no (obviously visible) value. On top, battery, date (wrong, instead encoding the value!!!) and time (no separator, btw) on top and two very small numbers (step counter, and some random heart rate) above the four colour bars at the bottom. Close, but no cigar yet, I'd say. Going back to 0.1.4 for now (which I didn't test with the MB2 yet)

bigdigital commented 4 years ago

Thank you for suggestion regarding sanity check, i'll add it. Unfortunately, at the moment, i do not have any device which can generate glucose bg values, but i have access to MiBands models v2, v3 and v4 . So i can't test all functions without real bg readings. I guess if someone can add me as a follower so i can receive bg readings in realtime, this will allow me to test these devices better on teal bg values. If someone can do this, please email me at bigdigital.kov@gmail.com . Thanks

steve8x8 commented 4 years ago

Something I've encountered several times when trying to switch things back and forth: I've been kicked back to the home screen (or even got an "app failure" message from MIUI) multiple times when trying to check/change the band MAC or Auth Key, with Use=Off. This also happens with 0.1.4 - one shouldn't do that too often. Sometimes, after restarting the app, the previous MAC magically reappears.

What would be really helpful - if there was (a) a change on the MiBand page that shows which type has been paired, and (b) en/disabling items that don't make sense, e.g., "Install watchface" isn't useful with <4 bands.

I completely failed to pair the Band2 with 0.1.4.

As for followership, I haven't yet fully understood how this works at all (and apparently it doesn't work when the two devices aren't in the same network), so this probably wouldn't help, sorry...

bigdigital commented 4 years ago

Thank you, i already got a message from one guy, he shared an own nightcloud server with me, so i can receive a live bg readings. Now i see a problem with the black screen you mentioned. And i guess fixed it https://imgur.com/a/rzBOTO0 . Also i will check auth and MAC fields.

steve8x8 commented 4 years ago

0.2.0.1 is much much better now on my Band4, I'm going to like it! Thanks a bunch for that update. A few minor things:

I'll go back to my old trusted Band2 and check what went wrong with the pairing/auth later, for now I'm rather happy. Thanks again!

There seem to be a few inconsistencies in the MiBand config page of the app though.

Do you have an idea how much battery will be drawn by the frequent watchface updates, both from the smartphone and the band? The band display backlight gets activated each time a new value is sent...

bigdigital commented 4 years ago

@steve8x8

  1. Yes, i've noticed this when i get a real bg values from nightcloud server. I also think that bg units can be removed from the delta. Regarding replacing "at" to @, these symbols take almost the same width, but i guess "at" can be more descriptive.
  2. This leftover from the previous xdrip version. Now all miband features should control thirdparty applications. The xdrip will only send xdrip related notifications and would upload watchfaces. So to set the correct date, you would need to synchronize miband with MiFit, or any other thirdparty applications that can work with miband.
  3. Unfortunately, there would be not enough place to display battery percentage. The only solution is to remove bat icon at all.
  4. This is how watch faces work on miband. Yes, it is possible to generate a new watch face without a heart icon. But HR measurements digits would be still there. Actually, at the moment my watchface generator is very limited. I still can't normally generate an image with any color palette. And sometimes miband do not want to display generated image (the problem which was in 2.0.0). And seems this related to the total number of colors used on an image.
  5. I guess it would be possible, but it required to improve current image encoding algorithm to able to generate more colors on the image.
  6. i'll add dependencies for these properties.

Regarding battery consumption, yes the consumption increased significantly, almost in two times. Before releasing v 2.0.0 i've made some tests https://i.imgur.com/8xwP2Zf.png The average time between uploading watch face was 5 minutes. As i know, this is better than even on pebble watch. But i have thoughts regarding optimization which at the moment was delayed. Will back to this when all main things would work stable. And again thank you for suggestions and testing.

steve8x8 commented 4 years ago

Hi, some feedback to your feedback which is appreciated ;)

  1. looking forward to testing this :)
  2. I paired the band with GadgetBridge (no MiFit around) and it indeed got the right date set
  3. there also seems to be no other place that shows battery percentage :( not even in Status, but an icon is better than nothing - mine looks like >50% still (was at 70% last time I could connect to GB)
  4. I don't really mind...
  5. there are already 3 colours in the graph (curve, low, high), reuse them?

For updates and battery drain, I'll continue watching - runtime is still much longer than what I get from my Sony smartwatch. Now if there wasn't that constant wakeup - at night, or during meetings... Perhaps I'll go back to the old "static" watchface approach. Would be great if that was supported as well.

For the MiBand2, I found that it isn't able to show notifications at all, it takes at least a 3 to present their content (beyond the existence of a notification which, on a 2, is only useful to learn xDrip is still kicking). It would be great if you could add a note to your initial (December) blog post that MiBand2 is almost useless for this purpose...

davidnatalia2000 commented 4 years ago

Todas I have installed the new version at my wife band 4. It works great!!! Thanks a lot for your work. I hope you can integreated It in xdrip oficial versión soon.

ANDREAPIPPI commented 4 years ago

Hi. Could you please show here an image of the actual watch face? Thank you. Pippo

davidnatalia2000 commented 4 years ago

![Uploading IMG_20200208_101619.jpg…]()

ANDREAPIPPI commented 4 years ago

Sorry, image doesn't show.... can you check, please? Thanks. Pippo

davidnatalia2000 commented 4 years ago

IMG_20200208_101619

ANDREAPIPPI commented 4 years ago

Thank you, appreciated. Pippo

davidnatalia2000 commented 4 years ago

Hi, there is a problem. The clock only lowers the brightness to a minimum and it is very difficult to see the screen. Does the same thing happen to you?

steve8x8 commented 4 years ago

IIRC the Brightness can be set in More > Settings?

davidnatalia2000 commented 4 years ago

Hi Steve. Yes I can change in settings. I installed again your xdrip version and It's working very well now. No problems with brightness. Thanks !!!!!

El mar., 11 feb. 2020 16:52, Steve Sixty-Four notifications@github.com escribió:

IIRC the Brightness can be set in More > Settings?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/NightscoutFoundation/xDrip/issues/1189?email_source=notifications&email_token=AJ3NXYUCOQYEYK5G2T4DIYTRCLCSZA5CNFSM4KJEZUYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELM53VQ#issuecomment-584703446, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ3NXYWBVGGSKTZQJU3DAYLRCLCSZANCNFSM4KJEZUYA .

steve8x8 commented 4 years ago

xdrip_miband_0.2.2.apk, which is about a week old now, seems to be the latest version. Does this still wake up the band every five minutes? Wearing a MiBand4 in public with this "feature" is asking for more attention than I can stand, not talking about battery (and flash?) wear... I'd be rather happy with 0.1.4 (using a "static" watchface instead) if that had a battery level icon/percentage.

steve8x8 commented 4 years ago

Answering myself... The wakeups still happen but are somewhat "hidden" by using a very low brightness. One shouldn't touch the button while the upgrade is in progress otherwise the dark setting may persist (for a while only though). I haven't tried this in a low-light setting, but it might be acceptable (I'm using a Sony SW3 right now with display always on but backlight off). What isn't clear to me is whether this temporary watchface gets actually flashed (if yes, I'd be worried about flash life). What needs more observation is battery life, but everything longer than a week is OK with me. The settings interface needs a bit of polishing (auth key handling, 24-hour mode), but we're getting close ;)

davidnatalia2000 commented 4 years ago

Hi. We are all this time with the last versión and I think It's working great!!!! I hope you can integrated this versión in the "official" xdrip soon. Thanks for all your work. !!!!!!!! You make our childrens lives easier. That is not paid

psonnera commented 4 years ago

This feature is encountering a great success and I would be happy to see it merged in the official release (to avoid having people regularly lose all data when uninstalling the mainstream version as they forget to backup the database and settings).

ANDREAPIPPI commented 4 years ago

Yes, please, merge it in the official xdrip+ release. Many people will be happy for this! Thank you! Pippo

ANDREAPIPPI commented 4 years ago

Hi all. No news about merging in the official xdrip+ release? Hope to have good news in a short time, I'm going to receive my MiBand 4 in a short time.... Andrea :-)

bigdigital commented 4 years ago

18.04.2020 my code from https://bigdigital.home.blog/2019/11/21/xdrip-miband/#xdrip_miband was approved and merged into the official xdrip. So i guess this issue can be closed.

ANDREAPIPPI commented 4 years ago

Hi Artem. Could you please wait to close it, till when the merge will be issued and tried by some of us? This just in case there be any issue, or explanation needs, or settings info. Thank you so much. Pippo :-)

On Wed, 22 Apr 2020 09:59:43 -0700 Artem notifications@github.com wrote:

18.04.2020 my code from https://bigdigital.home.blog/2019/11/21/xdrip-miband/#xdrip_miband was approved and merged into the official xdrip. So i guess this issue can be closed.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/NightscoutFoundation/xDrip/issues/1189#issuecomment-617904525

Andrea Pelloni

saurabh1480 commented 4 years ago

Hi i tried on my xdrip+app by giving authentication key but nothing happened in mi4 band ,can anyone plz explain complete set up in new xdrip app and do i have to install mi official app again

ANDREAPIPPI commented 4 years ago

I have a different problem with the authentication code... in settings the auth request disappeared from the settings, as shown in the attached images. My question: what is the procedure to follow ton restart installation from scratch? Thank you. Andrea :-) http://www.easybytez.com/38dqw3fx0h9x http://www.easybytez.com/uf08ue6c08vy On Thu, 14 May 2020 12:25:44 -0700 saurabh1480 notifications@github.com wrote:

Hi i tried on my xdrip+app by giving authentication key but nothing happened in mi4 band ,can anyone plz explain complete set up in new xdrip app and do i have to install mi official app again

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/NightscoutFoundation/xDrip/issues/1189#issuecomment-628840832

Andrea Pelloni

saurabh1480 commented 4 years ago

Ok i got it but it is coming in notifications how to show it in screen permanently

saurabh1480 commented 4 years ago

@bigdigital plz help sir my watched is connnected to latest xdrip version but bg is showing in notifications and no watch face as shown by you works and my_watchface.bin and my image.png is to be downloaded from where

bigdigital commented 4 years ago

@bigdigital plz help sir my watched is connnected to latest xdrip version but bg is showing in notifications and no watch face as shown by you works and my_watchface.bin and my image.png is to be downloaded from where

Please try the following suggestions https://bigdigital.home.blog/2019/11/21/xdrip-miband/#comment-381

saurabh1480 commented 4 years ago

@bigdigital plz help sir my watched is connnected to latest xdrip version but bg is showing in notifications and no watch face as shown by you works and my_watchface.bin and my image.png is to be downloaded from where

Please try the following suggestions https://bigdigital.home.blog/2019/11/21/xdrip-miband/#comment-381

@bigdigital yes sir it was done quicky thank you very much if you give setting details in app itself only it will be of help to others too,by putting user manual ,and sir again thanks for making such a wonderful app.

kapollo commented 4 years ago

On version 3f17d8e-2020.05.05 the miband 4 reverts to the stock screen. I've followed the config. I was able to "free my band" and etc. There is a problem retaining BG watch face (or any other for that matter which is surprising, but perhaps related to the problem so here goes what I did):

  1. Tried to updated the watch face (band face? :) ) manually from Xdrip - > update started stopped with error
  2. Changed the watch face from the stock to custom via the Mi App
  3. Tried again in Xdrip to update the readings, and it worked.
  4. After some time face reverted to stock
  5. Tried again to send readings from Xdrip again update failed.
  6. Changed the face from stock to custom via the app and waited for some minutes
  7. Face reverted to stock
  8. Changed the face to custom via the app unintalled the Mi app
  9. Updated the readings manually (worked!)
  10. Waited some time reverted back at some point.

So emm please help :D I got a bit stuck I don't know if I messed something up with the config or setting... or it's Mi doing something or well what ever.

bigdigital commented 4 years ago

The watch face can be reverted to the stock version if you have a weak Bluetooth connection during watchface uploading. For example if you leave your phone into one room and go to another room, and if there would be an errors while data transmissions due to weak connection, the band will interrupt uploading process and revert watchface to the stock version. After the next reading, if watchface data would be successfully uploaded, you will see xdrip watchface again.

steve8x8 commented 4 years ago

Anyone with the MiBand5 to confirm this still works?

bigdigital commented 4 years ago

It would not work on miband5 for sure. At least the watchface format and the hardware signature was changed. I'm currently working on watchface adaptation (almost done reverse engineering, need only test on the real device). Also waiting for the miband5 delivery (thanks for guys who did donations on Patreon service). When i get a new watch, need to check if the command protocol was not changed. If Huami developers had left the same communication protocol, the adapted xdrip version will be ready very soon.

diegoka-85 commented 4 years ago

Salve, novità per xdrip su mi band 5? Avrei davvero bisogno di usarlo

paulobenoit commented 4 years ago

I received my mi Band 5, tried to configure it using the same way than for the mi band 4, but can't update BG manually. Xdrip says that the MAC address is not valid. Is there something I can test with the mi band 5?

diegoka-85 commented 4 years ago

Ma c'è una guida dettagliata per mi band 4 in modo tale che possa provare anche io con la 5?

paulobenoit commented 4 years ago

Ma c'è una guida dettagliata per mi band 4 in modo tale che possa provare anche io con la 5?

https://bigdigital.home.blog/2020/01/23/future-of-the-xdrip-miband-project/

diegoka-85 commented 4 years ago

Una versione di mifit mod compatibile con la mi band 5? Quella nell'articolo non si sincronizza

paulobenoit commented 4 years ago

Una versione di mifit mod compatibile con la mi band 5? Quella nell'articolo non si sincronizza

check the website: freemyband https://shorturl.at/gotM8

diegoka-85 commented 4 years ago

Inutile.. non va..

ANDREAPIPPI commented 4 years ago

Same for me, I am absolutely unable to get the AUTH key. My problem could be due to having a xiaomi phone, which has its own passcode paired to my first email address and having paired the original MiFit to my second email address. I was having trouble with this, so I tried to use my phone passcode to log into MiFit, and now it's all messed up. I absolutely have to start from scratch, deleting both signatures and starting new ones, but I can't do that, because the captchas for a new passcode are written in very light green on white, and even with the magnifying glass I can't read them. Shit xiaomi! Beg your pardon, but I'm really exasperated!
Pippo :-(

paulobenoit commented 4 years ago

Inutile.. non va..

Same for me, I am absolutely unable to get the AUTH key. My problem could be due to having a xiaomi phone, which has its own passcode paired to my first email address and having paired the original MiFit to my second email address. I was having trouble with this, so I tried to use my phone passcode to log into MiFit, and now it's all messed up. I absolutely have to start from scratch, deleting both signatures and starting new ones, but I can't do that, because the captchas for a new passcode are written in very light green on white, and even with the magnifying glass I can't read them. Shit xiaomi! Beg your pardon, but I'm really exasperated! Pippo :-(

Using the right version mi band 4.2.0 from the website freemyband.com, you should be able to get the authkey folloiwing the written notice Mi Band 4 / Mi Band 5 Auth key In few simple steps you can get your Mi Band 4 / Mi Band 5 Auth key to connect any app 1) Unpair band from existing official app 2) Uninstall official app 3) Reset your Mi Band (optional) 4) Download and install the Mi Fit mod apk version 5) Pair the band 6) Uninstall the Mi Fit mod 7) Finished! You can find your Auth key on /sdcard/freemyband folder of your band

But this Auth Key is not accepted by xdrip when I try to write this key on xdrip, by leaving the requested field blank, xdrip is not able to find the mi band 5. That means xdrip needs to be updated to recognize and connect to the mi band 5.

PS: the auth key is "just" the bluetooth address of your mi band 5 withtout the ":"

Paulo

diegoka-85 commented 4 years ago

Sì infatti la chiave di autenticazione l'ho ottenuta ma xdrip non la riconosce.. magari con un aggiornamento dell'app xdrip si risolve... Speriamo bene

psonnera commented 4 years ago

It would not work on miband5 for sure. At least the watchface format and the hardware signature was changed. I'm currently working on watchface adaptation (almost done reverse engineering, need only test on the real device). Also waiting for the miband5 delivery (thanks for guys who did donations on Patreon service). When i get a new watch, need to check if the command protocol was not changed. If Huami developers had left the same communication protocol, the adapted xdrip version will be ready very soon.

Please read above before posting. MiBand 5 not yet: WIP.

diegoka-85 commented 4 years ago

Sorry.. attendo sviluppi