New bangle 2 user, have questions!

Posted on
  • Hi all, first of all, am attracted to the privacy-focused side of an open source wearable. I don't like how the other apps share and sell your biometric data, so Bangle is 100% perfect for what I want to use it for!

    I do have questions which I hope can be answered here:

    1. i would like to turn off the bluetooth when I don't need it (I don't use the messaging notice feature). Does turning off BLE in settings turn off the bluetooth radio completely?

    2. Is there a widget that allows me to turn off bluetooth and turn it on with a simple click? I coudn't spot one on the app market... If not, i guess that's something I'll try to code in.

    3. I'm interested in my heart rate when i am doing exercise, but not when I am at work, watching movie etc. So I would like my heartrate to be measured dynamically - e.g. every 10 minutes when my heartrate is at rest (50-80), every 3 minutes when it goes up (e.g. im walking in the heat, 80-100) and constantly when I am actively exercising (100+). I get this feature isn't in the health app now, how easy would it be to add? Seems to me a good function - instead of having to manually update the frequency before a workout. Could also save on battery when its not needed.

    4. I will be synching with the gadgetbridge app every few days (when i turn bluetooth on). Is there an app or a way to store all the health data (heart rate, sleep, steps) and synch it to the app when it connects to the app? Is the steps data stored anywhere on the device? Is there an app that stores this data?

    Thanks for the (hopefully) answers!

    FYI, I can code whatever as long as chatGPT can make the change - that's my level of coding ability :)

  • Hi! :)

    1 . i would like to turn off the bluetooth when I don't need it (I don't use the messaging notice feature). Does turning off BLE in settings turn off the bluetooth radio completely?

    I think for most intents and purposes, yes. But not when on the DFU bootloader before Espruino firmware is loaded on the watch - this way you can always restore the watch if something goes badly. Hopefully someone will correct me if I'm wrong.

    This comment on another conversation may be interesting (don't know if it's accurate still): https://forum.espruino.com/conversations­/376607/#16555865

    3 . I'm interested in my heart rate when i am doing exercise, but not when I am at work, watching movie etc. So I would like my heartrate to be measured dynamically - e.g. every 10 minutes when my heartrate is at rest (50-80), every 3 minutes when it goes up (e.g. im walking in the heat, 80-100) and constantly when I am actively exercising (100+). I get this feature isn't in the health app now, how easy would it be to add? Seems to me a good function - instead of having to manually update the frequency before a workout. Could also save on battery when its not needed.

    I don't think there's something quite like that dynamic hrm logging, but should be possible. One could discuss whether to add the functionality to the health app as an option or if it should be a new app (personally I'd probably say add to the health app).

    4 . I will be synching with the gadgetbridge app every few days (when i turn bluetooth on). Is there an app or a way to store all the health data (heart rate, sleep, steps) and synch it to the app when it connects to the app? Is the steps data stored anywhere on the device? Is there an app that stores this data?

    There is activity fetching to Gadgetbridge, currently sending heart rate, steps and movement info that was stored by the health app. Gadgetbridge fetches data from the last sync date up to the latest available data. Sleep data is logged by the sleeplog app, but syncing it to Gadgetbridge is not implemented yet (would be a neat addition if you're up for a challange maybe). Activity fetching was added with this PR I think.

  • thanks for the answers... i guess for bluetooth, i didn't really get the answer i wanted - i want to turn off the bluetooth radio (not just turn off discovery or discoverable, or some low power option). Just want to confirm this is what happens when you untick BLE. Reason is, I don't like the idea of having a bluetooth signal near my head for long periods of time (e.g. when i sleep).

    I think you said yes, bluetooth radio is turned off, except for when you reboot the watch? so if i don't reboot then bluetooth radio is off? Just confirming :)

  • I'll see about updating my health app for the dynamic time check. I assume the check delay is a variable, and I can just modify the heartrate check method in the code so that if the HR is over a certain amount, it sets the delay dynamically shouldn't be very hard....

    Great to hear the health app stores days of data... do you know how many days it stores?

  • I think you said yes, bluetooth radio is turned off, except for when you reboot the watch? so if i don't reboot then bluetooth radio is off? Just confirming :)

    I'm not certain on the technicalities. When @Gordon gets back next week I'm sure he'll know the answer.

    You can have a look at the NRF class in the meantime.

    Also found this searching the web, but don't know if it's relevant.

  • do you know how many days it stores?

    Not really sure if records are ever deleted automatically at all. I'd refer you to the code/readme/PRs or have someone else answer.

    Two notes on implementing dynamic hrm logging:

    • You could use the step counting as indicator for exertion level and to change hrm logging interval. Or just look at the latest hrm reading like you've said.

    • The syncing logic will probably break with changing the logging interval. I think Gadgetbridge expects 10 min intervals. So that would probably need tweaking as well.

    EDIT:

    Also just to make sure, you're aware of the recorder app? Maybe you'd want to trigger that automatically instead of changing the health app. Another way to acheive your goal maybe.

  • so if i don't reboot then bluetooth radio is off?

    yes, it is off even when rebooting, only when you hold button to reboot and then release in the middle while the bar going past the screen and it says "DFU start" then it is advertising and waiting for firmware update

    not just turn off discovery or discoverable, or some low power option
    ..
    I don't like the idea of having a bluetooth signal near my head for long periods of time

    When it is not advertising (=something you call "just turn off discovery or discoverable, or some low power option") there is no transmission at all. It is not some low power mode, the radio part is simply completely off. Well, unless your watch actively runs some javascript code to search for other devices and/or is trying to connect to them.

    When it is advertising it is still very very far from something that could be called "bluetooth signal near my head for long periods of time" and also the power of the signal is very low. That is why your watch lasts weeks on tiny battery (and BLE beacons last about a year on single CR2032 battery). Unless you turn off your phone completely during night and also turn off your wifi router I think it makes no sense to worry about this.

    The BLE advertising (of bangle.js) is sending 3 packets each taking about 500 microseconds once per 380 miliseconds. So about 378.5/380 of the time the radio is not transmitting = completely off. And the radiated power when transmitting is about 2.5mW (wifi router is about 100mW)

  • Thanks for the precision, still something i'd rather have off completely. good to know that's what the option does.

  • You could use the step counting as indicator for exertion level and to change hrm logging >interval. Or just look at the latest hrm reading like you've said.

    The syncing logic will probably break with changing the logging interval. I think >Gadgetbridge >expects 10 min intervals. So that would probably need tweaking as well.

    Could someone point me to the code that measures the heart rate? Sorry im not familiar with the codebase at all. I'll try and make the adjustment. The health app appears to be a display app for data (not the code that does the actual measuring?).

    As for synching, not an issue for me, i'll only sync once a week or so.

    Will have a look at recorder, not sure i noticed it when i scanned the apps.

  • Could someone point me to the code that measures the heart rate?

    Look for hrm related methods of the Bangle class in espruino reference.

    I think you should find some of those in the health and recorder apps boot.js or widget.js files in the BangleApps github repo.

  • so the base firmware does the hrm check? Maybe I could tie into health and when it does it check, use that check to modify the HR delay variable... okay that gives me enough to go on.

    If I modify the code, does it need to be compiled in any way in order to be uploaded to the watch? Or is it better to do a pull request and wait for whoever maintains it to accept/reject the change?

    This could just be a new option in the health app (dynamic HR monitoring on/off).

  • If I modify the code, does it need to be compiled in any way in order to be uploaded to the watch? Or is it better to do a pull request and wait for whoever maintains it to accept/reject the change?

    Check out the espruino tutorials, especially:

    Develop and iterate for yourself first. Once you're happy with the functionality and want to add it to the main repo do the PR. If you want feedback before that I'd suggest to point to the changes on your fork, or you could open a draft PR to the main repo.

  • As for synching, not an issue for me, i'll only sync once a week or so.

    Yes, but I suspect you'll run into problems anyway that would need to be solved. If Gadgetbridge expects every record entry to correspond to 10 minute periods but your entries corresponds to variable length periods - what happens? I don't know.

  • so aren't there 3 minute and always options for heart rate monitoring? what does the app do for people who choose those options????

    Strange thing

  • Previous answer by Gordon on another conversation:

    The health app on the Bangle only stores data every 10 minutes. The '3 minute' option is for the heart rate - it'll take 3 HRM samples every 10 minute slot and use the best/average value of HRM readings - but it only stores one reading per 10 minutes.

    If you want more than every 10 minutes and more useful data, you'd be better off just using the recorder app on the Bangle: https://banglejs.com/apps/?id=recorder

    https://forum.espruino.com/conversations­/386312/#comment16972306

  • Sorry for the delay - I think things are basically all answered now, but just to clear up:

    Turning Bluetooth off

    Turning bluetooth off in settings really does mean no bluetooth transmission on a default watch unless you totally reboot it or install apps that use BLE for something else.

    Heart rate recording

    @Ganblejs basically hit this spot on in the last post:

    The 'health' app records HRM every 10 minutes, and that period is hard-coded into the file format (it just keeps all entries, because you could store ~30 years worth using the onboard flash)

    If you want it faster, I think what you really want is the recorder app which can record not just HRM/steps at any rate you want, but other stuff too like GPS coordinates or altimeter values. If you wanted to make something that looked at accelerometer values, detected exercise and then turned the recorder on and off automatically then that might actually be a really neat addition (and not that hard at all)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

New bangle 2 user, have questions!

Posted by Avatar for user157504 @user157504

Actions