Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Accelerometer Data in Sense for a project on Sleep at the University of Essex

ANSWERED

Dear Developers Community and Fitbit Official Support,

I am a researcher at the University of Essex. We recently secured £1.1M funds for a project about sleep and mental health.

I wrote this post for the SDK community but a user commented: “This forum isn't monitored by Fitbit (Google) staff. However, the Web API forum is monitored by a Fitbit (Google) person. Given the scale of your proposal, he may be able to put you in contact with staff who could provide more official help.” – So I reposted the post here.

For our project, we will recruit about 600 participants and they will wear a health band to keep track of their sleep quality and mental health issues. We are evaluating the possibility of buying 200 Fitbit Esense2.

Our main goal is to perform sleep stages classification. We know that from Esense2 we can have some metrics to infer a person's activity level through the Web API such as activeMinutes, activityCalories, etc.  During sleep, we can have sleep stages (e.g. wake, light, rem, deep, restless, asleep) but we want to implement a more complex algorithm based on actigraphy (x,y,z accelerometer signals) and heart rate variability (HRV), recorded by means of photoplethysmography. Therefore we need to record also the x,y,z accelerometer signals.

Furthermore, we need to record the data continuously for 8 weeks and we will send the heath band to each participant via post.
The devices only store data for 5-7 days.  So, the participants of our study will need to sync their devices with the Fitbit mobile application on a regular basis so Fitbit can store the data.   Then we can pull the data at the end of the 8 week period using the Fitbit Web API.  We are aware that to pull the data through the Web API, we will need to have each participant consent to share their data with your application.

Our problem is that, unfortunately, the Fitbit Web API does not store the accelerometer x,y,z data.  That data is only available through the Device SDK which requires building a clockface for the Sense 2 device (https://dev.fitbit.com/build/reference/device-api/accelerometer/)
Is that correct?

All of the data you asked about, except for the accelerometer data, will come from the servers using the Web API.   The accelerometer data comes directly from the Fitbit device and you'll use the Device SDK to get that data.   

Given that we are going to buy a lot of Esense2 (about 200), we need to be super sure about all the SDK functionalities (e.g. accelerometer data from the clockface sync).
In particular, we need to understand how the clock face interface work.
Can we program the clock face interface in order to save the data to our server? If so, should we use an ftp protocol?
Can we, instead, save the data on Fitbit server and download the accelerometer data together with the other data (e.g. HRV) that we download through the Web API? I mean that we use the Web API to download all the data except the accelerometer data and something else (what?) to download the accelerometer data.
Can be the sync performed automatically? Should the user intervene, instead?

When you request the accelerometer data from the clockface, I think this is done at sync time.  The data is transferred to your server, but also transferred to our servers.   We use the accelerometer data to calculate the sleep stage information.  However, the raw data is not available through the Web API. 

A user from the other forum commented: “To capture accelerometer data on Sense 2, you'd need to develop and install a custom clockface/app on the watches (so yes, you're right about the Device SDK). Fitbit hasn't released a SDK for Sense 2 that would allow this. Some developers have managed to get a beta SDK to work, or you could use an earlier Fitbit OS watch type.”

And another user advised to use Sense rather than Sense2. The problem is the Sense is not anymore in stock.

Another user suggested to  SimpleSleep app monitors sleeping position during the night on a Sense using the Gyroscope which may be useful information for your study. He also suggested to use a universal chest strap watch band extension.
However, I don’t think I can integrate SimpleSleep app into my app because I don’t think that it’s open source.

Another user commented: “Your clockface/app would need to run continually, since Fitbit OS doesn't support background processes. It would need to transfer data from the watch fairly frequently since accelerometer data is voluminous and watch storage is limited. Keeping this up for eight weeks is theoretically possible but, I fear, ambitious in practice. Basically, you have to write your own sync system for accelerometer data.”

So I understand that all this is feasible but I have to program my own sync system and ask each participant to keep the clockface always active. Furthermore, I would need an "alarm" system that warns me when a participant is not syncing. 
However, I would need an official opinion from someone from Fitbit (Google).

Happy to have a Zoom / Teams  meeting with someone from the support.

Kind regards,
Vito

 

Dr. Vito De Feo
Lecturer in Health Artificial Intelligence for Brain and Mental Health

Artificial Intelligence Team and Consumer Neuroscience Research Cluster

Future Health Technology and Brain-Computer Interfaces laboratories, 

School of Computer Science and Electronic Engineering, 

University of Essex, Wivenhoe Park, Colchester CO4 3SQ, UK ►https://www.essex.ac.uk/people/defeo60201/vito-de-feo

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

This post was duplicated in the Device SDK forums.   See https://community.fitbit.com/t5/Web-API-Development/SDK-for-Accelerometer-Data-in-Esense2-for-a-proj....

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

Hi @vitodefeo 

As I said in your other post, I was on holiday the past few days.   I will see if I can track some of the answers for you.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

This post was duplicated in the Device SDK forums.   See https://community.fitbit.com/t5/Web-API-Development/SDK-for-Accelerometer-Data-in-Esense2-for-a-proj....

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes