08-04-2015 03:09 - last edited on 08-04-2015 14:07 by JeremiahFitbit
08-04-2015 03:09 - last edited on 08-04-2015 14:07 by JeremiahFitbit
Hi,
I have been provided access to the Intraday Time Series API however we seem to have noticed a number of issues/bugs. We are using Android (Lollypop) with Samsung S4. I would be gateful for comment on the following:
1. After a short period, the Fitbit API would stop reporting heart rate values unless I manually fired up the Fitbit app to sync with the device. Even with the app running for an extended period (in front and no lock screen present), a manual sync would be needed later or the data wouldn’t be available from the API.
2. I also experimented with various levels of connectivity. I discovered that when I shut off the Bluetooth between the phone and the wearable, the API would still report data for time periods when there was no connection available to retrieve the step data. Those values would be reported as 0 for everything except the calorie feed, which looks like it’s just being calculated server side.
3. When I reconnect the device and the app would sync, the previous time periods reported as 0 would include the values from the device. Because of this issue, I’ve updated the Fitbit probe to ignore 0 values and only report time periods where a nonzero value is present, since data in the past can change in the Fitbit API and I have no mechanism for determining inactivity from a device disconnection. I’ll see gaps in my data, but those are where no activity is happening or the device hasn’t connected yet. Any empty timeslots *before* a non-zero value can be safely interpreted as inactivity, *but* any missing timeslots after the *latest* collected value may be inactivity or simply not uploaded.
Many thanks,
Amos
Moderator: Changed topic subject to correct name of endpoint
08-04-2015 10:42
08-04-2015 10:42
1. The heart rate time series endpoint only reports data after the Fitbit device has synced. This sounds like an issue with Android not allowing the Fitbit app to run in the background to do background sync. Background device sync is also sometimes suspended temporarily by Fitbit's sync servers.
2. You burn calories just by being alive. Your BMR calories are reported, even if there hasn't been a device sync.
3. That sounds like a reasonable solution.
08-07-2015 02:09
08-07-2015 02:09
Before the 2.0 API was released it used to return nothing for minutes which weren't synced, but now returns default values. I worked around this by using the get devices endpoint to determine when the user last synced, and only requesting minutes up until that point (an extra api call, I guess). Doing that might be better than ignoring zero values if you think you might run the risk of missing something.
08-07-2015 13:43
08-07-2015 13:43
I will consult with the team responsible for these endpoints to see if they are aware of any changes. (There isn't a version 2 of the API. OAuth 2.0 does not affect the functionality of any endpoint.)
08-24-2015 15:13
08-24-2015 15:13
Any further word on this issue? Would be keen to hear what your engineers say
12-26-2016 13:06
12-26-2016 13:06
I'm having the exact same problem... After some time the fitbit app stops sync'ing with the device. I'm also using the android app. I have to manually sync. Is there any way to work around this?
12-27-2016 13:24
12-27-2016 13:24
@qaguy Turn on the "Always Connected" and "All-Day Sync" setting in the Fitbit app.
12-27-2016 13:49 - edited 12-27-2016 13:58
12-27-2016 13:49 - edited 12-27-2016 13:58
Hi Andrew, both options are on. As mentioned, it works for awhile then stops. I've made sure to leave the app running in the background... but randomly it just stops working. Sometimes it will go a few hours with no sync, and other times it goes for most of the day without sync'ing. Once I go to the app (if it's running in the BG) and open it up, it reattempts a sync. I'm down to manually sync'ing it every so often.
Since i'm interested in my intra-day data, it's somewhat messy to manually sync. Is there a sync signal that can be sent from an app, to trigger the sync process?
I'm using a Samsung S7 Edge. I've seen other people mention this around as a common problem. I wish I could set a schedule on it, like sync every 5min, 10min, 20min, etc.
12-27-2016 14:26 - edited 12-27-2016 14:26
12-27-2016 14:26 - edited 12-27-2016 14:26
@qaguy wrote:
Since i'm interested in my intra-day data, it's somewhat messy to manually sync. Is there a sync signal that can be sent from an app, to trigger the sync process?
@qaguy No, there isn't a way to trigger a sync. You don't need to constantly be syncing to get intraday data though, you just need to perform a sync before trying to pull the data.
12-27-2016 14:44
12-27-2016 14:44
The whole reason I got a fitbit, after talking with the dev team and explaining my student project, was a real time heart rate monitor via a web page... using a JS framework to near real time display my heart rate data. They assured me this is possible...
It's not in my scope to have a page loaded with an hour's worth of my data from 6 hours ago on a public display - that's just far too static. I want this to sync on a regular schedule (every 5-10min.) I pull from Fitbit at a rate to stay well below the limitations on the API. But I need the sync'd data to be somewhat fresh.... not stale HR data from 8 hours ago.
The scope of my project hinged on this and the dev team told me "Oh yeah you can totally do this...." to find one roadblock after another. Perhaps I should have just gone with the Jawbone. But my money is sunk with you guys now... so here I am.
I suppose I could just use wireshark and listen for the signal you guys are throwing to get the Bluetooth to sync... I'd just rather not do that and your dev team might frown upon me doing that.
Evidently, you are unaware of this problem with your app not sync'ing on a regular schedule... it's so bad, there's actually an Android app that all it does a work around for this by reopening the Fitbit app every hour - which causes it to resync. That's just too much a hack. But I guess that's the best I can do, unelss I discover the call you make over bluetooth and emulate it.