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

Outbox File Sync

Hi,

 

I am performing a file transfer on Ionic. Two question

 

1. Once a file has been queued in outbox, how to often is the file scheduled to send the file to the companion app ?

2. How many files can the watch queue in the outbox?

 

Thank you,

 

Parag

Best Answer
0 Votes
16 REPLIES 16

The system tries to deliver your file as quickly as possible, but it can be delayed by other traffic, such as syncing with our backend.

 

I'm not sure about an upper limit for the file queue, but you are limited to 15mb total storage on the device, including your application code and resources.

Best Answer
0 Votes

Thanks for quick reply Jon. Here are my findings.

 

1. The companion App will Sync every 10 min.

with "Wake the Companion after X minutes

me.wakeInterval = wakeInterval;"
 
2. The upper limit of sending files in queue depends on the number of files and each file size. with a 10kb file, I can send around 11 files. 
 
Thank you,
 
Parag
Best Answer
0 Votes

File transfer to the device isn't dependent upon the companion running. Once you queue your files, the mobile app takes care of the transfer.

Best Answer
0 Votes

Hi Jon,

 

Seems that once files are queued on the outbox I don't see any files received on the mobile app end. Well, it is quite inconsistent on transfer. My observation sometimes files is sent within minutes and sometimes the files are stuck on the watch forever. I am not able to identify a pattern. 

 

Side note: The phone is near the watch always. 

 

Any suggestion, how to tackle this problem. Thank you,

 

Kind regards,

Parag

Best Answer
0 Votes

Is the mobile app up to date? Android or iOS? Are you using a unique filename for each transfer?

Best Answer
0 Votes

The mobile app is updated. It is Android app. 

 

Yes, each file is unique. I can see all the unique files that are queued in the console. 

 

stringDateTime = stringDateTime.toString().substring(6,12); 
filename = "dt" + stringDateTime;
console.log("Create Filename:" + filename);
fd = fs.openSync(filename, "a+");

 

I also realize the file transfer totally stopped working after the mobile app update. It might just be a coincidence.

Best Answer
0 Votes

If you reboot the phone and Fitbit device, does the transfer start working? Is the Fitbit data sync working ok?

Best Answer
0 Votes

I've seen this behaviour. I tried clearing the queue but the API for that was broken at the time.

 

IIRC, deleting the Fitbit app's data (Android) might have got the file transfers going again (with the obvious exception of whatever was in the queue previously). Or stopping and restarting the Fitbit app might have done it. Nevertheless, they would be things you could try, and which might help to indicate where the problem lies.

Same issue as here, I think.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

I have tried rebooting and also a factory reset. But the same behavior.

 

The fitbit data sync seems to be working fine. 

Best Answer
0 Votes

Thanks for the reply Catplace,

 

Before the most recent app release file transfer was inconsistent, but file used to get transferred sometime. 

 

Now it has totally stopped. Reinstalling the app, performing a clean install or even doing a factory reset does not help.

Best Answer
0 Votes

One more finding:

 

I am able to transfer a file from the companion app to the device consistently. 


@parag_kudtarkar wrote:

Thanks for the reply Catplace,

 

Before the most recent app release file transfer was inconsistent, but file used to get transferred sometime. 

 

Now it has totally stopped. Reinstalling the app, performing a clean install or even doing a factory reset does not help.


 

Best Answer
0 Votes

Hi,

 

I have created a test app to send file 

https://github.com/wirefree/Fitbit_File_Transfer/tree/master/TestTransfer-export

 

Do let me know if I am doing anything wrong. Thank you,

 

Parag

Best Answer
0 Votes

I did some testing here and was able to receive your files. I did make some small changes for testing purposes.

 

//app/index.js
import document from "document"; import * as fs from "fs"; import { outbox } from "file-transfer"; let statusText = document.getElementById("status"); statusText.text = "Waiting..."; let fd = null; function createFile() { let filename; let stringDateTime = new Date().getTime(); stringDateTime = stringDateTime.toString().substring(6,12); filename = "dt" + stringDateTime; console.log("Create Filename:" + filename); fd = fs.openSync(filename, "a+"); let i = 0; while(i<10) { let stringDateTime = new Date().getTime(); stringDateTime = stringDateTime.toString().substring(6,12); console.log(stringDateTime) let buffer = new ArrayBuffer(4); let newUint = new Uint32Array(buffer); newUint[0] = stringDateTime; fs.writeSync(fd, buffer); i++; } fs.closeSync(fd); fd = null; sendFileOutbox(filename); } createFile(); async function sendFileOutbox(filename){ console.log("Start sending"); outbox .enqueueFile(filename) .then((ft) => { console.log("File " + filename + " successfully queued."); }) .catch((error) => { console.log(`Failed to schedule transfer: $‌{error}`); }) ft.unlinkSync(ft.name); console.log("Successful delete"); createFile(); }
//companion/index.js
import { inbox } from "file-transfer"; async function processAllFiles() { let file; while ((file = await inbox.pop())) { const payload = await file.arrayBuffer(); const typedArray = new Uint32Array(payload); const array = Array.from(typedArray) array.forEach((item) => { console.log(`item: ${item}`) }) } } inbox.addEventListener("newfile", processAllFiles); processAllFiles();

 

 

 

 

 

 

Best Answer
0 Votes

Dear all,

 

I would like to reopen the file transfer issue. 

 

  • fitbit OS SDK 4.0.
  • iPhone 10 X - iOS 13.3.1

Fitbit clockface file transfer setting. 

  • Max file size to store data: 200 kb.
  • Max number of files stored locally = 80
  • Max files stored in outbox queue = 15.

Logic:

1. Create new file. Maximum files that can be created are 80.

2. Fill the file till filesize 200 kb.

3. Send file to fitbit outbox. Maximum number of files that can be put in outbox queue are 15. 

4. Follow step 1.

 

(Assumption here is Ionic OS will take care of sending file from outbox to phone) . 

 

Observation: Files transfer works fine on an initial install. It does a great job in sending the file to the phone. 

 

Failure point: Once the device outbox-queue max out and local file max out, no data is transferred to the phone. The only solution is reinstall the clockface. 

 

Please guide me on the how should we address this issue. Below are few other questions from my previous post.

 

1. Once a file has been queued in outbox, how often is the file scheduled to send the file to the companion app ?

2. How many files can the watch queue in the outbox?

 

Looking forward for a quick response. thank you,

 

Kind regards,

 

Parag Kudtarkar

 

Best Answer
0 Votes

Another observation is, When bluetooth get disconnected(e.g. if the watch gets away from phone) then gets connected again . The file transfer does not get initiated even if there are files in the outbox. 

Best Answer

What is the way around this then?

Best Answer