• Hi together,

    I've just updated my BangleJS1 with the newest firmware 2v12 (using the Web IDE) and used the install default applications function to put the watch into the default state. By installing the app "Bluetooth Heart Rate Monitor" from the apps I get some strange behavior. At boot and instantly after showing the clock, I get a interpreter error/exception hinting to LOW_MEMORY. By navigating to any app/main screen I always get the message "Updating boot0...". If I uninstall the "Bluetooth Heart Rate Monitor" app, the problems disappear.

    Can someone confirm the problem with their own BangleJS1 watch?

    Unfortunately I use this functionality with a external HR sensor for my sports.

    Best regards
    Manuel


    2 Attachments

    • updateing_boot0.jpg
    • low_memory.jpg
  • Do you have the Pretokenise apps before upload option enabled in the app loader's more... tab? if it's not on, enabling it would help.

    I've just made some changes - please can you try uploading 'bootloader' to the latest from the development app loader.

    Basically it looks like the original Bluetooth HRM code has now expanded in size to the point where it's causing memory usage problems creating the boot file on Bangle.js 1. The original code was 80 lines, and it's now up to 550!

    @halemmerich is it possible there's some stuff in there that we don't really need that we could make smaller or strip out? I know it does loads of stuff now, but I feel like most people only use the basics, so if it's not going to be usable on Bangle.js 1 maybe we need to provide a stripped-down version as well? Or maybe I guess we store all the code in a different file so it's not added to the boot code.

    But... it seems the main issue here was actually the bootloader updater was trying to keep all the data for the '.boot0' file in RAM before writing it, and with the big boot file in bthrm it was just too much (perhaps alongside other apps you had installed?).

    I've hopefully fixed that now, but if .boot.js files get any bigger it's possible we'll have issues further down the line.

  • Hi, the "Pretokenise apps before upload" was enabled. I've now installed the bootloader with your changes in https://github.com/espruino/BangleApps/c­ommit/7c4032d6fbff6967508259865b4afd9778­7b9845 and it works again.
    Thanks for your quick support!

  • Unfortunately my BangleJS1 is not connecting anymore to the BTHRM (COOSPO-H808S). In the newest development version I'm able to use the new scan functionality in app settings to set the device explicitly. By starting the BTHRM app it only displays: "loading" and it falls back to the internal HRM.

  • Argh, thanks. But the older one works ok?

  • There surely are some things that could be moved out of boot or at least made optional during execution.

    How about moving the discovery and device caching code completely into the settings? The scanning currently only sets a filter that is then used by the boot code.
    Maybe splitting the bthrm app into a relatively small generic part for using bt sensors (reconnects, caching, error handling) and more specialized modules for actually parsing the data and emitting events (hrm, cadence, battery) would help.

    @metallisto can you try to activate debug logging in the settings and check in the IDE if there is some kind of error while trying to start the app? It can take a while on first connect, subsequent tries should be faster. Initial connect with my two different sensors takes around 10s. Some sensors seem to be more problematic than others. You can try to set the grace periods in the settings to help those sensors along. Those just create some waiting time at different stages of the connection process, so nothing to loose but a few seconds.

  • Thanks - I guess yes, making the cache stuff part of settings could simplify things a lot (although to make it simple we'd have to make sure we then only handle devices that had been paired from settings).

    I guess it's not a big deal for now though as hopefully this has fixed things.

    @metallisto please can you try to update to bootloader 0.45 and then do Settings -> Utils -> Rewrite settings? It looks like there was a bug in 0.44 which could have caused this kind of problem.

    But if that doesn't work it'd be great if you can try what @halemmerich mentioned above so we have some idea what's going on

  • Sorry for late response:

    Just connected with the web ide and got this exception:

    Uncaught Error: Function "setBTHRMPower" not found!
     at line 14 col 36 in bthrm.app.js
    ...ings.startWithHrm)){Bangle.setBTHRMPo­wer(1,'bthrm');}
                                  ^
    

    Seems like the boot part of bthrm is not correctly loaded.

  • Today I updated the firmware to the newest version and also updated all apps including the BTHRM, Boot, Run etc. I still get the same exception and it still doesn't work. Can I help with any more information? Is the problem only related to the BangleJS1, could my watch be defect? Are there any news/progress regarding this problem?

    The function "setBTHRMPower" is defined in the bthrm.0.boot.js file. Looks like the file is not loaded at boot.

    Best regards

  • could my watch be defect?

    I can pretty much guarantee it's fine.

    It's possible that you hit an issue with the bootloader in earlier firmwares and it hasn't updated. Maybe try going to Settings -> Utils -> Rewrite settings and see if that helps?

    If you're running the Web IDE, when you switch apps, do you see any error messages?

  • Hey together,

    Device info:
    Device Type BANGLEJS
    Firmware Version 2v13
    Apps Installed boot, launch, setting, bthrm

    {"id":"boot","version":"0.47","files":"b­oot.info,.boot0,.bootcde,bootupdate.js"}­,{"id":"launch","version":"0.13","files"­:"launch.info,launch.app.js,launch.setti­ngs.js","data":"launch.json"},{"id":"set­ting","version":"0.44","files":"setting.­info,setting.app.js,setting.img","data":­"setting.json"},{"id":"bthrm","version":­"0.08","files":"bthrm.info,bthrm.app.js,­bthrm.recorder.js,bthrm.0.boot.js,bthrm.­img,bthrm.settings.js,bthrm.default.json­"},"BANGLEJS","2v13",1652684710]
    

    I've now erased everything, installed only boot, launch, setting and resetted, rewrote the settings and rebooted the watch. After that I connected the WebIDE, connected the app store and then only installed the BTHRM app. After reloading and starting the BTHRM app I get:

     2v13 (c) 2021 G.Williams
    Uncaught Error: Function "setBTHRMPower" not found!
     at line 13 col 1 in .boot0
    [ERASED]...
           ^
     at line 14 col 36 in bthrm.app.js
    ...ings.startWithHrm)){Bangle.setBTHRMPo­wer(1,'bthrm');}
                                  ^
    > 
    

    I've even tried to remove all files from the device storage from the WebIDE before reinstall.

    Also tried everything with and without the "Pretokenise apps..." option.

    Best regards

  • Please could you go to 'Backup' in the app loader More... section, and then send me the zip file it creates? It should allow me to debug this here and figure out what's going on...

  • By executing the .boot0 file, I also get this exception. Looks like the file is not read completely.

     2v13 (c) 2021 G.Williams
    Uncaught SyntaxError: Got [ERASED] expected EOF
     at line 13 col 1 in .boot0
    [ERASED]...
           ^
     at line 13 col 1 in .boot0
    [ERASED]...
           ^
    > 
    
  • Executing bootupdate.js brings:

     2v13 (c) 2021 G.Williams
    Uncaught Error: Not enough stack memory to decode data
     at line 200 col 50 in bootupdate.js
      require('Storage').write('.boot0',bf,fil­eOffset);
                                                     ^
    in function called from line 204 col 2 in bootupdate.js
    });
     ^
    > 
    
  • Ahh, great - thank you! That narrows it right down!

    I've just added workaround in bootupdate.js now. If you use the 'development' app loader and install Bootloader 0.48 this should now be fixed (if not immediately, after a 'rewrite settings').

    I'll see about getting a fix into Espruino itself, as it should really be able to write files bigger than that

  • Yes this fixed the problem and BTHRM is starting and working now. Thanks!

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

Bluetooth Heart Rate Monitor causing boot problems

Posted by Avatar for metallisto @metallisto

Actions