problems with HRM readings samsung gear S2

problems with HRM readings samsung gear S2

BY 06 Dec 2015 Web Application Development

Hi 
I am trying to make my watch face in tizen SDK 2.3.1. I have some success in this field becouse generaly my watch is working. it shows battery lvl and date and time. but i wanted to add heart rate info. i wanted to start  measure 10 times after wrist up and than turn off to save battry. 

so i made 2 things. i added 

 
 

Code

document.addEventListener("visibilitychange", function() {
        if (!document.hidden) {
        
         tizen.humanactivitymonitor.start("HRM" , onchangedCB);
        
            // drawWatch();  -- this is my draw watch function i disabled it for testing RHM
            
        }
    });


 i made also 
 

Code

 function onchangedCB(hrmInfo)
{

hart_counter++;
context.font = '20px Courier';
context.textAlign = 'center';
context.textBaseline = 'middle';
context.fillStyle = '#909090';
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
context.fillText('HRate: '+ hrmInfo.heartRate, centerX, centerY-120);
if (hart_counter >10)
{
   hart_counter=0;
   tizen.humanactivitymonitor.stop("HRM");
}
}

the ptoblem is this. the green light is turning on  when i wake up my watch. it lights for some thime and than turns off. so HRM sensor is starting. but i alvays get moustly  0 from hrmInfo.heartRate some times i get -5. when i switch to biuld in heart monitor it works and show some results. i ncluded privilige to h ttp://tizen.org/privilige/healthinfo in config becouse without it my program wont run.  can any 1 help?

the output of my proglram look like
HRate: 0

Written by