语言

Menu
Sites
Language
problems with HRM readings samsung gear S2

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

编辑者为: kowalski 06 12月, 2015

响应

5 回复
Gunwang Jeong

The initial heartrate values are zero for a few seconds. Because, MCU should calculate a heartrate with hrm raw data samples.

It could take about a few seconds (7~8sec.) Checking only a few cb is not sufficient. Need to check until coming a valid heartrate value (> 0).

Maciej

Hello. I also get -5 value sometimes. What does it mean? Documentation states:

 

readonly long heartRate

Heart rate in beats per minute. When a user takes off the watch device, the heartRate is set to -3. When a user shakes the watch, the heartRate is set to -2.
 
Nothing about -5 value.
 
In general, heart rate sensor seems very erratic. Sometimes the heart rate is detected after 7-8 seconds. Sometimes it takes more than 15 seconds. Sometimes it doesn't work at all (zeroes all the time). My application needs to check the heart rate regularly, so it causes problems. Waiting for heart rate data for that long causes battery strain.
Ken

Also got the -5 value.

Is there any suggestion?

Gunwang Jeong

The value "-5" means same as the value "-3". That means your heart rate signal is not good.
So you can assume that both -3 and -5 mean unusual cases like wristed off.

Ken

Hi,

I understand that it's possible to take a few seconds to fetch the non-zero heratrate value.

After i wear the watch(Gear S2) on the wrist and waiting for 30 seconds, however, i still get only the -5 value.

It seems that the API "tizen.humanactivitymonitor.start("HRM" , onchangedCB)" is not stable?

Is there anything i need to check before i use this API?

Thanks.