External HR sensor, HRM app and RAM

Posted on
  • I want to use an external BLE HR sensor with the old bangle.js1 and during the process I am getting following impressions and doubts.

    Firstly, I install "Bluetooth Heart Rate Monitor" and the feedback is

    • Too high usage of memory for a bangle.js1, it remove almost everything to free enough memory, and even after that sometimes i got the "New interpreter error: CALLBACK,MEMORY"
    • Setting: Modes
      • I miss a mode ONLY/exclusive for external sensor active or not (I assume that currently this option can be set with custom mode)


    about the README:
    For the "Custom" mode, options are not explained and it would be useful, specially for non native english speakers

    About Memory/performance:
    It seems that "Bluetooth Heart Rate Monitor" and its setting are using almost the complete bangle.js RAM.
    What about the slow SPI flash?
    Is it possible to reduce the usage of the limited and precious RAM without changing code?

    I assume that a change of code that replaces vars by static values would reduce significantly the RAM usage, right?

  • You should get BT HRM only when selecting the custom mode and setting that to:

    Replace HRM ✔️ (replacing the internal sensors values)
    Start w. HRM ✔️ (react to the same power calls as the internal sensor)
    HRM Fallback ☐ (do not try to activate the internal sensor if BT gets lost)

    Moving the code that is able to detect and pair with sensors into the settings could probably reduce the RAM use by quite a bit with the cost of always having to pair a sensor before use. That is probably not really a problem, most devices I know actually need some configuration before using a HRM instead of using whatever is available.

    Another possibility would be a low memory mode hard coding a lot more of the connection steps without the custom logic for handling many of the errors and parsing of additional data like battery and HRV data. Even restoring the initial implementation as base app and making the current one into a BT HRM+ version like many clocks are currently having would probably help a lot on B1.

    The BTHRM widgets should be blue/dark blue for the "BT HR" recorder, green/dark green for the "HR int" internal recorder and no other colors should be possible. The normal "HRM" recorder (icon should be red) is enough if you set BTHRM to replace the HRM event.

  • This has come up a few time, and one potential option is to just resurrect the original version of the BT HRM app, which didn't have all the features, but was pretty lightweight. That was originally made for Bangle.js 1 IIRC so it should work ok.

    I've just done this and you should be able to try it out in the dev app loader at https://espruino.github.io/BangleApps/?i­d=bthrmlite

    I imagine there are bugfixes and other stuff that aren't in it though. It works for me, but it may not function on your heart rate monitor I guess

  • The BTHRM widgets should be blue/dark blue for the "BT HR" recorder, green/dark green >for the "HR int" internal recorder and no other colors should be possible. The normal >"HRM" recorder (icon should be red) is enough if you set BTHRM to replace the HRM event.

    U 're right, and everything was fine before. I've just realized that the README refers to the "HR recorder" and I was referring to the HRM Widget(widhrt)

    Another possibility would be a low memory mode hard coding a lot more of the connection >steps without the custom logic for handling many of the errors and parsing of additional >data like battery and HRV data.

    I was wishful thinking about an alternative solution to settings on the watch and its higher use of variables.

    I mean adding the possibility of configuring an app from the app loader page, so the users chose parameters and then before upload there is a realtime modification of the app code and
    values are hardcoded on the javascript.

  • I've just done this and you should be able to try it out in the dev app loader at >https://espruino.github.io/BangleApps/?i­d=bthrmlite

    thanks

    I imagine there are bugfixes and other stuff that aren't in it though. It works for me, but it >may not function on your heart rate monitor I guess

    It worked perfectly with my BLE heart rate sensor, I dunno what would happen having additional sensors close and active. I can investigate further and try to improve a bit

  • I had problems with a dodgy WAHOO TICKR X2 which disconnected at least once a minute. That caused the first changes to get better connection stability/automatic reconnects and then feature creep happened :) The sensor has since been replaced by WAHOO and the new one works a lot better but still disconnects from time to time.

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

External HR sensor, HRM app and RAM

Posted by Avatar for dapgo @dapgo

Actions