GlucoDataHandler icon indicating copy to clipboard operation
GlucoDataHandler copied to clipboard

Add Support for BangleJS

Open phrogg opened this issue 2 years ago • 16 comments

Gude,

I've made an app a while ago, to be able to send blood glucose values to a BangleJS watch. I think this bit of code would be beneficial for your projet, or do you want to only support googles war os? If you are interested in this, give me a ping and I will create a pull request in the future. :) Here is a link to my app: https://codeberg.org/phrogg/BG2BangleJSApp already in F-Droid.

Alles jute Phil

phrogg avatar Nov 29 '23 11:11 phrogg

Hi Phil,

I never heard about BangleJS watches, but why not... Just for information, is there any watchface, you will need for that?

As I have seen, there is only an intent to send for the the BangleJS. This is not a big thing and I can implement. I´m still planing to move the receivers out of the current service to an extra class. While doing that I can also add these lines. But if you like, you can do it also...

Regards, Michael

pachi81 avatar Nov 29 '23 12:11 pachi81

Hi Phil,

I never heard about BangleJS watches, but why not... Just for information, is there any watchface, you will need for that?

As I have seen, there is only an intent to send for the the BangleJS. This is not a big thing and I can implement. I´m still planing to move the receivers out of the current service to an extra class. While doing that I can also add these lines. But if you like, you can do it also...

Regards, Michael

However, you like. I would be glad to help :)

phrogg avatar Nov 30 '23 15:11 phrogg

Can you explain, what exact is BangleJS and how this intent work on the watch? Is there a special widget or anything like this?

pachi81 avatar Nov 30 '23 15:11 pachi81

Can you explain, what exact is BangleJS and how this intent work on the watch? Is there a special widget or anything like this?

Sure BangleJS has two watches. Both run espruino which is a neat thing because you can easily develop apps and widgets for the watch. I've created a widget for it that receives the intent from the app and displays the value with options as well. I would to broaden the possibilities for the app as well as the widget so that more and more people implement and use so that there is a crowd who works for it to get better over time.

phrogg avatar Nov 30 '23 15:11 phrogg

Hi, just for your information, I have not forgotten you, but I had a lot of problems getting the app in the playstore. I don't think, that I can add it this year, but it is the next point on my list. As soon I can continue working on the app, you will get a version to test. Regards, Michael

pachi81 avatar Dec 20 '23 19:12 pachi81

Hi Phil,

I had some time :-) Here you can download and test the app: https://1drv.ms/f/s!AvqtWFwQmBjwz6cnbx5R-92cIBDUbg

You find the setting at the bottom in the settings-menu. This is what I'm sending: GDH.GlucoDataServiceMobile : Send to bangleJS: require("Storage").writeJSON("widbgjs.json", {'bg': 145,'bgTimeStamp': 1703187989326,'bgDirection': 'FortyFiveDown'});

Is this ok? What about mmol/l? Do you convert it or should I send it in bg value.

pachi81 avatar Dec 21 '23 19:12 pachi81

Hey, nice work. I will try it in the new year, since I don't have my watch with me right now. The code u send looks good. mmol/l will be calculated on the watch itself, no need to worry about that.

phrogg avatar Dec 22 '23 21:12 phrogg

Hi Phil,

had you some time for testing?

Regards, Michael

pachi81 avatar Jan 10 '24 15:01 pachi81

Hi Phil,

had you some time for testing?

Regards, Michael

Hey sorry, not yet. Maybe on the weekend. I'm currently working a lot on my master's thesis and at work.

Sorry.

phrogg avatar Jan 18 '24 07:01 phrogg

Hey,

I had some time and tried it. Unfortunately, though, it didn't work for me. I had no time to reverse engineer why this would be the case. I got the data directly from juggluco and not from xdrip does this make a difference?

phrogg avatar Mar 13 '24 12:03 phrogg

Hi, that makes no difference. Maybe it is related to the format of my value. I will check later. But then I need you for testing...

pachi81 avatar Mar 13 '24 13:03 pachi81

If I compare your implementation with my, I do not see a real difference. Can you check: https://codeberg.org/phrogg/BG2BangleJSApp/src/commit/dcee7c30d36fb104b5db20504f6af9dab1be0664/app/src/main/java/de/phrogg/bg2banglejs/DataReceiver.java#L29 https://github.com/pachi81/GlucoDataHandler/blob/6382dccb6cb665489b4f1ef8c6fd5e1d894ff880/mobile/src/main/java/de/michelinside/glucodatahandler/GlucoDataServiceMobile.kt#L110

pachi81 avatar Mar 13 '24 13:03 pachi81

Sorry somehow this feel completely out of my mind. Gonna look into that today :)

phrogg avatar Nov 12 '25 11:11 phrogg

Hi, I already commented out the BangleJS support, as there was no feedback anymore. Are you still interested in? I do not get any other requirements for this topic...

pachi81 avatar Nov 12 '25 11:11 pachi81

I'm, but I can prob just do it as a PR. Don't know much about kotlin though. Always did everything in java :D

phrogg avatar Nov 12 '25 11:11 phrogg

You just need to remove the comments for the sending and can also disable the pref-check: https://github.com/pachi81/GlucoDataHandler/blob/005a9b38a8899b6ebfdbe9448e91dda1c7e552a4/mobile/src/main/java/de/michelinside/glucodatahandler/GlucoDataServiceMobile.kt#L335

Then you can test for your own. If it is working, I can re-add the feature.

pachi81 avatar Nov 12 '25 12:11 pachi81