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

File System Issue

Hi,

 

I'm developing an application that reads, stores and transfers sensor data via the messaging protocol from the fitbit watch to the companion app. Sensor data is stored locally as files on the watch until a bluetooth connection is established. Later on this data is transferred to a server via https.

 

When reading and transferring 500+ files the system starts to throw me 'out of memory' errors:

[3:10:11 PM]mem: 31416/65528
[3:10:10 PM]Error 12 Critical glue error
[3:10:11 PM]mem: 31416/65528 [3:10:10 PM]Error 12 Critical glue errorapp/sensor-io.js:252,5 [3:10:10 PM]file processing err: RangeError: Out of memory: Couldn't create buffer [3:10:17 PM]App msg queue full, see https://dev.fitbit.com/kb/message-queue-full for recommendations. [3:10:17 PM]Error 12 Critical glue errorapp/sensor-io.js:13,5 [3:10:17 PM]data store[8]: Out of memory: Failed to allocate buffer for cbor allocationapp/sensor-io.js:86,3 [3:10:21 PM]mem: 30128/65528

I am reading files with readFileSync(file, 'cbor'). I think there may be open files in background that aren't correctly closed? I do delete these files once successfully read and transferred. I've also only found a way to forcibly close binary files so I assume reading cbor encoded files automatically does that for me?

 

What I also thought of would be faulty files that are somehow really large thus causing this issue? Any ideas what could be happening here. I know it's difficult without the full code. I can provide a git repo if necessary.

 

Thanks in in advance!

Thomy

Best Answer
0 Votes
28 REPLIES 28

@JonFitbit any news on this? I can run my app for about a day before file-transfer breaks. I can share the project's source code if necessary. Would require a gitlab user or email address.

Best Answer
0 Votes

Hi,

 

I have a similar problem with file transfer being inconsistent. There was a Fitbit app released a few days ago that looked like the issue is resolved. 

 

Here are my steps performed and observation.

Before installing the watch app/clockface do the following

1. Restart the watch.

2. Restart the Fitbit app.

3. Perform Install.

 

Observation:

Files start transferring for some time till my file queue gets full. I store 5 files max in the queue.

Once my queue is full, file transfer stops. 

 

I see the same behavior even if I increase or decrease the queue size. I wait for the files to be transferred for more than 2 hrs but nothing happens. So I decide to uninstall the clockface and suddenly I see all the files that are in the queue being transferred. This is consistent behavior. 

 

Can we please have a fix for this. Thank you,

 

Kind regards,

 

Parag

Best Answer

Hi,

 

There was a Fitbit app new release yesterday. We still notice the same behavior. 

 

Another observation:  Once the files are stuck on the watch for long, There are 2 ways of clearing the queue.

 

1. restart the watch.

2. Go in setting or any other app(essentially you are unloading your app) and come back.

 

Thank you,

 

Parag

Best Answer
0 Votes

I'm guessing that the watch outbox problem can only be solved by a firmware update. Unfortunately, they don't happen very often.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Bumping this because it's still not resolved and a relevant issue for a few people.

Best Answer

I'm having the same critical issue. I didn't change source code for my app for the last 1.5 month. File Transfer was working perfectly. But when rebuilt the same source code now, I can't get my files successfully transferred via File Transfer. Is that linked to any update from the Fitbit side?

 

Any help is appreciated. Thanks

Best Answer
0 Votes

Dear all,

 

After multiple tests, I realized the watch cannot handle CPU intensive process. Remove them or find ways to reduce the frequency you are calling. 

 

  • The fix that worked for me is to remove all setinterval and screen refresh that runs every sec.
  • You need to write your code for a single-threaded application. The watch can not handle multiple processes at the same time.

Hope this helps.  thank you,

Best Answer
0 Votes

Can you confirm if this has been resolved with Fitbit OS 4.0.2 and the latest mobile apps?

Best Answer
0 Votes

Hi,

 

Yes, it works for me in Fitbit OS 4.0.2.

 

It is slow, but it does work. Thanks,

 

Parag

Best Answer
0 Votes