MiBand 2: Add support for custom Notifications like MiBandTools #560

Closed
by Teyro opened 5 years ago · 36 comments
Teyro commented 5 years ago (Migrated from github.com)
Owner

Well is it planned to add the custom Notifcation API of the MiBand 2 to GB? For a long time many people thougt that the MiBand cant handle Custom Notifications because firmware limitations but since one or two months the App MiBandTools Reversed Engineerd the API.... https://play.google.com/store/apps/details?id=cz.zdenekhorak.mibandtools

For Example you can write custom Text to the MiBand with a custom Icon....

I am useing the MiBand 2 and i would be a nice feature....

Well is it planned to add the custom Notifcation API of the MiBand 2 to GB? For a long time many people thougt that the MiBand cant handle Custom Notifications because firmware limitations but since one or two months the App MiBandTools Reversed Engineerd the API.... https://play.google.com/store/apps/details?id=cz.zdenekhorak.mibandtools For Example you can write custom Text to the MiBand with a custom Icon.... I am useing the MiBand 2 and i would be a nice feature....
Owner

Can you capture some Bluetooth dumps with example notifications and post them here (together with the information what the notifications contained)?

Can you capture some Bluetooth dumps with example notifications and post them here (together with the information what the notifications contained)?
ghost commented 5 years ago (Migrated from github.com)
Owner

I also would be interested in this feature and would have provided a dump but my current system (crdroid) doesn't seem to support it. I would donate the costs of a license for MiBand Tools to cpfeiffer, would that help?

I also would be interested in this feature and would have provided a dump but my current system (crdroid) doesn't seem to support it. I would donate the costs of a license for MiBand Tools to cpfeiffer, would that help?
Teyro commented 4 years ago (Migrated from github.com)
Poster
Owner

Well i could send you many dumps but someone need to tell me how ;) Sry :S I am useing Linux for Years but this is a thing what i have never done before.... :)

Well i could send you many dumps but someone need to tell me how ;) Sry :S I am useing Linux for Years but this is a thing what i have never done before.... :)
Owner

@Teyro Please have a look at https://github.com/Freeyourgadget/Gadgetbridge/wiki/Log-Files
All you need is your phone and your band.

@Teyro Please have a look at https://github.com/Freeyourgadget/Gadgetbridge/wiki/Log-Files All you need is your phone and your band.
Teyro commented 4 years ago (Migrated from github.com)
Poster
Owner

Here is my export ;) Hope that helps ;) Useing custom Notifications
btsnoop_hci.txt

Here is my export ;) Hope that helps ;) Useing custom Notifications [btsnoop_hci.txt](https://github.com/Freeyourgadget/Gadgetbridge/files/802089/btsnoop_hci.txt)
Owner

(Removed comment because I mixed it up with #510)

(Removed comment because I mixed it up with #510)
Owner

Do you know if one has to enable such text notifications first? I have code that sends a text notification to the band, but it does not display it. I'm using firmware 1.0.1.39.

Do you know if one has to enable such text notifications first? I have code that sends a text notification to the band, but it does not display it. I'm using firmware 1.0.1.39.
ghost commented 4 years ago (Migrated from github.com)
Owner

Yes, one has to enable it in MiBand tools. One can also select what to display and from which app. For example you can add the k-9 email app and tell MiBand tools to display $contact and $content in all k-9 notifications. They display in message parts of 18 characters, each separated by a vibration and an icon. MBT lets you chose the icon and the pattern of the vibration. I'm not sure but I think I read that it is a limitation of the Mi that the messages are split up that way.

Yes, one has to enable it in MiBand tools. One can also select what to display and from which app. For example you can add the k-9 email app and tell MiBand tools to display $contact and $content in all k-9 notifications. They display in message parts of 18 characters, each separated by a vibration and an icon. MBT lets you chose the icon and the pattern of the vibration. I'm not sure but I think I read that it is a limitation of the Mi that the messages are split up that way.
Owner

Can you do a btsnoop when enabling it? I'm not sure if it actually needs to send something to the band in order to enable this feature.

Can you do a btsnoop when enabling it? I'm not sure if it actually needs to send something to the band in order to enable this feature.
Owner

Note that the commit does not work, at least on my band. There must be something else to enable this generally (so I need a btsnoop of that).

Note that the commit does not work, at least on my band. There must be something else to enable this generally (so I need a btsnoop of that).
ghost commented 4 years ago (Migrated from github.com)
Owner

Well, I setup a backup device to be able to make a dump. I hope this helps.
btsnoop_hci.zip

What I did: I added the default Android email app to the app selection in MiBand Tools, then I sent a test message with the standard settings ($title $content) from MiBand tools. Then I did the same with the Android SMS app. After doing so I changed the SMS notification settings to $contact and sent a test message from the MBT app again.

Well, I setup a backup device to be able to make a dump. I hope this helps. [btsnoop_hci.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/818778/btsnoop_hci.zip) What I did: I added the default Android email app to the app selection in MiBand Tools, then I sent a test message with the standard settings ($title $content) from MiBand tools. Then I did the same with the Android SMS app. After doing so I changed the SMS notification settings to $contact and sent a test message from the MBT app again.
Owner

Still unsuccessful. I read that the feature is only available when you change the language in Mi Fit to Chinese. Did you do anything like that?

Mi Fit (or possible Mi Band Tools probably "unlocks" this feature on the band by sending some command (triggered by changing the language before synchronizing with Mi Fit, for example).

Still unsuccessful. I read that the feature is only available when you change the language in Mi Fit to Chinese. Did you do anything like that? Mi Fit (or possible Mi Band Tools probably "unlocks" this feature on the band by sending some command (triggered by changing the language before synchronizing with Mi Fit, for example).
Owner

Looks like I have to install the English font, first. Do you have a btsnoop of that?

Looks like I have to install the English font, first. Do you have a btsnoop of that?
ghost commented 4 years ago (Migrated from github.com)
Owner

I don't have the Chinese firmware. And I didn't install any font. My firmware version is 1.0.1.34, installed via the PlayStore version of MiFit, which is English. Language in MBT is German. Should I provide the firmware file?

I don't have the Chinese firmware. And I didn't install any font. My firmware version is 1.0.1.34, installed via the PlayStore version of MiFit, which is English. Language in MBT is German. Should I provide the firmware file?
ghost commented 4 years ago (Migrated from github.com)
Owner

I made a firmware upgrade now with GB, runs wonderful BTW. But I haven't installed the English font I found in the new apk and text notifications still work. I guess that means that the font was already installed? Maybe, I should have mentioned that I bought the band used and updated it twice in the meantime.

I made a firmware upgrade now with GB, runs wonderful BTW. But I haven't installed the English font I found in the new apk and text notifications still work. I guess that means that the font was already installed? Maybe, I should have mentioned that I bought the band used and updated it twice in the meantime.
ghost commented 4 years ago (Migrated from github.com)
Owner

If you need more precise dumps with real test emails, I could provide them outside of Github. Andreas has my email address.

If you need more precise dumps with real test emails, I could provide them outside of Github. Andreas has my email address.
Owner

@girlwithnoname can you test current master and see if text appears when you get a notification? Just test with the Debug view, for example.

I have all the firmware files. The fonts are actually separate from the firmware. Gadgetbridge does not support sending these to the band, atm.

My date/time display is English, so I suppose I must have an English font, or at least part of it. There must be something missing. So if it works for you, our implementation is correct at least, and I only need some other configuration. It oculd very well be that it won't work for you right now, since I currently do not send some configuration flags. Need to find out what they mean -- I don't see any effect on my band at least.

@girlwithnoname can you test current master and see if text appears when you get a notification? Just test with the Debug view, for example. I have all the firmware files. The fonts are actually separate from the firmware. Gadgetbridge does not support sending these to the band, atm. My date/time display is English, so I suppose I must have an English font, or at least part of it. There must be something missing. So if it works for you, our implementation is correct at least, and I only need some other configuration. It oculd very well be that it won't work for you right now, since I currently do not send some configuration flags. Need to find out what they mean -- I don't see any effect on my band at least.
ghost commented 4 years ago (Migrated from github.com)
Owner

Done. I don't see any text but there is a difference now: I now see two icons after another. The general notification icon followed by the email icon as chosen in MiBand Tools. I've just tested this on my main device, MiFit and MBT are installed, too.

Done. I don't see any text but there is a difference now: I now see two icons after another. The general notification icon followed by the email icon as chosen in MiBand Tools. I've just tested this on my main device, MiFit and MBT are installed, too.
Owner

Thanks for testing. The two notifications were expected.

Now I send another config option now, can you checkout the mi2-text-notifications branch and test again?

Thanks for testing. The two notifications were expected. Now I send another config option now, can you checkout the mi2-text-notifications branch and test again?
ghost commented 4 years ago (Migrated from github.com)
Owner

Still no text, but now I only see the email icon.

Still no text, but now I only see the email icon.
ghost commented 4 years ago (Migrated from github.com)
Owner

But hey, with SMS debug test I see text :)

But hey, with SMS debug test I see text :)
ghost commented 4 years ago (Migrated from github.com)
Owner

Still doesn't work with commit 3b94bbb.

Still doesn't work with commit 3b94bbb.
ghost commented 4 years ago (Migrated from github.com)
Owner

I just noticed that I don't receive any real email notifications anymore both when only GB is installed and with the other apps active. The k-9 settings option also has vanished from GB settings. Plus the connection is now very unstable.

I just noticed that I don't receive any real email notifications anymore both when only GB is installed and with the other apps active. The k-9 settings option also has vanished from GB settings. Plus the connection is now very unstable.
Owner

@girlwithnoname
K-9 settings + K-9 specific receiver have been removed a few versions back. It is now handled by the generic notification receiver. If you do not receive notifications at all you have to reboot your phone. There is an old Android bug regarding notification listener services.

@girlwithnoname K-9 settings + K-9 specific receiver have been removed a few versions back. It is now handled by the generic notification receiver. If you do not receive notifications at all you have to reboot your phone. There is an old Android bug regarding notification listener services.
ghost commented 4 years ago (Migrated from github.com)
Owner

Thanks, that did the trick.

Thanks, that did the trick.
Owner

After installing the font, text notifications start to work, so far, for SMS messages.

After installing the font, text notifications start to work, so far, for SMS messages.
Owner

Need some info: how this works with Mi Fit or MBT:
Which icons are visible together with the text? Is it always the generic "message" icon?

Up to now, I only managed to display a message with that message icon. Prior to that, we can easily vibrate and display other icons, in order to announce the text message.

Need some info: how this works with Mi Fit or MBT: Which icons are visible together with the text? Is it always the generic "message" icon? Up to now, I only managed to display a message with that message icon. Prior to that, we can easily vibrate and display other icons, in order to announce the text message.
ghost commented 4 years ago (Migrated from github.com)
Owner

The icon after the first one is the icon visible in the attached picture, hope it works.
tmp_31740-img_20170309_200748788658911

The icon after the first one is the icon visible in the attached picture, hope it works. ![tmp_31740-img_20170309_200748788658911](https://cloud.githubusercontent.com/assets/13291081/23766368/d2ebf0b8-0504-11e7-9d89-a234c37edc03.jpg)
Owner

Thanks, that's all I need to know. Perfectly fits with my own findings.

Thanks, that's all I need to know. Perfectly fits with my own findings.
Owner

Initial support is done for 0.18.0. There's certainly room for improvement, like

  • transliteration of non-ASCII characters
  • the choice of text content to display
  • the icons to display

but we can have new issues about these.

Initial support is done for 0.18.0. There's certainly room for improvement, like - transliteration of non-ASCII characters - the choice of text content to display - the icons to display but we can have new issues about these.
Teyro commented 4 years ago (Migrated from github.com)
Poster
Owner

Hi everyone.... Well i will make my promise become true.... But who has to get the Money?

Hi everyone.... Well i will make my promise become true.... But who has to get the Money?
Owner

I don't think you promised anything, but thank you anyway :-)

I don't think you promised anything, but thank you anyway :-)
sysdev41 commented 4 years ago (Migrated from github.com)
Owner

Hi, i would really be happy to use this cool feature.

Since MiBand2 firmware version 1.0.39 is recommended ( https://github.com/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-Firmware-Information ), i downloaded the MiFit App via APK Mirror (v2.3.0), extracted the archive and then flashed the following files from the /assets/ folder via GadgetBridge (v0.19.4 from F-Droid Store) to my MiBand2:
(1) Mili_pro.fw,
(2) Mili_pro.ft
and last:
(3) Mili_pro.ft.en.

In GadgetBridge i activated text notifications under "Mi Band Settings", but it doesn't work at all. I used the debug menu to send a test sms (GENERIC_SMS), but it doesn't work (no text, only symbol). I already rebooted the phone multiple times, no success so far.

Did i miss anything that has to be done as a prerequisite for text notifications to work?

Edit: OS is LineageOS 14.1

Hi, i would really be happy to use this cool feature. Since MiBand2 firmware version 1.0.39 is recommended ( https://github.com/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-Firmware-Information ), i downloaded the MiFit App via APK Mirror (v2.3.0), extracted the archive and then flashed the following files from the /assets/ folder via GadgetBridge (v0.19.4 from F-Droid Store) to my MiBand2: (1) Mili_pro.fw, (2) Mili_pro.ft and last: (3) Mili_pro.ft.en. In GadgetBridge i activated text notifications under "Mi Band Settings", but it doesn't work at all. I used the debug menu to send a test sms (GENERIC_SMS), but it doesn't work (no text, only symbol). I already rebooted the phone multiple times, no success so far. Did i miss anything that has to be done as a prerequisite for text notifications to work? Edit: OS is LineageOS 14.1
sysdev41 commented 4 years ago (Migrated from github.com)
Owner

@cpfeiffer Do you have any idea about my problem regarding text notifications?

@cpfeiffer Do you have any idea about my problem regarding text notifications?
eiffel-fl commented 4 years ago (Migrated from github.com)
Owner

Hello everyone.

I am a new user of GadgetBridge and I will firstly congratulate you for the great job you did and are doing :)

Just to know is it possible to choose to display only the id of the sender and not the text of the SMS ?

Good bye and thank you.

Hello everyone. I am a new user of GadgetBridge and I will firstly congratulate you for the great job you did and are doing :) Just to know is it possible to choose to display only the id of the sender and not the text of the SMS ? Good bye and thank you.
ragcsalo commented 3 years ago (Migrated from github.com)
Owner

Can we send a custom text directly to the Mi Band 2's screen by writing data to a specific characteristic (BT LE)? It seems possible, I just need to know which characteristic to write. Can someone help me with that? :-)

Can we send a custom text directly to the Mi Band 2's screen by writing data to a specific characteristic (BT LE)? It seems possible, I just need to know which characteristic to write. Can someone help me with that? :-)
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.