• Hi, maybe just try:

      Bangle.setHRMPower(1);
      NRF.setServices({
        '180d': {  // Heart Rate Service UUID
          '2a37': {  // Heart Rate Measurement Characteristic UUID
            value: [0x00, 0x00],  // Initial value: HRM not available
            broadcast: false,
            readable: true,
            notify: true,
            description: "Heart Rate Measurement"
          }
        }
      }, { advertise: ['180d'] });  
      Bangle.on('HRM', function(hrm) {
        try {
          NRF.updateServices({
            '180d': {
              '2a37': {
                value: [hrm.confidence, hrm.bpm],
                notify: true
              }
            }
          });
        } catch (e) {
          NRF.disconnect();
        }
      });
    

    No need for the onInit stuff.

    You'll need to connect to the Bangle after you run the app. The NRF.disconnect() in the try...catch will force the Bangle to disconnect if you'd forgotten to disconnect before (if the services hadn't updated) and then you'll have to reconnect

About

Avatar for Gordon @Gordon started