• Hello there,

    I've recently gotten my hands on a BangleJs 2 smartwatch and have been thoroughly enjoying exploring its cool features. However, I have a couple of questions that I'm hoping the knowledgeable folks in this community can help me with.

    First off, I'm curious to know if it's possible to tap into the heart rate monitor (HRM) sensor data on the BangleJs 2 smartwatch via apps like OpenTracks using Gadgetbridge. Having access to this data within external applications would be super handy for tracking and monitoring my physical activities.

    On another note, I'd love to know if the BangleJs 2 smartwatch plays nice with displaying recorded activities within Gadgetbridge. Specifically, I'm eager to find out if I can view and analyze my sports activities or workouts right within the Gadgetbridge interface. I stumbled upon this link (https://codeberg.org/Freeyourgadget/Gadg­etbridge/wiki/Sports-Activities-Workouts­) which provides some interesting insights into the sports activities and workouts features in Gadgetbridge. If the BangleJs 2 smartwatch can seamlessly integrate with Gadgetbridge for these features, it would be an absolute game-changer, offering me a convenient and comprehensive overview of my progress.

    Any input on how I can achieve this goal or get similar results is highly appreciated ;-).

    Thank you very much!

  • I stumbled upon this link (https://codeberg.org/Freeyourgadget/Gadg­etbridge/wiki/Sports-Activities-Workouts­) which provides some interesting insights into the sports activities and workouts features in Gadgetbridge. If the BangleJs 2 smartwatch can seamlessly integrate with Gadgetbridge for these features, it would be an absolute game-changer, offering me a convenient and comprehensive overview of my progress.

    I was going to ask exactly the same question. I assume it cannot be done right now, as Banglejs's version of Gadgetbridge doesn't show the Sports Activities tab when connected to a Bangle.js 2. For now I'm downloading the gpx files from the Recorder download option and opening it with an external app (like osmAnd+).

  • Gadgetbridge doesn't show the Sports Activities tab when connected to a Bangle.js 2

    I started work on this here.

    Please help with code or insight if you can.


    1 Attachment

    • Screenshot_20230604-092949~2.png
  • My idea was to scan for the log files of the recorder app and parse them into activities. For this to work, gadgetbridge would need to pull and parse these files from the watch. However, I have no experience with Banglejs programming, so I don't know whether that's possible.

    Another alternative would be to expose the HRM sensor as smart Heart rate measurement device.

  • My idea was to scan for the log files of the recorder app and parse them into activities. For this to work, gadgetbridge would need to pull and parse these files from the watch. However, I have no experience with Banglejs programming, so I don't know whether that's possible.

    Do you know how to do the part on the Gadgetbridge side though? If so I wouldn't have to do as much trial and error maybe :p

    Another alternative would be to expose the HRM sensor as smart Heart rate measurement device.

    Same for this, do you know how - even if just on Gadgetbridge side?

    @Gordon has added this commented code when integrating Bangle.js and Gadgetbridge:

    public boolean supportsManualHeartRateMeasurement(GBDev­ice device) {
            /* we could do this, but the current code for onHeartRateTest
            looks completely broken. There's no way to stop heart rate measurements
            and it doesn't even appear to care what device it's getting the current
            heart rate measurements from. Fixing it is too much work so disabling
            for now.
             */
            return false;
        }
    

    But that's probably not really the same thing you're talking about.

  • My idea was to scan for the log files of the recorder app and parse them into activities.

    Yes, as I understand, this is how Sport Activities work for Huami devices, it can even export gps logs as gpx files (for that format recorder already has code to export to). It uses a different tab for sport activities than regular activities (more focused on all day activity as walking, resting, sleeping... like a healthy life monitor/adviser). For sport training there are some analysis that we would like to have, like distance, pace, HR zones, slope, maps... that are not interesting for just healthy activities.

    Another alternative would be to expose the HRM sensor as smart Heart rate measurement device.

    That would require a smartphone or other device for tracking the activity and I suspect that this can already be done (or done with very little effort). In my case I want the watch to track the activity because I don't run with the phone.

  • Also regarding the title:

    Question: Is it possible to expose the HRM to Apps like OpenTracks (Like Huami devices on Gadgetbridge)

    Someone asked something similar on the Bangle.js subreddit.

  • Yeah, I found this one, too.
    However, it seems to be not that trivial as in my (very narrow) understanding of this issue, someone wanted to do exactly this in this Thread: https://forum.espruino.com/conversations­/387132/#comment17001076

  • Interesting - you could definitely show recorded tracks in Gadgetbridge, that might be neat.

    Regarding:

    Question: Is it possible to expose the HRM to Apps like OpenTracks

    You could make Bangle.js advertise as a standard Bluetooth HRM device (as @AnotherStranger showed in https://forum.espruino.com/comments/1700­4362/), and then yes that should work fine - but whether it would work at the same time as Gadgetbridge I'm not sure!

  • One more mention: I'm considering making the Recorder app use the current date in the filename instead of a number. That might make things a lot easier...

    Also as of 2v18 for the new HRM algorithm, we detect if we think we're running/doing sports or not using the amount of movement. I guess there's a possibility that could be exposed

  • One more mention: I'm considering making the Recorder app use the current date in the filename instead of a number.

    Yes please, that would make more sense. Something with the date and time would be better, because several tracks can be generated the same date.

    Track-yyyymmddhhmmss ?

  • We only have (iirc) 28 chars for the filename, so I couldn't make it do that without changing the filename (eg to use rec... rather than recorder...) but I did do YYMMDDx where x is a letter that increments for each new track that day.

    Just merged in my changes to the dev app loader

  • Thanks, will try. I really like that.

  • -How do I activate this?
    I installed recorder 0.26 (seems to be the same on dev and regular in the meantime, dev doesn`t offer update), and did a recording. Came out as numbered.
    Do all numbered recordings need be deleted?
    I do have one still on the watch that IDE doesn't manage to download (it was the longest, so too long probably?!)
    -Any hints for the easiest way to get this long recording?

  • It should work alongside numbered recordings - however I just realised that the first recording always ends up being log0 - after that i think you're fine: https://github.com/espruino/BangleApps/b­lob/master/apps/recorder/widget.js#L266-­L269

    edit: I just added 0.27 to the dev app loader that should have that fixed

    I do have one still on the watch that IDE doesn't manage to download

    Can you just download it with the app loader? https://banglejs.com/apps/?q=recorder That should be better

  • Thanks a lot!

    • Indeed, download with app loader worked immediately (wasn't aware of that option, always used IDE so far)
    • Also 0.27 works as intended. Possible reason why it didn't before: number was at 5 and I manually increased it to 6 before start recording (see next point). So it used that. Looks like you set the date filename with the new button after you detect a conflict?
    • Could this conflict menu made optional somehow? I personally never have used the Overwrite/Append/No, so its always "new". Besides the extra tap I always am a bit afraid to accidentally overwrite/append given the small buttons. So I typically manually increased the number before start (some more taps). With the date format I was hoping to get rid of that fear and taps - just start recorder with one tap.
    • If this is only me interested in or difficult: don't mind. I plan start/stop recorder from within a watch face/own app anyway and saw I can force new in the api, so should be fine

      WIDGETS["recorder"].setRecording(true, {force:"new"/"append"/"overwrite")
      

      Pretty happy to get dates instead of numbers here.

    • Could this conflict menu made optional somehow? I personally never
      have used the Overwrite/Append/No, so its always "new". Besides the
      extra tap I always am a bit afraid to accidentally overwrite/append
      given the small buttons. So I typically manually increased the number
      before start (some more taps). With the date format I was hoping to
      get rid of that fear and taps - just start recorder with one tap.
    • If this is only me interested in or difficult: don't mind. I plan
      start/stop recorder from within a watch face/own app anyway and saw I
      can force new in the api, so should be fine

    I can think of two solutions, the simplest being to introduce a new setting for this. The other one being to have the selection be made by doing single/multiple HW button presses.

  • Gadgetbridge doesn't show the Sports Activities tab when connected to a Bangle.js 2

    I started work on this
    here.

    Please help with code or insight if you can.

    Just a note to say I don't really have the motivation myself to implement this given that it feels too involved/hard for me to be able to understand and work out within reasonable time.

    So I stopped working on it for now if anyone else wants to give it a try.

    EDIT: Nevermind - I can't help myself. Trying some right now..

  • Yes, I'm not that big a fan of the selection window either. I guess one easy option is just to turn it into a scrollable menu, that would make changing the setting a bit easier?

  • @AnotherStranger @adjtm
    A little status report on my progress on Gadgetbridge Activity Tracks: https://codeberg.org/Freeyourgadget/Gadg­etbridge/pulls/3153#issuecomment-970982

    :)

  • A new status update on Gadgetbride Activity Tracks:
    https://codeberg.org/Freeyourgadget/Gadg­etbridge/pulls/3153#issuecomment-1374059­

    Since last time parsing, analyzing and display of more statistics have been added.

  • @AnotherStranger @adjtm @Gordon activity tracks support is merged into master! 🫡📣🍾

    https://codeberg.org/Freeyourgadget/Gadg­etbridge/pulls/3153

  • Great! Thanks for your work on this! I've finally managed to push an update to the Play Store, but the build was from before this was merged in.

    ... but I'll try and do another update in a week or so

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

Question: Is it possible to expose the HRM to Apps like OpenTracks (Like Huami devices on Gadgetbridge)

Posted by Avatar for AnotherStranger @AnotherStranger

Actions