03-07-2024 05:12
03-07-2024 05:12
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.
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
Answered! Go to the Best Answer.
03-25-2024 12:38
03-25-2024 12:38
Hi @vitodefeo
You are correct that you will need to download the provided Beta SDK to use the Sense 2. We typically don't recommend a developer for projects. My recommendation is to ask in the SDK community forum to see if someone is willing to help you, or you can check with your IT team to see if you can acquire developer resources.
The Accelerometer API documentation, https://dev.fitbit.com/build/reference/device-api/accelerometer/, states there is an "onreading" property that let's you know when there is new data to download. Also, on that page is a link to the Accelerometer Sensor Guide, https://dev.fitbit.com/build/guides/sensors/accelerometer/, with some information on how to pull the data along with some sample code and best practice. I would read these 2 pages for best practices on reading accelerometer data.
03-07-2024 09:48
03-07-2024 09:48
Hi @vitodefeo
I've contacted someone on the Device SDK team to respond to your post in the Device SDK room.
Gordon
03-14-2024 09:55
03-14-2024 09:55
Hi Gordon,
Many thanks.
Vito
03-14-2024 10:01
03-14-2024 10:01
Hi again @Gordon-C
No-one replied...
Can you please help me?
Many thanks,
Vito
03-17-2024 13:03
03-17-2024 13:03
Hi @Gordon-C,
No one replied... could you please chase someone to reply?
Many thanks!
Vito
03-19-2024 05:55
03-19-2024 05:55
Hi @vitodefeo
I've been on holiday the last few business days. I will see if I can get answers for you.
03-22-2024 10:41
03-22-2024 10:41
Hi @vitodefeo
What I understand from our engineering team is what you're trying to achieve is not simple. it's recommend you find a 3rd party developer with existing experience to build their solution.
Anyway, in relation to the specific questions:
For the clock face specifically, it would need to do the following:
Hope this helps,
03-24-2024 02:49 - edited 03-24-2024 14:03
03-24-2024 02:49 - edited 03-24-2024 14:03
Hi @Gordon-C ,
Many thanks for your reply and sorry if I pushed you. I didn’t know you were on holiday.
Your answers are very helpful!
About the engineering team, what I understand that what I am trying to achieve is not simple but possible with Sense2. From previous comments, I had understood that the SDK was not enough developed for Sense2.
Can you please ask your engineering team:
In relation to my specific questions and your answers:
In relation to the clock face specifically and your answers:
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
03-25-2024 12:38
03-25-2024 12:38
Hi @vitodefeo
You are correct that you will need to download the provided Beta SDK to use the Sense 2. We typically don't recommend a developer for projects. My recommendation is to ask in the SDK community forum to see if someone is willing to help you, or you can check with your IT team to see if you can acquire developer resources.
The Accelerometer API documentation, https://dev.fitbit.com/build/reference/device-api/accelerometer/, states there is an "onreading" property that let's you know when there is new data to download. Also, on that page is a link to the Accelerometer Sensor Guide, https://dev.fitbit.com/build/guides/sensors/accelerometer/, with some information on how to pull the data along with some sample code and best practice. I would read these 2 pages for best practices on reading accelerometer data.
03-26-2024 09:32
03-26-2024 09:32
Hi @Gordon-C ,
Thank you very much for the valuable information.
We will definitely hire a developer and I will also ask in the community.
My biggest concern is the data transmission. Surely the raw data from the accelerometer is much heavier than the aggregated data that is normally downloaded via Bluetooth. I think that is why this transfer is not done.
For this reason, we will do an initial feature extraction directly in the device via the SDK.
Any advice is welcome!
Thank you very much!
Vito
03-28-2024 07:58
03-28-2024 07:58
Hi @Gordon-C ,
Do you think that Google is going to release the SDK full version or is the beta version not going to be updated?
Many thanks,
Vito
03-29-2024 06:48
03-29-2024 06:48
If this is the release that I'm thinking of, you should treat the beta as code final and had been run through our full test suite.
04-03-2024 00:05
04-03-2024 00:05
Thanks @Gordon-C
Then, maybe, you (Google / Fitbit) can stop to call it "Beta".
If you tested it, then IMHO, it would been a better marketing strategy to call it "Final".
I mean: it's a great thing that it has been tested!
Many thanks again,
Vito
04-04-2024 01:22
04-04-2024 01:22
HI @vitodefeo - in light of the Google restrictions for EEA users who will no longer be able to download clocks or apps from the Gallery as of June 2024 it might be wise to look at other brands which have better support for your project in the long term.
The restrictions may not currently apply to the UK [as yet unknown, as no list of countries was specified, so it's open to interpretation] but it may not be long before they too do.
I've add this comment here too as it may be helpful for users only following this thread.
Author | ch, passion for improvement.
04-07-2024 10:52
04-07-2024 10:52
Anyone knows if it possible after June 2024 to download private apps through a private link?
04-07-2024 11:16
04-07-2024 11:16
Hi @GeekBit - thanks, I have already escalated questions such as this and also will developers have full GAM access to maintain their work for non Europeans and how will already downloaded items be maintained in Europe if download is not possible, etc. We will see if we get more information and will post it here.
Author | ch, passion for improvement.
04-08-2024 23:22
04-08-2024 23:22
@GeekBit- see more information here Removal of third party products from the Fitbit Online Gallery for EEA users
Author | ch, passion for improvement.
04-19-2024 07:10
04-19-2024 07:10
Hi all ,
Actually, I don't understand this. Why should we download third-party apps?
We need to design our own clock face.
Sorry, I don't understand.
Can you please explain to me more?
Sorry if I don't understand and many thanks,
Vito
04-19-2024 07:24
04-19-2024 07:24
@vitodefeo - see this post for explanation.
Author | ch, passion for improvement.