Future of the xdrip miband project

I’ve decided to improve miband integration, and change the method which was used to represent glucose data for MiBand4. Instead of the date modifying and using a custom watchface which interpreter a custom date format in correct way, i will generate entire watchface with a dynamic background and upload this watchface to the band. By using this method, all the disadvantages of changing the date on the watch will disappear, and your watch will be fully functional. So it would be possible to use it with any program, and all band features like weather, music control, fitness progress, and more would work.

In addition, this method allowing to display any data on the watch screen.

Upd. 29.01.2020

I’ve finished a new xdrip version . Would be grateful if someone can help to test it on different miband versions.

If this version would be stable, i’ll create a pull request for the official Xdrip apk version. So there would be a chance this patch would be added to the official aplication.

Upd. 29.04.2020

Great news! The pull request was recently approved and merged into official xdrip application. At the moment it is available in the latest nightly build xdrip version which can be downloaded from the following URL https://github.com/NightscoutFoundation/xDrip/releases

New watchface legend

Since v0.2.3 it is outdated watchface view

Real view on miband4 and v0.2.4 with enabled graph and bolus

Configuration tutorial by steps for v 0.2.x

1. Obtaining auth key

If you want to use xdrip with Mi Band4, you need to get Mi Band 4 Auth key (for the older devices (MiBand2 and Miband3), you can skip this step). The Auth key can be obtained with these simple steps (was copied from https://www.freemyband.com/ )

  1. Unpair band from the existing official app
  2. Uninstall official app
  3. Download and install the moddified MiFit application Mi Fit mod apk
  4. Login into the Mi Fit with your email account
  5. Pair the band
  6. Enable band visibility in the MiFit settings.
  7. Now you can uninstall modified Mi Fit application and install official Mi Fit or any other apk you like to use together with miband. If you would use official Mi Fit aplication , you would need to Login into the Mi Fit with the email which was used with patched application.
  8. Finished! You can find your Auth key on /sdcard/freemyband folder of your phone

Notice:

  • If you reset (MAC address of band change) or unpaired your band, the Auth key need to be calculated again. The miband will change the MAC address, so you should change mac and auth key in xdrip(for auto search you can clear mac address and auth key fields)
  • The modded mifit apk is compatible with any firmware version installed on your band
  • You can do this procedure with any phone (if your phone doesn’t allow install apk outside Play Store, you can ask your friend to obtain this auth code for you)

2. xdrip configuration. Connecting to miband

  1. If you have original xdrip application installed on your phone, you would need to delete it. To save all your existent settings and glucose history, you can export your current database into file. To do this, click to the 3 dots on the main xdrip screen, select Import/export feature -> export database.
  2. Install latest patched xdrip from this link xdrip-miband . If you had a database backup, you can restore it by using export/import feature mentioned earlier.
  3. If you skipped “Obtaining auth key” phase (only for miband 2 and 3), go to MiFit settings, and enable band visibility.
  4. Place miband near the phone.
  5. Go to xdrip Settings -> Smart watch features -> MiBand and enable option “Use MiBand”.
  6. Normally miband should be automatically found, and you will see a notification with your model name. If this happen, you can skip next step.
  7. If it wasn’t found automatically, make sure the band visibility option was enabled in MiFit, then disable “Use MiBand” option and repeat step three. You can also enter the mac addres manually (in this case, there no need for visibility option enabled).
  8. Now the miband should be connected, but it is required authentification. On MiBand2 and MiBand3, you should approve authentification by touching the miband button. For MiBand4 you don’t need to do anything. Normally auth key should be automatically extracted from the file /sdcard/freemyband which was generated by patched Mi Fit application. But if it was not generated, you should manually enter the key in “Auth key” field and retry everything from step 4
  9. Finally, you should see the message that your miband was succesfully authenticated and now you can control miband via xdrip.

3. xdrip configuration. General settings and installing glucose watchface

3.1. Configuration for MiBand4

If you use a MiBand4, you can receive a glucose readings in two ways.

  1. In standard miband way, using the text notifications 
  2. Displaying glucose values on the main band screen with help of dynamical custom watchface.
  1. When use a text notification, xdrip would send a message to the miband after every glucose reading.
  2. When use a “dynamical custom watchface” the xdrip will generate a new watchface after every reading and will send this watchface to the miband. This option available only for MiBand4. All miband features would work as before. The watchface with required measurement units (mmol or mg/dl ) would be automatically installed. It would use the units from the general xdrip settings.

The option “BG readings as notification” in MiBand settings allow to controll the way you prefer to receive glucose values. When it is enable , you would receive notifications after every glucose readings. And when it is disabled, this fancy “dynamical custom watchface” would be used.

You can also enable option Send alarms to receive glucose low/hight alerts. If you enable this option, you would get bg alerts as a phone call. Instead of the caller number, you would see an alarm text with the current glucose value. During alarm notification, it is possible to push on the ignore button on you band to skip alarm or push on hangup button to snooze alert. The low/high alarms can be configured directly in xdrip general settings

It is also possible to enable night mode feature (in miband screens/ features menu) This feature allow to decrease glycose synchronisation interval by specifying interval value and mode start/end time. This mode allow to improve miband battery life by reducing synchronization frequency.

Since v 0.2.4 it is possible to display bolus on the band (if this information present in xdrip). The bolus data can be disaplyed ony when graph option enabled.

Finally to send reading to the see miband you should enable “Send reading” option

Notice

1. Keep your watch nearby with your phone, while phone transmitting data (actually the real BlueTooth connection distance can be even up to 50 meters 🙂 ) If your band will lost connection with the phone while transmitting watchface, it will automatically will use default miband watchface. This watchface would be replaced again after connection would be established
2. Take a note to the bluetooth connection status and last synchronisation date to make sure you see not outdated data. Always remember to
3. The band will not accept a new watcface if battery level is less then 10%. In this case the band will automatically swith to notification mode.

3.2. Configuration for MiBand2 and 3

The only possible way to receive bg values on these band versions is to receive them as a text notification. Such notification would be sent to miband after every reading.

Xdrip miband integration apk changelog

If you like this project and want to thank an author for work done or want to support further development of features, become a sponsor on Patreon

If you have some advices regarding features that you want to see, or want to see similar feature on some specific band type, please write them in the comment of the donation form.

Ver 0.2.4.1 (15.03.2020)

  • Fixed App Crash at the settings screen on the first run.

Ver 0.2.4 (10.03.2020)

  • New. Added option to display bolus (when enabled graph)
  • Fixed issue with when BG numbers were displayed without infill
  • For better readability, BG number size was slightly increased
  • Added bg prediction line on the graph (would display 30 minutes prediction line)

At this moment, most of the issues were fixed, and i added many new features so I hope this would be the latest version 🙂 I have plans to merge it into the official xdrip build (if it would be accepted)

Ver 0.2.3 (23.02.2020)

  • New. Added option to disable graph on watch
  • New. Added a new watchface without graph (would be used when disabled graph)
  • New. Added option to collect heart rate data from miband. Update interval can be configured in MiFit or any thirdparty application. To see heart rate data in xdrip, the options “Use Health Data” and “Heart Rate sensor” which is located in Settings -> Smartwarch Features -> Smart watch sensors, should be enabled.
  • Improvement. Updated graph watchface view
  • Fixed. Authorisation issue on some miband 4 devices
  • Syncronized with official xdrip version

Added a new options which are available only when enabled engineering mode https://github.com/NightscoutFoundation/xDrip/wiki/Engineering-Mode

  • New. Added option which allow to disable hight MTU (when enabled, can fix watchface sync issues which may happen on some phones, but the watchface uploading would take much more time)
  • New. Added possibility to install custom watchface. The custom watchface files ‘my_watchface.bin’ and ‘my_image.png’ should be placed into into ‘xdrip’ folder on your phone. “my_watchface.bin” is a normal watchface and my_image.png is a watchface background image. The background image shouldn’t have more than 128 colors. For faster delivery and longer battery life, the wathcface size should be as small as possible.
  • New. Added offset option for custom watchface (defines offset between top of the background image and xdrip generated data)

Ver 0.2.2 (09.02.2020)

  • Improvement. Added BG update interval in night mode.
  • Improvement. UI improvements on the band settings screen.
  • Syncronized with official xdrip version

Ver 0.2.1.1 (03.02.2020)

  • Watchface. Fixed HR value when no data available.
  • Watchface. Increased font size for delta and bg date.
  • Fix in watchface generation algorithm which should fix “black” watchfaces reported by some users.
  • Fix. Requesting higher MTU size and use the size negotiated by Bluetooth protocol. (should fix watchface synchronization issue).
  • Improvement. BG alarms now work as call. On MiBand 3 and 4 the ignore button will delay alarm, and hangup will snooze alert.
  • Improvement. Authentification for miband2 and 3 (no need to approve auth after disconnection).
  • Improvement. Decrease brightness when uploading watchface. This can significantly improve band battery life. Also makes watchface update to be not so noticeable to people around.
  • Improvement. Added night mode settings.
  • Resend BG as notification if watchface cannot be installed when the battery level is less than 10%

Ver 0.2.0.1 (29.01.2020)

  • Quick-fix to fix a empty watchscreen and small styling issues

Ver 0.2.0 (29.01.2020)

  • New algorithm to represent glucose data, which use a dynamic watchface with a custom background. This allows using all miband features. (only for MiBand4)
  • Like in previous versions, MiBand 2 and 3 can receive bg values as a notifications.

251 thoughts on “Future of the xdrip miband project

  1. Big Thanks! Great budget solution for poor people like me, and its look cool too 🙂
    Works great with huawei mate 20lite+latest xdrip nightly+mi band 4

    Like

  2. hello, I would like to point out that the last version of 15/03/2020 still poses some synchronization problems, I had to uninstall xdrip and redo everything from the start, so I am wondering about the possibility of a new update integrating the new features of the current official version, thank you very much
    PS:on the installed version of the xdrip of 3/15/2020 or those before I cannot display the heart rate as for the number of steps, it is displayed but remains at zero.

    Like

  3. Works very good. One issue: With the current xdrip nightly from 20200419 working on a xdrip sync follower phone I get no indication when the master phone dont get new readings. Is this a know issue?

    Like

      1. Buenos dias maestro desde España.
        Resulta que hemos seguido todos los pasos de su tutorial con la ultima versión de xdrip. Pero no nos aparece la esfera de glucosa en myband4.
        Nos llegan las alarmas de xdrip, si tenemos activada la casilla de “Bg reading” nos llegan las notificaciones cada 5 minutos pero si desactivamos “Bg reading ” no nos aparece la esfera.
        En estado del sistema my band de xdrip nos aparece conectado y autentificado.
        Qué estamos haciendo mal?

        Like

      2. Hi, you did gret job. Could be time for not recieved data edjusted for less then 30 min?
        Is there an option for always screen on? I would prefer.
        And the last one 🙂 Could there be shown minutes ago as Xdrip instead of the time?
        You know I am talking about six years old son to use it. He´s been having sony3 since that time

        Like

  4. Obviously I missed that this was merged into the official xDrip+ Nightlies?
    Just installed 2010-04-19 and found the MiBand settings in there and worked on my new OnePlus 8 Pro.

    Can you please update your blog here?

    Like

  5. Hi, I’ve performed every single step in your documentation. Xdrip tell me that the Mii Band was successfully authenticated. But unfortunately it will not send any watchface to the Miiband itself. (push notification are deactivated).
    Xdrip version 20200419.

    Like

    1. Could you please try to disable night mode feature in the xdrip settings, also disable “show bolus”, “allow to use custom watchface” and “bg readings as notification” options. And finally make sure you have enabled “send readings” option. If this does not help, try to enable “Disable hight MTU value” option under experimental section.

      Like

  6. Had some trouble setting this up but it’s running. thanks alot.
    Setup: xdrip nightly 20200419, mi Band FW 1.0.9.42, Mi Fit App frozen

    How does it work having xdrip and any third Party app (eg Mi Fit, Notify&Fitness) at the same time? When I had them both active watchfaces with BG from xdrip did not work.
    But I would like to continue to use especially N&F for other purposes.
    Is it possible just to have xdrip send the watchface and to use N&F for notifications, pulse etc.?

    Like

    1. Works perfectly with any third party applications. Personally i use xdrip + notify & fitness for miband. But there no difference which apk to use. You just should use the apk key which was generated in patched mifit (if thirdpatrty application allows to enter it manually). If you use original mifit apk, just make sure you not unpaired you band when authorisation key was generated in the patched mifit and you use the same login account which was used when you paired your band in patched mifit

      Like

      1. It works. Again 🙂
        I really had some trouble. On the first run it worked out of the box. I tried a few things here and there and suddenly watchfaces failed to update. I tried resetting everything, re-Installing all the apps, but still xdrip failed to update the watchfaces. I didnt count how often i reset the whole setup until trying the “disable high mtu value” option. Now it is working again. Strange tho, cause i worked without this option at the beginning.
        But I’m happy now 🙂
        Hope the new watchface will soon be integrated in xdrip nightly.

        Cheers
        Ric

        Like

  7. Works stable on my Motorola One with Android 10. But trying a China android phone running Android 8.1 I get no watchfaces uploaded to the band. Google Play Sevices isnt running. Do I need Wear OS installed?

    Like

  8. Really great that your Band integration would be merged.

    Can you tell me what I need to do to switch to the nightly? Do I need to deinstalled your version or can I install the nightly over it?

    THX for your help 🙂

    Like

    1. Yes, just reinstall application. Do not forget to make a database and settings backups before deinstallation. In this case you can easily restore all your settings and data on the nightly build apk version.

      Like

  9. Guten Tag,
    Leider bekomme ich die xdrip Kurve nicht auf die Uhr. Kann sich jemand von euch mit mir in Kontakt setzen? Ich bin leider etwas am verzweifeln. Ich habe mich an die Anleitung gehalten. Bekomme es aber nicht hin.

    Liked by 1 person

    1. So you see the current glucose value on the band, but do not see the graph? If yes, please make sure you have enabled checkbox “Enable graph” in xdrip miband settings

      Like

  10. Hi @bigdigital,

    Thanks for the work, I really appreciate!
    So i have the newest nightly and xdrip+ works pergectly on my Miband 4 (really easy installation, thanks!)

    So in Xdrip i see, that there is also a beta, for a custom watchface.
    Do you have any hint how to “modify” your watchface? And where to copy it (I just find the xdrip export folder on my mobilephone).
    What i want to do is to change the Background (from black to a picture), add the heart rate (like you have it in an older version, but still show the battery percent) and to change the date style from US/UK to European (German) 🙂

    Like

  11. Hi,
    Thanks for this awesome watchfaces for MiBand from xDrip ! … I have discover an issue on NIGHT MODE intervals: If it is set at “continuous readings” it works, but if you set reading intervals, let says at 10′ minutes, it doesn’t actuallize the MiBand glucose values every 10′ minutes as supposed, and as a consequence the alarms doesn’t works properly either. Cheers and THANKS, Alberto

    Like

  12. Good job. I have a problem. The brightness of the clock is set to 4. Often, shortly after synchronization, the brightness jumps to 1 when queried and only returns to 4 after a few seconds. The Xdrip version is the latest Nightly and the night mode is switched off.

    Like

    1. Hi, this is normal behaviour. During watcface uploading the miband firmware activates screen and keeps the screen on until update process would’nt be finished + 6 seconds after succesfull watchafece uploading. To improve battery life and make the uploading process not so noticeable for people around, the xdrip decreases brightness to minimum, and then, sets back it to the value defined in the settings.

      Like

  13. Thank you, now or maybe in the future there is the possibility to increase the brightness manually during synchronization Sometimes it takes a long time that the brightness is raised from 1 to 4 again.

    Like

  14. Sorry if I’m annoying you. I have installed or executed all Aps and settings as described. Unfortunately I get the xDrip Watchface and therefore no display on the clock. “BG readings as notifications” works however.

    Thank you very much for your work and for making it possible to use the MiBand 4. I have diabetes since 1966 and I am very happy about the many possibilities which are possible today. Also about the luxury of wearing the values on my wrist 🙂
    By the way: On my watch the folder “freemyband” is stored on the internal memory and not on the SD card.

    Thank you very much in advance for your help.

    Translated with http://www.DeepL.com/Translator (free version)

    Like

  15. Recently Xiaomi have announced the new my band 5. Will I can see the blood glucose in my band 5 the same as in my band 4? If so, will the installation process be the same? Thanks in advance.

    Like

    1. No, the xdrip will not work with new band 5 xiaomi version. At least for now. Even if they did not change the command protocols, the new mi band has a different screen size, which means that watchface from miband4 will not work here. To implement integration for the new miband, it would be required to reverse engineer and test new watch model and for this i would need to have this watch on my table. At the moment i not planing of switching from my miband 4 to miband 5. But when i collect enought funds from my Patreon page https://www.patreon.com/xdrip_miband i will buy this watch and try to implement integration.

      Like

        1. I’ve almost collected the required funds to purchase Mi Band 5. For this, i want to thanks Lukas Petro,
          Alberto HD, Otto75so3e and Michalis Velonakis. Now just need to wait while miband 5 appears in local stores.

          Liked by 1 person

          1. Hi, unfortunately no. There no legal way to receive payments via paypal in our country 😦 . But you can donate via Patreon service and after the first donation, you can unsubscribe. In this case you will donate only once.

            Like

  16. Thank you. This helps me a lot with managing my blood glucose. It’s a real improvement of my life. Installation was very easy in xdrip+ & freemyband.

    Like

    1. Glad you enjoyed this project. In the near future, I plan to spend the funds raised on Patreon platform to purchase the new miband 5 and apply such integration to the latest miband.

      Like

      1. Could you also start a Patreon campaign for the amazfit gts? I’ve been looking for a wachface for so long … Unfortunately I’m not adequately technical to do it myself. I would be very grateful to you!

        Like

  17. I have a similar Problem like Burkhart and Martin: Connection to MiBand works, I get glucose readings as a message. But I cannot get the watchface to work.
    I did:
    -disable “show bolus”,
    -“allow to use custom watchface”
    -“bg readings as notification”
    -enabled “send readings” option.
    -enable/disable “Disable hight MTU value” option under experimental section.

    Only “disable night mode feature in the xdrip settings” gives me problems, I cannot find it. Is that the reason it´s not working?
    Do you know if the android wear settings make a difference? Mine was turned on, turninhg it off does not help. I used a pebble before trying the MiBand, think I can use both?

    Thanks for all the great work!

    Like

    1. OK, if anyone else has this issue, i figured it out (for my setup). Somehow it worked after doing all the things mentioned above and then activating android wear under the watch setting in xdrip. But only after some time, then a popup from xdrip or android (can´t remember) asked if I wanted to activate it. After that it displayed the watchface correctly (and beautifully, I might add). Thank you!!!

      Like

  18. Hey, big thanks! Thats amazing. Im new to xdrip and will try your solution.
    Do you plan on adding support for the miband 5 aswell? It will be released on the 15th of July.

    Like

  19. Hi I have followed all of the instructions in setting up the watch. Notifications work but no matter what I try the dynamic watch face will not work. Checking the event log shows that the watch face generator is running with no errors being reported however the watch face does not update on the Mi band. I am using the latest nightly of xDrip and the Mi band is on the latest of firm ware, making other changes under the mi band screens/features options changes the setting on the mi band immediately. I am at a loss as to what to do, are you able to give me some guidance please.

    Like

    1. Hi, sorry for the delay. Could you please try to disable night mode feature in the xdrip settings, also disable “show bolus”, “allow to use custom watchface” and “bg readings as notification” options. If this does not help, try to enable “Disable hight MTU value” option under the experimental section.

      Like

  20. Awesome! I got an MiBand 5, expecting it to work with this but it didn’t. I didn’t manage to install the Free my Band app on my motorolaOne (android 10), it just doesn’t open the dowloaded app with an option to install, as it does with Xdrip. Installed the latest night build from Xdrip which doesn’t have the BG readings as notifications as an option. There’s anyway to help you to make this works on MiBand 5?

    Like

    1. Awesome! But I’m interested in help you coding, testing, whatever. Of course, if you want/need some help with it. And I’m signing as Patreon, so you can keep motivate to continue doing such great work. Thanks!

      Like

      1. Thanks. It would be great if you can help me with the future testing. For now, i still waiting when miband 5 appears in our country and trying to understand a new watchface format. By analysing available watchfaces here https://amazfitwatchfaces.com/mi-band-5/fresh I see it was changed. So need to reverse engineer it again. Also hope the communication protocol wasn’t seriously changed in comparison to the older models.

        Like

  21. Hey bigdigital,

    thank you so much for your work and time. I’ll buy a miband 4 tomorrow, due to the bad battery life and no real improvements of the miband 5 i decided to go for the band 4.
    Thank you so much for your work!!
    Did you ever thought about providing support for LiteOS? This would help to bring xdrip to, for example, the HUAWEI Watch GT 2e or Honor MagicWatch 2. I found these watches with there 14 day lifespan very interesting. Especially when WearOS watchs only last 2 days max.

    Like

  22. Thank you so much for your great work ! It will be so good 🙂

    I just can’t see on the watch the heart rate (despite choosing the option in the parameters) but i can see the steps. How can I do to have both ?
    On XDRIP I have neither heart rate nor number of steps
    how I can fix this.

    Thanks so much in advance !

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website at WordPress.com
Get started
%d bloggers like this: